Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mattia Rizzolo
nm.debian.org
Commits
4c1bec3e
Commit
4c1bec3e
authored
Apr 25, 2020
by
Enrico Zini
Browse files
Namespace urls. refs:
#12
parent
df1239d4
Changes
2
Show whitespace changes
Inline
Side-by-side
impersonate/urls.py
View file @
4c1bec3e
...
...
@@ -2,6 +2,7 @@ from __future__ import annotations
from
django.urls
import
path
from
.
import
views
app_name
=
"impersonate"
urlpatterns
=
[
# Impersonate a user
path
(
'impersonate/'
,
views
.
Impersonate
.
as_view
(),
name
=
"impersonate"
),
...
...
nmlayout/templates/nm2-base.html
View file @
4c1bec3e
...
...
@@ -38,7 +38,7 @@ window.nm2.url_api_people = "{% url 'api_people' %}";
<a
class=
"dropdown-item"
href=
"{{link.url}}"
>
{% if link.icon %}
<span
class=
"fa fa-{{link.icon}}"
></span>
{% endif %}{{link.label}}
</a>
{% endfor %}
{% if visitor != person %}
<form
class=
"form-inline"
method=
"POST"
action=
"{% url 'impersonate' %}"
>
{% csrf_token %}
<form
class=
"form-inline"
method=
"POST"
action=
"{% url 'impersonate
:impersonate
' %}"
>
{% csrf_token %}
<input
type=
"hidden"
name=
"pk"
value=
"{{person.pk}}"
>
<input
type=
"hidden"
name=
"next"
value=
"{{request.build_absolute_uri}}"
>
<button
class=
"dropdown-item btn btn-link"
type=
"submit"
><span
class=
"fa fa-random"
></span>
{% trans "Impersonate" %}
</button>
...
...
@@ -79,7 +79,7 @@ window.nm2.url_api_people = "{% url 'api_people' %}";
<div
class=
"dropdown-menu dropdown-menu-right"
role=
"menu"
aria-labelledby=
"navbarDropdown"
>
{% block visitor_menu %}
{% if impersonator %}
<form
class=
"form-inline"
method=
"POST"
action=
"{% url 'impersonate' %}"
>
{% csrf_token %}
<form
class=
"form-inline"
method=
"POST"
action=
"{% url 'impersonate
:impersonate
' %}"
>
{% csrf_token %}
<input
type=
"hidden"
name=
"next"
value=
"{{request.build_absolute_uri}}"
>
<button
class=
"dropdown-item btn btn-link"
type=
"submit"
><span
class=
"fa fa-random"
></span>
(really {{impersonator.lookup_key}})
</button>
</form>
...
...
@@ -122,7 +122,7 @@ window.nm2.url_api_people = "{% url 'api_people' %}";
{% if impersonator %}
<div
id=
"impersonation"
class=
"container-fluid bg-warning"
>
<span
class=
"badge badge-pill badge-light"
><span
class=
"fa fa-random"
></span>
{{impersonator.a_link}} as {{visitor.a_link}}
</span>
<form
class=
"form-inline"
method=
"POST"
action=
"{% url 'impersonate' %}"
>
{% csrf_token %}
<form
class=
"form-inline"
method=
"POST"
action=
"{% url 'impersonate
:impersonate
' %}"
>
{% csrf_token %}
<input
type=
"hidden"
name=
"next"
value=
"{{request.build_absolute_uri}}"
>
<button
class=
"badge badge-pill badge-primary"
type=
"submit"
>
{% trans "Cancel" %}
</button>
</form>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment