]> git.lizzy.rs Git - cheatdb.git/commitdiff
Move tag list to top of package list page
authorrubenwardy <rw@rubenwardy.com>
Sun, 12 Jul 2020 19:19:00 +0000 (20:19 +0100)
committerrubenwardy <rw@rubenwardy.com>
Sun, 12 Jul 2020 19:19:00 +0000 (20:19 +0100)
app/templates/packages/list.html

index 1cddcd477667cf5d443387e91fee739e2bf14a45..e272782df91ef84eb86ee8e0aa362a424edd15a9 100644 (file)
                </p>
        {% endif %}
 
-       <div class="row">
-               <div class="col-md-9">
-                       {% from "macros/packagegridtile.html" import render_pkggrid %}
-                       {{ render_pkggrid(packages) }}
-
-
-                       {% from "macros/pagination.html" import render_pagination %}
-                       {{ render_pagination(pagination, url_set_query) }}
-
+       <aside class="mb-5">
+               <p class="text-muted">Filter by tags</p>
+
+               {% for pair in tags %}
+                       {% set count = pair[0] %}
+                       {% set tag = pair[1] %}
+
+                       {% if tag in selected_tags %}
+                               <a class="badge badge-primary"
+                                               href="{{ url_set_query(page=1, _remove={ 'tag': tag.name }) }}">
+
+                                       {{ tag.title }}
+                                       ({{ count }})
+                               </a>
+                       {% else %}
+                               <a class="badge badge-secondary"
+                                               href="{{ url_set_query(page=1, _add={ 'tag': tag.name }) }}">
+
+                                       {{ tag.title }}
+                                       ({{ count }})
+                               </a>
+                       {% endif %}
+               {% endfor %}
+       </aside>
 
-                       {% if topics %}
-                               <h2 style="margin-top:2em;">More content from the forums</h2>
+       {% from "macros/packagegridtile.html" import render_pkggrid %}
+       {{ render_pkggrid(packages) }}
 
-                               {% from "macros/topics.html" import render_topics %}
-                               {{ render_topics(topics, current_user) }}
-                       {% endif %}
-               </div>
 
-               <aside class="col-md-3">
-                       <p class="text-muted">Filter by tags</p>
+       {% from "macros/pagination.html" import render_pagination %}
+       {{ render_pagination(pagination, url_set_query) }}
 
-                       {% for pair in tags %}
-                               {% set count = pair[0] %}
-                               {% set tag = pair[1] %}
 
-                               {% if tag in selected_tags %}
-                                       <a class="badge badge-primary"
-                                                       href="{{ url_set_query(page=1, _remove={ 'tag': tag.name }) }}">
+       {% if topics %}
+               <h2 style="margin-top:2em;">More content from the forums</h2>
 
-                                               {{ tag.title }}
-                                               ({{ count }})
-                                       </a>
-                               {% else %}
-                                       <a class="badge badge-secondary"
-                                                       href="{{ url_set_query(page=1, _add={ 'tag': tag.name }) }}">
+               {% from "macros/topics.html" import render_topics %}
+               {{ render_topics(topics, current_user) }}
+       {% endif %}
 
-                                               {{ tag.title }}
-                                               ({{ count }})
-                                       </a>
-                               {% endif %}
-                       {% endfor %}
-               </aside>
-       </div>
 
 {% endblock %}