find_users_by_email view calls API and feeds results to template

Template then displays the results.

Page displays a message if no results found
This commit is contained in:
Pea Tyczynska
2018-07-06 16:16:21 +01:00
parent ea6a5b6e7d
commit d1a05e2ec5
4 changed files with 60 additions and 6 deletions

View File

@@ -24,7 +24,7 @@
{{ textbox(
form.search,
width='1-1',
label='Find users by e-mail'
label='Find users by e-mail, or by partial e-mail'
) }}
</div>
<div class="column-one-quarter align-button-with-textbox">
@@ -37,4 +37,19 @@
<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="#" class="browse-list-link">{{ user.email_address }}</a>
<p class="browse-list-sub-item">{{ user.name }}</p>
</li>
<hr>
{% endfor %}
</ul>
</nav>
{% elif users_found == [] %}
<p>No users found.</p>
{% endif %}
{% endblock %}