aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2021-03-30 13:06:40 +0300
committerGravatar ks129 <[email protected]>2021-03-30 13:06:40 +0300
commitbcbb94d15b540f00c59cbb35fbfa45433b6c82de (patch)
treed83731c6f9e0a835e984f313e980a5265fd0b770
parentRefactor getting subcategories and resources to 2 helper methods (diff)
Order resources and subcategories in template
-rw-r--r--pydis_site/templates/resources/resources_list.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/pydis_site/templates/resources/resources_list.html b/pydis_site/templates/resources/resources_list.html
index 77d25ace..96b128be 100644
--- a/pydis_site/templates/resources/resources_list.html
+++ b/pydis_site/templates/resources/resources_list.html
@@ -27,11 +27,11 @@
<h1>{{ category_info.name }}</h1>
<p>{{ category_info.description|safe }}</p>
<div>
- {% for resource in resources %}
+ {% for resource in resources|dictsort:"position" %}
{% include "resources/resource_box.html" %}
{% endfor %}
- {% for subcategory in subcategories %}
+ {% for subcategory in subcategories|dictsort:"category_info.position" %}
<h2 id="{{ subcategory.category_info.raw_name }}">
<a href="{% url "resources:resources" type=category_info.raw_name %}#{{ subcategory.category_info.raw_name }}">
{{ subcategory.category_info.name }}
@@ -39,7 +39,7 @@
</h2>
<p>{{ subcategory.category_info.description|safe }}</p>
- {% for resource in subcategory.resources %}
+ {% for resource in subcategory.resources|dictsort:"position" %}
{% with category_info=subcategory.category_info %}
{% include "resources/resource_box.html" %}
{% endwith %}