summaryrefslogtreecommitdiffstats
path: root/templates/admin
diff options
context:
space:
mode:
authorMichael Manfre2022-11-28 23:41:36 -0500
committerGitHub2022-11-28 21:41:36 -0700
commitfb8f2d10984bcfa2585dc272b4c85d285b722792 (patch)
treefa9616f745c7e9e4b5cc5d1ca82d61512ee64f01 /templates/admin
parent7f838433edde6a03d1b7f71da269f9756a3f91e9 (diff)
downloadtakahe-fb8f2d10984bcfa2585dc272b4c85d285b722792.tar.gz
takahe-fb8f2d10984bcfa2585dc272b4c85d285b722792.tar.bz2
takahe-fb8f2d10984bcfa2585dc272b4c85d285b722792.zip
Hashtags
Diffstat (limited to 'templates/admin')
-rw-r--r--templates/admin/hashtag_create.html26
-rw-r--r--templates/admin/hashtag_delete.html17
-rw-r--r--templates/admin/hashtag_edit.html46
-rw-r--r--templates/admin/hashtags.html40
4 files changed, 129 insertions, 0 deletions
diff --git a/templates/admin/hashtag_create.html b/templates/admin/hashtag_create.html
new file mode 100644
index 0000000..2d31cf7
--- /dev/null
+++ b/templates/admin/hashtag_create.html
@@ -0,0 +1,26 @@
+{% extends "settings/base.html" %}
+
+{% block title %}Add hashtag - Admin{% endblock %}
+
+{% block content %}
+ <form action="." method="POST">
+ <h1>Add A hashtag</h1>
+ <p>
+ Use this form to add a hashtag.
+ </p>
+ {% 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>
+ <div class="buttons">
+ <a href="{% url "admin_hashtags" %}" class="button secondary left">Back</a>
+ <button>Create</button>
+ </div>
+ </form>
+{% endblock %}
diff --git a/templates/admin/hashtag_delete.html b/templates/admin/hashtag_delete.html
new file mode 100644
index 0000000..9aca4e7
--- /dev/null
+++ b/templates/admin/hashtag_delete.html
@@ -0,0 +1,17 @@
+{% extends "settings/base.html" %}
+
+{% block title %}Delete <i class="fa-solid fa-hashtag"></i>{{ hashtag.hashtag }} - Admin{% endblock %}
+
+{% block content %}
+ <form action="." method="POST">
+ {% csrf_token %}
+
+ <h1>Deleting <i class="fa-solid fa-hashtag"></i>{{ hashtag.hashtag }}</h1>
+
+ <p>Please confirm deletion of this hashtag.</p>
+ <div class="buttons">
+ <a class="button" href="{{ hashtag.urls.edit }}">Cancel</a>
+ <button class="delete">Confirm Deletion</button>
+ </div>
+
+{% endblock %}
diff --git a/templates/admin/hashtag_edit.html b/templates/admin/hashtag_edit.html
new file mode 100644
index 0000000..b023dfa
--- /dev/null
+++ b/templates/admin/hashtag_edit.html
@@ -0,0 +1,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 %}
diff --git a/templates/admin/hashtags.html b/templates/admin/hashtags.html
new file mode 100644
index 0000000..4273ac2
--- /dev/null
+++ b/templates/admin/hashtags.html
@@ -0,0 +1,40 @@
+{% extends "settings/base.html" %}
+
+{% block subtitle %}Hashtags{% endblock %}
+
+{% block content %}
+ <section class="icon-menu">
+ {% for hashtag in hashtags %}
+ <a class="option" href="{{ hashtag.urls.edit }}">
+ <i class="fa-solid fa-hashtag"></i>
+ <span class="handle">
+ {{ hashtag.display_name }}
+ <small>
+ {% if hashtag.public %}Public{% elif hashtag.public is None %}Unreviewed{% else %}Private{% endif %}
+ </small>
+ </span>
+ {% if hashtag.stats %}
+ <span class="handle">
+ <small>Total:</small>
+ {{ hashtag.stats.total }}
+ </span>
+ {% endif %}
+ {% if hashtag.aliases %}
+
+ <span class="handle">
+ <small>Aliases:</small>
+ {% for alias in hashtag.aliases %}
+ {{ alias }}{% if not forloop.last %}, {% endif %}
+ {% endfor %}
+ </span>
+ {% endif %}
+
+ </a>
+ {% empty %}
+ <p class="option empty">You have no hashtags set up.</p>
+ {% endfor %}
+ <a href="{% url "admin_hashtags_create" %}" class="option new">
+ <i class="fa-solid fa-plus"></i> Add a hashtag
+ </a>
+ </section>
+{% endblock %}