aboutsummaryrefslogtreecommitdiffstats
path: root/pyblackbird_cc/templates/resources/admin_bar.html
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-08-02 16:17:53 +0100
committerMatthew Lemon <y@yulqen.org>2024-08-02 16:17:53 +0100
commita75aca148ba7db29e14e30f2e0707b1efac1ff94 (patch)
treefad1d439446507f59377115267b6143de643885e /pyblackbird_cc/templates/resources/admin_bar.html
parent27576670437e9edd139bae93efc5bd9577f83e35 (diff)
Refactored list template into includes to fix div hell.
Diffstat (limited to 'pyblackbird_cc/templates/resources/admin_bar.html')
-rw-r--r--pyblackbird_cc/templates/resources/admin_bar.html28
1 files changed, 28 insertions, 0 deletions
diff --git a/pyblackbird_cc/templates/resources/admin_bar.html b/pyblackbird_cc/templates/resources/admin_bar.html
new file mode 100644
index 0000000..5bddde6
--- /dev/null
+++ b/pyblackbird_cc/templates/resources/admin_bar.html
@@ -0,0 +1,28 @@
+ {# admin block #}
+ {% if request.user.is_authenticated and request.user.is_staff %}
+ <div class="row bg-white p-4 rounded border border-success border-opacity-25">
+ <h5 class="text-decoration-underline">Admin bar</h5>
+ <p>
+ Only you will see this bar - normal users will not see it. It allows us to
+ include buttons for adding new resources, etc.
+ </p>
+ <div class="col">
+ <div class="d-flex flex-row flex-wrap justify-content-between">
+ <div>
+ <a class="btn btn-primary my-md-2"
+ href="{% url 'resources:create_resource' %} ">Add a new resource</a>
+ </div>
+ <div class="bg-danger p-2 my-2 text-dark bg-white border border-1 border-danger">
+ Logged in as
+ <strong>{{ request.user.email }}</strong>
+ </div>
+ <div class="my-md-2">
+ <form action="{% url 'account_logout' %}" method="post">
+ {% csrf_token %}
+ <button type="submit" class="btn btn-primary">Log out</button>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+ {% endif %}