Skip to content

Commit

Permalink
add state to list users
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Jan 20, 2020
1 parent 6214586 commit 732e362
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions userManagment/static/userManagment/userManagment.js
Original file line number Diff line number Diff line change
Expand Up @@ -1685,6 +1685,10 @@ app.controller('listTableUsers', function ($scope, $http) {


};

$scope.controlUserState = function (state) {
alert(state);
}

});

Expand Down
8 changes: 8 additions & 0 deletions userManagment/templates/userManagment/listUsers.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ <h3 class="content-box-header">
<th>{% trans "Disk Usage" %}</th>
<th>{% trans "ACL" %}</th>
<th>{% trans "Owner" %}</th>
<th>{% trans "State" %}</th>
<th>{% trans "Actions" %}</th>
</tr>
</thead>
Expand All @@ -44,7 +45,14 @@ <h3 class="content-box-header">
<td ng-bind="record.diskUsage"></td>
<td ng-bind="record.acl"></td>
<td ng-bind="record.owner"></td>
<td ng-bind="record.state"></td>
<td>
<a ng-show="record.state=='ACTIVE'"
class="btn btn-border btn-alt border-red btn-link font-red" href="#"
ng-click="controlUserState('SUSPEND')" title=""><span>{% trans 'Suspend' %}</span></a>
<a ng-show="record.state=='SUSPENDED'"
class="btn btn-border btn-alt border-green btn-link font-green" href="#"
ng-click="controlUserState('ACTIVATE')" title=""><span>{% trans 'Activate' %}</span></a>
<a data-toggle="modal" data-target="#settings"
ng-click="editInitial(record.name)"
class="btn btn-border btn-alt border-purple btn-link font-purple" href="#"
Expand Down
3 changes: 2 additions & 1 deletion userManagment/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,8 @@ def fetchTableUsers(request):
'owner': owner.userName,
'acl': items.acl.name,
'diskUsage': '%sMB' % str(diskUsage),
'websites': items.initWebsitesLimit
'websites': items.initWebsitesLimit,
'state': items.state
}

if checker == 0:
Expand Down

0 comments on commit 732e362

Please sign in to comment.