]> git.lizzy.rs Git - cheatdb.git/blob - app/templates/packages/list.html
49fcdd1520e66c2a3d1e762408c8152da13a2db7
[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="btn btn-sm btn-primary m-1" rel="nofollow"
31                                                 href="{{ url_set_query(page=1, _remove={ 'tag': tag.name }) }}">
32                                         {{ tag.title }}
33                                         <span class="badge badge-pill badge-light ml-1">{{ count }}</span>
34                                 </a>
35                         {% else %}
36                                 <a class="btn btn-sm btn-secondary m-1" rel="nofollow"
37                                                 href="{{ url_set_query(page=1, _add={ 'tag': tag.name }) }}">
38                                         {{ tag.title }}
39                                         <span class="badge badge-pill badge-light ml-1">{{ count }}</span>
40                                 </a>
41                         {% endif %}
42                 {% endfor %}
43         </aside>
44
45         {% from "macros/packagegridtile.html" import render_pkggrid %}
46         {{ render_pkggrid(packages) }}
47
48
49         {% from "macros/pagination.html" import render_pagination %}
50         {{ render_pagination(pagination, url_set_query) }}
51
52
53         {% if topics %}
54                 <h2 style="margin-top:2em;">More content from the forums</h2>
55
56                 {% from "macros/topics.html" import render_topics %}
57                 {{ render_topics(topics, current_user) }}
58         {% endif %}
59
60
61 {% endblock %}