diff options
author | 2022-08-14 05:34:27 +0200 | |
---|---|---|
committer | 2022-08-14 05:46:36 +0200 | |
commit | 45cdb27a82297ede18d7bd908213dde54fef06a9 (patch) | |
tree | b31c1aa6fa7d9676837f7dd8488b5e5a8eed6b4f /pydis_site/templates | |
parent | Move Tag URL To Property And Add Group (diff) |
Add Tag Group Support
Adds support for tag groups in content. This involves some modification
to the routing, and templating.
Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'pydis_site/templates')
-rw-r--r-- | pydis_site/templates/content/listing.html | 17 | ||||
-rw-r--r-- | pydis_site/templates/content/tag.html | 5 |
2 files changed, 16 insertions, 6 deletions
diff --git a/pydis_site/templates/content/listing.html b/pydis_site/templates/content/listing.html index 098f4237..934b95f6 100644 --- a/pydis_site/templates/content/listing.html +++ b/pydis_site/templates/content/listing.html @@ -2,6 +2,19 @@ {% extends 'content/base.html' %} {% load static %} +{# Show a GitHub button on tag pages #} +{% block title_element %} +{% if is_tag_listing %} + <link rel="stylesheet" href="{% static "css/content/color.css" %}"> + <div class="level"> + <div class="level-left">{{ block.super }}</div> + <div class="level-right"> + <a class="level-item fab fa-github" href="{{ tag_url }}"></a> + </div> + </div> +{% endif %} +{% endblock %} + {% block page_content %} {# Nested Categories #} {% for category, data in categories.items %} @@ -23,10 +36,10 @@ <span class="icon is-size-4 is-medium"> <i class="{{ data.icon|default:"fab fa-python" }} is-size-3 is-black has-icon-padding" aria-hidden="true"></i> </span> - <a href="{% url "content:page_category" location=path|add:page %}"> + <a href="{% url app_name location=path|add:page %}"> <span class="is-size-4 has-text-weight-bold">{{ data.title }}</span> </a> - {% if "tags" in location %} + {% if is_tag_listing %} <div class="tag-container">{{ data.description | safe }}</div> {% else %} <p class="is-italic">{{ data.description }}</p> diff --git a/pydis_site/templates/content/tag.html b/pydis_site/templates/content/tag.html index 264f63d0..9bd65744 100644 --- a/pydis_site/templates/content/tag.html +++ b/pydis_site/templates/content/tag.html @@ -3,6 +3,7 @@ {% block head %} {{ block.super }} + <link rel="stylesheet" href="{% static 'css/content/color.css' %}"/> <link rel="stylesheet" href="{% static 'css/content/tag.css' %}"/> <title>{{ tag.name }}</title> {% endblock %} @@ -15,7 +16,3 @@ </div> </div> {% endblock %} - -{% block page_content %} - {{ block.super }} -{% endblock %} |