Implement impersonation
This commit is contained in:
parent
472e272305
commit
d499b781d4
7 changed files with 135 additions and 37 deletions
45
gnuviechadmin/templates/impersonate/search_users.html
Normal file
45
gnuviechadmin/templates/impersonate/search_users.html
Normal file
|
@ -0,0 +1,45 @@
|
|||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{{ block.super }} - {% trans "Django Impersonate - Search Users" %}{% endblock title %}
|
||||
{% 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 }}
|
||||
<div class="form-group">
|
||||
<label for="user-query">{% trans "Enter Search Query:" %}</label>
|
||||
<input type="text" name="q" id="user-query" class="form-control"
|
||||
value="{% if query %}{{ query }}{% endif %}">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">{% trans "Search" %}</button>
|
||||
</form>
|
||||
|
||||
<p>
|
||||
<a href="{% url 'impersonate-list' %}">{% trans "List all users" %}</a>
|
||||
</p>
|
||||
|
||||
<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>
|
||||
|
||||
<p>
|
||||
{% if query and page.has_previous %}
|
||||
<a href="{% url 'impersonate-search' %}?page={{ page.previous_page_number }}&q={{ query|urlencode }}">Previous
|
||||
Page</a>
|
||||
{% 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 %}
|
Loading…
Add table
Add a link
Reference in a new issue