mirror of https://github.com/gophish/gophish
Added autofocus
PUT /api/groups/:id can now update the group name and modified datepull/24/head
parent
b3e411c54c
commit
bfdf9ca00e
8
db/db.go
8
db/db.go
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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()">
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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">
|
||||
|
|
Loading…
Reference in New Issue