mirror of https://github.com/gophish/gophish
Updated interfacing with ng-table module. Will propagate changes to campaigns soon.
Updated footer copyright year Cleaned up tables in templatespull/24/head
parent
b471a886e3
commit
d72bc4b7df
|
@ -190,7 +190,7 @@ func API_Groups_Id(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
writeJSON(w, gj)
|
||||
case r.Method == "DELETE":
|
||||
err := db.DeleteGroup(id)
|
||||
err := db.DeleteGroup(id, ctx.Get(r, "user_id").(int64))
|
||||
if checkError(err, w, "Error creating JSON response") {
|
||||
return
|
||||
}
|
||||
|
|
2
db/db.go
2
db/db.go
|
@ -207,6 +207,6 @@ func PostGroup(g *models.Group, uid int64) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func DeleteGroup(id int64) error {
|
||||
func DeleteGroup(id int64, uid int64) error {
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -105,3 +105,7 @@
|
|||
float:right;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.pagination {
|
||||
margin:0px;
|
||||
}
|
|
@ -24,10 +24,25 @@ app.controller('CampaignCtrl', function($scope, CampaignService) {
|
|||
})
|
||||
});
|
||||
|
||||
app.controller('GroupCtrl', function($scope, GroupService) {
|
||||
app.controller('GroupCtrl', function($scope, GroupService, ngTableParams) {
|
||||
|
||||
|
||||
$scope.tableParams = new ngTableParams({
|
||||
page: 1, // show first page
|
||||
count: 10, // count per page
|
||||
sorting: {
|
||||
name: 'asc' // initial sorting
|
||||
}
|
||||
}, {
|
||||
total: 0, // length of data
|
||||
getData: function($defer, params) {
|
||||
GroupService.query(function(groups) {
|
||||
$scope.groups = groups
|
||||
params.total(groups.length)
|
||||
$defer.resolve(groups.slice((params.page() - 1) * params.count(), params.page() * params.count()));
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
$scope.editGroup = function(group) {
|
||||
if (group === 'new') {
|
||||
|
@ -61,8 +76,7 @@ app.controller('GroupCtrl', function($scope, GroupService) {
|
|||
newGroup.$save(function() {
|
||||
$scope.groups.push(newGroup);
|
||||
});
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
newGroup.$update()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<div class="container">
|
||||
<hr>
|
||||
<footer>
|
||||
<p>© Jordan (<a href="https://github.com/jordan-wright">jordan-wright</a>) 2013</p>
|
||||
<p>© Jordan (<a href="https://github.com/jordan-wright">jordan-wright</a>) 2014</p>
|
||||
</footer>
|
||||
</div>
|
||||
<!-- Placed at the end of the document so the pages load faster -->
|
||||
|
|
|
@ -25,18 +25,11 @@
|
|||
</div>
|
||||
|
||||
<div class="row">
|
||||
<table ng-table class="table table-hover table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-sm-1">Name</th>
|
||||
<th class="col-sm-2">Members</th>
|
||||
<th class="col-sm-1">Modified Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<table ng-table="tableParams" class="table table-hover table-striped table-bordered">
|
||||
<tbody>
|
||||
<tr ng-repeat="group in groups" class="editable-row">
|
||||
<td>{{group.name}}</td>
|
||||
<td>
|
||||
<tr ng-repeat="group in $data" class="editable-row">
|
||||
<td data-title="'Name'" class="col-sm-1">{{group.name}}</td>
|
||||
<td data-title="'Members'" class="col-sm-2">
|
||||
<span ng-repeat="target in group.targets">
|
||||
{{target.email}}{{$last ? '' : ', '}}
|
||||
</span>
|
||||
|
@ -56,14 +49,14 @@
|
|||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
<td>{{group.modified_date | date:'medium'}}</td>
|
||||
<td data-title="'Modified Date'" class="col-sm-1">{{group.modified_date | date:'medium'}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- New Campaign Modal -->
|
||||
<div class="modal" id="newGroupModal" tabindex="-1" role="dialog" aria-labelledby="groupModalLabel" aria-hidden="true" >
|
||||
<div class="modal" id="newGroupModal" tabindex="-1" role="dialog" aria-labelledby="groupModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
|
|
Loading…
Reference in New Issue