Added autofocus

PUT /api/groups/:id can now update the group name and modified date
pull/24/head
Jordan 2014-03-19 20:27:09 -05:00
parent b3e411c54c
commit bfdf9ca00e
4 changed files with 14 additions and 6 deletions

View File

@ -7,6 +7,7 @@ import (
"log"
"net/mail"
"os"
"time"
"github.com/coopernurse/gorp"
"github.com/jordan-wright/gophish/config"
@ -304,6 +305,13 @@ func PutGroup(g *models.Group, uid int64) error {
insertTargetIntoGroup(nt, g.Id)
}
}
// Update the group
g.ModifiedDate = time.Now()
_, err = Conn.Update(g)
if err != nil {
Logger.Println(err)
return err
}
return nil
}

View File

@ -54,7 +54,7 @@
</table>
</div>
<!-- New Campaign Modal -->
<div class="modal" id="newCampaignModal" tabindex="-1" role="dialog" aria-labelledby="campaignModalLabel" aria-hidden="true">
<div class="modal" id="newCampaignModal" role="dialog" aria-labelledby="campaignModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
@ -67,7 +67,7 @@
</div>
<div class="form-group">
<label for="name">Name:</label>
<input type="text" class="form-control" ng-model="campaign.name" id="name" placeholder="Campaign name">
<input type="text" class="form-control" ng-model="campaign.name" id="name" placeholder="Campaign name" autofocus>
<br />
<label class="control-label" for="users">Groups:</label>
<form ng:submit="addGroup()">

View File

@ -52,7 +52,7 @@
</div>
</div>
<!-- New Template Modal -->
<div class="modal" id="newTemplateModal" tabindex="-1" role="dialog" aria-labelledby="templateModalLabel" aria-hidden="true">
<div class="modal" id="newTemplateModal" role="dialog" aria-labelledby="templateModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
@ -63,7 +63,7 @@
<div class="modal-body">
<label class="control-label" for="name">Name:</label>
<div class="form-group">
<input type="text" class="form-control" ng-model="template.name" placeholder="Template name" id="name" />
<input type="text" class="form-control" ng-model="template.name" placeholder="Template name" id="name" autofocus/>
</div>
<!-- Nav tabs -->
<ul class="nav nav-tabs">

View File

@ -56,7 +56,7 @@
</div>
</div>
<!-- New Group Modal -->
<div class="modal" id="newGroupModal" tabindex="-1" role="dialog" aria-labelledby="groupModalLabel" aria-hidden="true">
<div class="modal" id="newGroupModal" role="dialog" aria-labelledby="groupModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
@ -67,7 +67,7 @@
<div class="modal-body">
<label class="control-label" for="name">Name:</label>
<div class="form-group">
<input type="text" class="form-control" ng-model="group.name" placeholder="Group name" id="name" />
<input type="text" class="form-control" ng-model="group.name" placeholder="Group name" id="name" autofocus/>
</div>
<fieldset disabled>
<div class="form-group">