mirror of
https://github.com/OpenBankProject/API-Manager.git
synced 2026-02-06 15:26:46 +00:00
feature/Query users by locked status
This commit is contained in:
parent
ae4dac574f
commit
273d5a6be6
@ -2,6 +2,7 @@
|
||||
<div class="btn-group">
|
||||
<form action="" method="get">
|
||||
<input type="hidden" name="role_name" value="{{ active_role_name }}" />
|
||||
<input type="hidden" name="locked_status" value="{{ active_locked_status }}" />
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" size="30" name="email" placeholder="Enter email address ..." value="{% if not active_email_all %}{{ active_email }}{% endif %}" />
|
||||
<span class="input-group-btn"><button class="btn btn-default" type="submit"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></button></span>
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
<div class="btn-group">
|
||||
<form action="" method="get">
|
||||
<input type="hidden" name="role_name" value="{{ active_role_name }}" />
|
||||
<input type="hidden" name="locked_status" value="{{ active_locked_status }}" />
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" size="30" name="username" placeholder="Enter username ..." value="{% if not active_username_all %}{{ active_username }}{% endif %}" />
|
||||
<span class="input-group-btn"><button class="btn btn-default" type="submit"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></button></span>
|
||||
|
||||
@ -13,6 +13,14 @@
|
||||
{% include "users/includes/filter_role.html" %}
|
||||
{% include "users/includes/filter_email.html" %}
|
||||
{% include "users/includes/filter_username.html" %}
|
||||
<div id="filter-time" class="filter">
|
||||
<div class="btn-group hidden-sm hidden-xs filter-time" role="group" aria-label="filter-time">
|
||||
{% include "users/includes/filter_locked.html" %}
|
||||
</div>
|
||||
<div class="btn-group-vertical visible-sm visible-xs filter-time" role="group" aria-label="filter-time">
|
||||
{% include "users/includes/filter_locked.html" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hidden-sm hidden-md hidden-lg">
|
||||
<div class="row">
|
||||
|
||||
@ -82,13 +82,15 @@ class IndexView(LoginRequiredMixin, TemplateView):
|
||||
offset = self.request.GET.get('offset', 0)
|
||||
email = self.request.GET.get('email')
|
||||
username = self.request.GET.get('username')
|
||||
lockedstatus = self.request.GET.get('locked_status')
|
||||
if lockedstatus is None: lockedstatus = "active"
|
||||
|
||||
if email:
|
||||
urlpath = '/users/email/{}/terminator'.format(email)
|
||||
elif username:
|
||||
urlpath = '/users/username/{}'.format(username)
|
||||
else:
|
||||
urlpath = '/users?limit={}&offset={}'.format(limit, offset)
|
||||
urlpath = '/users?limit={}&offset={}&locked_status={}'.format(limit, offset, lockedstatus)
|
||||
|
||||
users = []
|
||||
try:
|
||||
@ -115,7 +117,8 @@ class IndexView(LoginRequiredMixin, TemplateView):
|
||||
},
|
||||
'users': users,
|
||||
'limit': limit,
|
||||
'offset': offset
|
||||
'offset': offset,
|
||||
'locked_status': lockedstatus
|
||||
})
|
||||
return context
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user