]> git.lizzy.rs Git - cheatdb.git/blob - app/templates/packages/list.html
e272782df91ef84eb86ee8e0aa362a424edd15a9
[cheatdb.git] / app / templates / packages / list.html
1 {% extends "base.html" %}
2
3 {% block title %}
4 {{ title }}
5 {% endblock %}
6
7 {% block content %}
8         {% if authors %}
9                 <p class="alert alert-primary">
10                         Did you mean to search for packages by
11
12                         {% for author in authors %}
13                                 <a href="{{ url_for('packages.list_all', type=type, author=author[0], q=author[1]) }}">{{ author[0] }}</a>
14                                 {% if not loop.last %}
15                                 ,
16                                 {% endif %}
17                         {% endfor %}
18                         ?
19                 </p>
20         {% endif %}
21
22         <aside class="mb-5">
23                 <p class="text-muted">Filter by tags</p>
24
25                 {% for pair in tags %}
26                         {% set count = pair[0] %}
27                         {% set tag = pair[1] %}
28
29                         {% if tag in selected_tags %}
30                                 <a class="badge badge-primary"
31                                                 href="{{ url_set_query(page=1, _remove={ 'tag': tag.name }) }}">
32
33                                         {{ tag.title }}
34                                         ({{ count }})
35                                 </a>
36                         {% else %}
37                                 <a class="badge badge-secondary"
38                                                 href="{{ url_set_query(page=1, _add={ 'tag': tag.name }) }}">
39
40                                         {{ tag.title }}
41                                         ({{ count }})
42                                 </a>
43                         {% endif %}
44                 {% endfor %}
45         </aside>
46
47         {% from "macros/packagegridtile.html" import render_pkggrid %}
48         {{ render_pkggrid(packages) }}
49
50
51         {% from "macros/pagination.html" import render_pagination %}
52         {{ render_pagination(pagination, url_set_query) }}
53
54
55         {% if topics %}
56                 <h2 style="margin-top:2em;">More content from the forums</h2>
57
58                 {% from "macros/topics.html" import render_topics %}
59                 {{ render_topics(topics, current_user) }}
60         {% endif %}
61
62
63 {% endblock %}