diff options
| author | 2022-11-05 10:49:03 +0100 | |
|---|---|---|
| committer | 2022-11-05 10:49:03 +0100 | |
| commit | ec2a0de778ebd33ef0ee4c73bd1bd4b961ceea4c (patch) | |
| tree | 3300784e4d4d9eefcc76b62d54dcf27ac7518ea5 /pydis_site/templates/content | |
| parent | Merge pull request #790 from python-discord/mbaruh-bump-psql (diff) | |
| parent | Merge branch 'main' into bot-tags (diff) | |
Merge pull request #763 from python-discord/bot-tags
List Bot Tags On Site
Diffstat (limited to 'pydis_site/templates/content')
| -rw-r--r-- | pydis_site/templates/content/base.html | 6 | ||||
| -rw-r--r-- | pydis_site/templates/content/listing.html | 27 | ||||
| -rw-r--r-- | pydis_site/templates/content/page.html | 8 | ||||
| -rw-r--r-- | pydis_site/templates/content/tag.html | 40 | 
4 files changed, 70 insertions, 11 deletions
| diff --git a/pydis_site/templates/content/base.html b/pydis_site/templates/content/base.html index 4a19a275..2fd721a3 100644 --- a/pydis_site/templates/content/base.html +++ b/pydis_site/templates/content/base.html @@ -8,6 +8,10 @@      <meta property="og:description" content="{{ page_description }}" />      <link rel="stylesheet" href="{% static "css/content/page.css" %}">      <link rel="stylesheet" href="{% static "css/collapsibles.css" %}"> +    <link rel="stylesheet" +      href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.1/styles/atom-one-dark.min.css"> +    <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.1/highlight.min.js"></script> +    <script>hljs.highlightAll();</script>      <script src="{% static "js/collapsibles.js" %}"></script>  {% endblock %} @@ -35,7 +39,7 @@      <section class="section">          <div class="container">              <div class="content"> -                <h1 class="title">{{ page_title }}</h1> +                <h1 class="title">{% block title_element %}{{ page_title }}{% endblock %}</h1>                  {% block page_content %}{% endblock %}              </div>          </div> diff --git a/pydis_site/templates/content/listing.html b/pydis_site/templates/content/listing.html index ef0ef919..934b95f6 100644 --- a/pydis_site/templates/content/listing.html +++ b/pydis_site/templates/content/listing.html @@ -1,6 +1,22 @@ +{# Base navigation screen for resources #}  {% 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 %}          <div class="box" style="max-width: 800px;">              <span class="icon is-size-4 is-medium"> @@ -13,15 +29,22 @@              <p class="is-italic">{{ data.description }}</p>          </div>      {% endfor %} + +    {# Single Pages #}      {% for page, data in pages.items %}          <div class="box" style="max-width: 800px;">              <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> -            <p class="is-italic">{{ data.description }}</p> +            {% if is_tag_listing %} +                <div class="tag-container">{{ data.description | safe }}</div> +            {% else %} +                <p class="is-italic">{{ data.description }}</p> +            {% endif %}          </div>      {% endfor %} +    <script src="{% static 'js/content/listing.js' %}"></script>  {% endblock %} diff --git a/pydis_site/templates/content/page.html b/pydis_site/templates/content/page.html index 759286f6..679ecec6 100644 --- a/pydis_site/templates/content/page.html +++ b/pydis_site/templates/content/page.html @@ -1,13 +1,5 @@  {% extends 'content/base.html' %} -{% block head %} -    {{ block.super }} -    <link rel="stylesheet" -      href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.1/styles/atom-one-dark.min.css"> -    <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.1/highlight.min.js"></script> -    <script>hljs.initHighlightingOnLoad();</script> -{% endblock %} -  {% block page_content %}      {% if relevant_links or toc %}          <div class="columns is-variable is-8"> diff --git a/pydis_site/templates/content/tag.html b/pydis_site/templates/content/tag.html new file mode 100644 index 00000000..fa9e44f5 --- /dev/null +++ b/pydis_site/templates/content/tag.html @@ -0,0 +1,40 @@ +{% extends "content/page.html" %} +{% load static %} + +{% 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 %} + +{% block title_element %} +    <div class="level mb-2"> +        <div class="level-left">{{ block.super }}</div> +        <div class="level-right"> +            <a class="level-item fab fa-github" href="{{ tag.url }}"></a> +        </div> +    </div> + +    <div class="dropdown is-size-6 is-hoverable"> +        <div class="dropdown-trigger "> +            <a aria-haspopup="menu" href="{{ tag.last_commit.url }}"> +                <span class="update-time"> +                    Last Updated: {{ tag.last_commit.date | date:"F j, Y g:i A e" }} +                </span> +            </a> +        </div> +        <div class="dropdown-menu"> +            <div class="dropdown-content"> +                <div class="dropdown-item">Last edited by:</div> +                {% for user in tag.last_commit.format_authors %} +                    <div class="dropdown-item">{{ user }}</div> +                {% endfor %} +                <div class="dropdown-divider"></div> +                {% for line in tag.last_commit.lines %} +                    <div class="dropdown-item">{{ line }}</div> +                {% endfor %} +            </div> +        </div> +    </div> +{% endblock %} | 
