summaryrefslogtreecommitdiffstats
path: root/templates/admin/hashtag_edit.html
blob: b023dfa1bf00de1c88b29c933076397e5950a245 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{% extends "settings/base.html" %}

{% block subtitle %}{{ hashtag.hashtag }}{% endblock %}

{% block content %}
    <form action="." method="POST">
        {% csrf_token %}
        <fieldset>
            <legend>hashtag Details</legend>
            {% include "forms/_field.html" with field=form.hashtag %}
            {% include "forms/_field.html" with field=form.name_override %}
        </fieldset>
        <fieldset>
            <legend>Access Control</legend>
            {% include "forms/_field.html" with field=form.public %}
        </fieldset>
        <fieldset>
            <legend>Stats</legend>
            <div class="field stats">
                {% for stat_month, stat_value in hashtag.usage_months.items|slice:":5" %}
                {% if forloop.first %}
                <table>
                    <tr>
                        <th>Month</th>
                        <th>Usage</th>
                    </tr>
                {% endif %}
                    <tr>
                        <th>{{ stat_month|date:"M Y" }}</th>
                        <td>{{ stat_value }}</td>
                    </tr>
                {% if forloop.last %}
                </table>
                {% endif %}
                {% empty %}
                <p class="help"></p>Hashtag is either not used or stats have not been computed yet.</p>
                {% endfor %}
            </div>
        </fieldset>
        <div class="buttons">
            <a href="{{ hashtag.urls.root }}" class="button secondary left">Back</a>
            <a href="{{ hashtag.urls.delete }}" class="button delete">Delete</a>
            <button>Save</button>
        </div>
    </form>
{% endblock %}