Hide away links to admin interface

This commit is contained in:
Klaas van Schelven
2024-09-13 09:12:28 +02:00
parent a118066129
commit 3d66a60b41
3 changed files with 16 additions and 4 deletions

View File

@@ -122,6 +122,10 @@ BUGSINK = {
"BASE_URL": "http://bugsink:8000", # no trailing slash
"SITE_TITLE": "Bugsink", # you can customize this as e.g. "My Bugsink" or "Bugsink for My Company"
# undocumented feature: this enables links to the admin interface in the header/footer. I'm not sure where the admin
# will fit in the final version, so that's why it's not documented.
"USE_ADMIN": True,
}

View File

@@ -120,13 +120,21 @@
<div class="flex p-4 bg-slate-200 border-b-2"><!-- bottom nav bar -->
{% if is_event_page %}<div>Event {{ event.digest_order }} of {{ issue.digested_event_count}} which occured at <span class="font-bold">{{ event.ingested_at|date:"j M G:i T" }}</span></div>{% endif %}
<div class="ml-auto pr-4 font-bold text-slate-500">
<a href="/admin/issues/issue/{{ issue.id }}/change/">Issue Admin</a>
{% if is_event_page %}
| <a href="/admin/events/event/{{ event.id }}/change/">Event Admin</a>
| <a href="/events/event/{{ event.id }}/download/">Download</a>
<a href="/events/event/{{ event.id }}/download/">Download</a>
| <a href="/events/event/{{ event.id }}/raw/" >JSON</a>
| <a href="/events/event/{{ event.id }}/plain/" >Plain</a>
{% endif %}
{% if app_settings.USE_ADMIN and user.is_staff %}
{% if is_event_page %}
| <a href="/admin/events/event/{{ event.id }}/change/">Event Admin</a>
{% endif %}
| <a href="/admin/issues/issue/{{ issue.id }}/change/">Issue Admin</a>
{% endif %}
</div>
</div>{# bottom nav bar #}
</div>{# the whole of the big tabbed view #}

View File

@@ -27,7 +27,7 @@
{% endif %}
<div class="ml-auto flex">
{% if user.is_staff %}
{% if app_settings.USE_ADMIN and user.is_staff %}
<a href="/admin/"><div class="px-4 py-2 my-2 hover:bg-slate-300 rounded-xl">Admin</div></a>
{% endif %}