feat(templates): Add a visual indication that some pages give more power
This commit is contained in:
parent
f6fcd90622
commit
6921373d6c
2 changed files with 16 additions and 1 deletions
|
@ -14,3 +14,7 @@ class StaffRequiredMixin(UserPassesTestMixin):
|
|||
assert isinstance(self.request.user, User)
|
||||
|
||||
return self.request.user.is_admin
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
# NOTE: We are only allowed to do this if a class is supplied to the right when constructing the view
|
||||
return super().get_context_data(admin_view=True, **kwargs) # pyright: ignore
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{% load i18n %}
|
||||
|
||||
<section class="hero is-dark is-primary">
|
||||
<section class="hero {% if admin_view %}is-danger{% else %}is-primary{% endif %}">
|
||||
<div class="hero-body px-0">
|
||||
<div class="columns mx-6">
|
||||
<div class="column is-three-quarters">
|
||||
|
@ -66,4 +66,15 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if admin_view %}
|
||||
<div class="hero is-dark">
|
||||
<div class="hero-body py-2 has-text-centered">
|
||||
<span class="icon">
|
||||
<i class="ti ti-lock-open-2"></i>
|
||||
</span>
|
||||
<span>{% trans "Interface d'administration" %}</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</section>
|
||||
|
|
Loading…
Reference in a new issue