diff options
author | Michael Manfre | 2022-11-28 23:41:36 -0500 |
---|---|---|
committer | GitHub | 2022-11-28 21:41:36 -0700 |
commit | fb8f2d10984bcfa2585dc272b4c85d285b722792 (patch) | |
tree | fa9616f745c7e9e4b5cc5d1ca82d61512ee64f01 /templates | |
parent | 7f838433edde6a03d1b7f71da269f9756a3f91e9 (diff) | |
download | takahe-fb8f2d10984bcfa2585dc272b4c85d285b722792.tar.gz takahe-fb8f2d10984bcfa2585dc272b4c85d285b722792.tar.bz2 takahe-fb8f2d10984bcfa2585dc272b4c85d285b722792.zip |
Hashtags
Diffstat (limited to 'templates')
-rw-r--r-- | templates/activities/_hashtag.html | 11 | ||||
-rw-r--r-- | templates/activities/_menu.html | 13 | ||||
-rw-r--r-- | templates/activities/explore_tag.html | 16 | ||||
-rw-r--r-- | templates/activities/search.html | 8 | ||||
-rw-r--r-- | templates/activities/tag.html | 16 | ||||
-rw-r--r-- | templates/admin/hashtag_create.html | 26 | ||||
-rw-r--r-- | templates/admin/hashtag_delete.html | 17 | ||||
-rw-r--r-- | templates/admin/hashtag_edit.html | 46 | ||||
-rw-r--r-- | templates/admin/hashtags.html | 40 | ||||
-rw-r--r-- | templates/settings/_menu.html | 3 |
10 files changed, 195 insertions, 1 deletions
diff --git a/templates/activities/_hashtag.html b/templates/activities/_hashtag.html new file mode 100644 index 0000000..19233e5 --- /dev/null +++ b/templates/activities/_hashtag.html @@ -0,0 +1,11 @@ +<a class="option" href="{{ hashtag.urls.timeline }}"> + <i class="fa-solid fa-hashtag"></i> + <span class="handle"> + {{ hashtag.display_name }} + </span> + {% if not hide_stats %} + <span> + Post count: {{ hashtag.stats.total }} + </span> + {% endif %} +</a> diff --git a/templates/activities/_menu.html b/templates/activities/_menu.html index 1ebe940..58295a9 100644 --- a/templates/activities/_menu.html +++ b/templates/activities/_menu.html @@ -6,6 +6,9 @@ <a href="{% url "notifications" %}" {% if current_page == "notifications" %}class="selected"{% endif %} title="Notifications"> <i class="fa-solid fa-at"></i> Notifications </a> + <a href="{% url "explore" %}" {% if current_page == "explore" %}class="selected"{% endif %} title="Explore"> + <i class="fa-solid fa-hashtag"></i> Explore + </a> <a href="{% url "local" %}" {% if current_page == "local" %}class="selected"{% endif %} title="Local"> <i class="fa-solid fa-city"></i> Local </a> @@ -19,13 +22,21 @@ <a href="{% url "search" %}" {% if top_section == "search" %}class="selected"{% endif %} title="Search"> <i class="fa-solid fa-search"></i> Search </a> + {% if current_page == "tag" %} + <a href="{% url "tag" hashtag.hashtag %}" class="selected" title="Tag {{ hashtag.display_name }}"> + <i class="fa-solid fa-hashtag"></i> {{ hashtag.display_name }} + </a> + {% endif %} <a href="{% url "settings" %}" {% if top_section == "settings" %}class="selected"{% endif %} title="Settings"> <i class="fa-solid fa-gear"></i> Settings </a> - {% else %} + {% else %} <a href="{% url "local" %}" {% if current_page == "local" %}class="selected"{% endif %} title="Local Posts"> <i class="fa-solid fa-city"></i> Local Posts </a> + <a href="{% url "explore" %}" {% if current_page == "explore" %}class="selected"{% endif %} title="Explore"> + <i class="fa-solid fa-hashtag"></i> Explore + </a> <h3></h3> {% if config.signup_allowed %} <a href="{% url "signup" %}" {% if current_page == "signup" %}class="selected"{% endif %} title="Create Account"> diff --git a/templates/activities/explore_tag.html b/templates/activities/explore_tag.html new file mode 100644 index 0000000..b2fd79d --- /dev/null +++ b/templates/activities/explore_tag.html @@ -0,0 +1,16 @@ +{% extends "base.html" %} + +{% block title %}#{{ hashtag.display_name }} Timeline{% endblock %} + +{% block content %} +<div class="timeline-name">Explore Trending Tags</div> + +<section class="icon-menu"> + {% for hashtag in page_obj %} + {% include "activities/_hashtag.html" %} + {% empty %} + No tags are trending yet. + {% endfor %} + +</section> +{% endblock %} diff --git a/templates/activities/search.html b/templates/activities/search.html index 3cff2a2..5137740 100644 --- a/templates/activities/search.html +++ b/templates/activities/search.html @@ -18,4 +18,12 @@ {% include "activities/_identity.html" %} {% endfor %} {% endif %} + {% if results.hashtags %} + <h2>Hashtags</h2> + <section class="icon-menu"> + {% for hashtag in results.hashtags %} + {% include "activities/_hashtag.html" with hide_stats=True %} + {% endfor %} + </section> + {% endif %} {% endblock %} diff --git a/templates/activities/tag.html b/templates/activities/tag.html new file mode 100644 index 0000000..a319b6a --- /dev/null +++ b/templates/activities/tag.html @@ -0,0 +1,16 @@ +{% extends "base.html" %} + +{% block title %}#{{ hashtag.display_name }} Timeline{% endblock %} + +{% block content %} + <div class="timeline-name"><i class="fa-solid fa-hashtag"></i>{{ hashtag.display_name }}</div> + {% for post in page_obj %} + {% include "activities/_post.html" %} + {% empty %} + No posts yet. + {% endfor %} + + {% if page_obj.has_next %} + <div class="load-more"><a class="button" href=".?page={{ page_obj.next_page_number }}">Next Page</a></div> + {% endif %} +{% endblock %} 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 %} diff --git a/templates/settings/_menu.html b/templates/settings/_menu.html index 531febb..8aede68 100644 --- a/templates/settings/_menu.html +++ b/templates/settings/_menu.html @@ -36,6 +36,9 @@ <a href="{% url "admin_invites" %}" {% if section == "invites" %}class="selected"{% endif %} title="Invites"> <i class="fa-solid fa-envelope"></i> Invites </a> + <a href="{% url "admin_hashtags" %}" {% if section == "hashtags" %}class="selected"{% endif %} title="Hashtags"> + <i class="fa-solid fa-hashtag"></i> Hashtags + </a> <a href="/djadmin" title=""> <i class="fa-solid fa-gear"></i> Django Admin </a> |