mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Merge pull request #2158 from alphagov/admin_platform_users_search
Admin can find users by email and see information about them
This commit is contained in:
51
app/templates/views/find-users/find-users-by-email.html
Normal file
51
app/templates/views/find-users/find-users-by-email.html
Normal file
@@ -0,0 +1,51 @@
|
||||
{% extends "views/platform-admin/_base_template.html" %}
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
|
||||
{% block per_page_title %}
|
||||
Find users by email
|
||||
{% endblock %}
|
||||
|
||||
{% block platform_admin_content %}
|
||||
|
||||
<h1 class="heading-large">
|
||||
Find users by email
|
||||
</h1>
|
||||
|
||||
<form
|
||||
method="post"
|
||||
action="{{ url_for('.find_users_by_email') }}"
|
||||
class="grid-row"
|
||||
>
|
||||
<div class="column-three-quarters">
|
||||
{{ textbox(
|
||||
form.search,
|
||||
width='1-1',
|
||||
label='Find users by email, or by partial email'
|
||||
) }}
|
||||
</div>
|
||||
<div class="column-one-quarter align-button-with-textbox">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
<button type="submit" class="button">Search</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form id="search-form" method="post">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
</form>
|
||||
|
||||
{% if users_found %}
|
||||
<nav class="browse-list">
|
||||
<ul>
|
||||
{% for user in users_found %}
|
||||
<li class="browse-list-item">
|
||||
<a href="{{url_for('.user_information', user_id=user.id)}}" class="browse-list-link">{{ user.email_address }}</a>
|
||||
<p class="browse-list-hint">{{ user.name }}</p>
|
||||
</li>
|
||||
<hr>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% elif users_found == [] %}
|
||||
<p class="browse-list-hint">No users found.</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
43
app/templates/views/find-users/user-information.html
Normal file
43
app/templates/views/find-users/user-information.html
Normal file
@@ -0,0 +1,43 @@
|
||||
{% extends "views/platform-admin/_base_template.html" %}
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
|
||||
{% block per_page_title %}
|
||||
User information for {{ user.name }}
|
||||
{% endblock %}
|
||||
|
||||
{% block platform_admin_content %}
|
||||
<div class="grid-row bottom-gutter">
|
||||
<div class="column-whole">
|
||||
<h1 class="heading-large">
|
||||
{{ user.name }}
|
||||
</h1>
|
||||
<p>{{ user.email_address }}</p>
|
||||
<p>{{ user.mobile_number }}</p>
|
||||
<h2 class="heading-medium">Services</h2>
|
||||
<nav class="browse-list">
|
||||
<ul>
|
||||
{% for service in user.services %}
|
||||
<li class="browse-list-item">
|
||||
<p class="browse-list-sub-item">{{ service.name }}</p>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
<h2 class="heading-medium">Last login</h2>
|
||||
{% if not user.logged_in_at %}
|
||||
<p>This person has never logged in</p>
|
||||
{% else %}
|
||||
<p>Last logged in
|
||||
<time class="timeago" datetime="{{ user.logged_in_at }}">
|
||||
{{ user.logged_in_at|format_delta }}
|
||||
</time>
|
||||
</p>
|
||||
{% endif %}
|
||||
{% if user.failed_login_count > 0 %}
|
||||
<p style="color:#b10e1e;">
|
||||
{{ user.failed_login_count }} failed login attempts
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -20,6 +20,7 @@
|
||||
('Email branding', url_for('main.email_branding')),
|
||||
('Letter jobs', url_for('main.letter_jobs')),
|
||||
('Inbound SMS numbers', url_for('main.inbound_sms_admin')),
|
||||
('Find users by email', url_for('main.find_users_by_email')),
|
||||
('Email Complaints', url_for('main.platform_admin_list_complaints'))
|
||||
] %}
|
||||
<li>
|
||||
|
||||
Reference in New Issue
Block a user