aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2022-01-23 13:32:48 +0100
committerGravatar Leon Sandøy <[email protected]>2022-01-23 13:32:48 +0100
commitdd733ea23ecc859fa69d47aeb46625ab5a3385b5 (patch)
treead1f4ca83db76ab2a14ea355fe0912520fa4d01d
parentKaizen: Refactor some code to be more beautiful. (diff)
Always add a link icon for the primary URL.
-rw-r--r--pydis_site/templates/resources/resource_box.html14
1 files changed, 12 insertions, 2 deletions
diff --git a/pydis_site/templates/resources/resource_box.html b/pydis_site/templates/resources/resource_box.html
index 671b5736..7de9ca18 100644
--- a/pydis_site/templates/resources/resource_box.html
+++ b/pydis_site/templates/resources/resource_box.html
@@ -1,7 +1,7 @@
{% load as_icon %}
{% load get_category_icon %}
-<div class="box" style="max-width: 800px;">
+<div class="box">
{% if 'title_url' in resource %}
<a href="{{ resource.title_url }}">
{% include "resources/resource_box_header.html" %}
@@ -13,7 +13,15 @@
<p class="is-italic">{{ resource.description|safe }}</p>
<div class="is-flex is-align-items-center">
- {# Icons #}
+ {# Add primary link #}
+ {% if 'title_url' in resource %}
+ <span class="icon is-size-4 is-medium" style="margin: 5px;">
+ <a href="{{ resource.title_url }}">
+ <i class="fas fa-link is-size-3 resource-icon is-primary"></i>
+ </a>
+ </span>
+ {% endif %}
+ {# Add all additional icon #}
{% for icon in resource.urls %}
<span class="icon is-size-4 is-medium" style="margin: 5px;">
<a href="{{ icon.url }}">
@@ -21,6 +29,8 @@
</a>
</span>
{% endfor %}
+
+ {# Tags #}
<div class="is-flex ml-auto is-flex-wrap-wrap is-justify-content-end">
{% for tag in resource.tags.topics %}
<span class="tag is-primary is-light ml-2 mt-2"><i class="{{ tag|title|get_category_icon }} mr-1"></i>{{ tag|title }}</span>