aboutsummaryrefslogtreecommitdiffstats
path: root/alphabetlearning/templates/resources/admin_bar.html
blob: be49e6526b24dce3bb45041c2c560199f8bd8dcc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  {#  admin block #}
  {% if request.user.is_authenticated and request.user.is_staff %}
    <div>
      <h5>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>
        <a href="{% url 'resources:create_resource' %}">Add a new resource</a>
        <div>
          Logged in as
          <strong>{{ request.user.email }}</strong>
        </div>
        <form action="{% url 'account_logout' %}" method="post" class="my-2">
          {% csrf_token %}
          <button type="submit">Log out</button>
        </form>
      </div>
    </div>
  {% endif %}