gva/gnuviechadmin/templates/impersonate/search_users.html

42 lines
1.8 KiB
HTML
Raw Normal View History

2023-04-15 11:48:53 +02:00
{% extends "base.html" %}
{% load i18n %}
{% block title %}{{ block.super }} - {% translate "Django Impersonate - Search Users" %}{% endblock title %}
2023-04-15 11:48:53 +02:00
{% block page_title %}Search Users {% if query %}- Page {{ page_number }}{% endif %}{% endblock page_title %}
{% block content %}
<form action="{% url 'impersonate-search' %}" method="GET">
{{ redirect_field }}
2023-04-22 12:56:05 +02:00
<div class="mb-3">
<label for="user-query" class="form-label">{% translate "Enter Search Query:" %}</label>
2023-04-15 11:48:53 +02:00
<input type="text" name="q" id="user-query" class="form-control"
2023-04-22 12:56:05 +02:00
placeholder="{% translate "user name part" %}" value="{% if query %}{{ query }}{% endif %}">
2023-04-15 11:48:53 +02:00
</div>
<button type="submit" class="btn btn-primary">{% translate "Search" %}</button>
2023-04-22 12:56:05 +02:00
<a class="btn btn-secondary" href="{% url 'impersonate-list' %}">{% translate "List all users" %}</a>
2023-04-15 11:48:53 +02:00
</form>
<p>
{% if query and page.object_list %}
<ul class="list-group">
{% for user in page.object_list %}
<li class="list-group-item"><a
href="{% url 'impersonate-start' user.pk %}{{ redirect }}">{{ user }}</a> - Impersonate
</li>
{% endfor %}
</ul>
{% endif %}
</p>
2023-04-22 12:56:05 +02:00
<p class="mt-3">
2023-04-15 11:48:53 +02:00
{% if query and page.has_previous %}
<a href="{% url 'impersonate-search' %}?page={{ page.previous_page_number }}&q={{ query|urlencode }}">Previous
Page</a> &nbsp;
{% endif %}
{% if query and page.has_next %}
<a href="{% url 'impersonate-search' %}?page={{ page.next_page_number }}&q={{ query|urlencode }}">Next
Page</a>
{% endif %}
</p>
{% endblock %}