]> git.lizzy.rs Git - cheatdb.git/blob - app/templates/macros/packagegridtile.html
Add topic searching and topic discarding
[cheatdb.git] / app / templates / macros / packagegridtile.html
1 {% macro render_pkgtile(package, show_author) -%}
2         <li class="packagetile flex-fill"><a href="{{ package.getDetailsURL() }}"
3                 style="background-image: url({{ package.getThumbnailURL() or '/static/placeholder.png' }});">
4                 <div class="packagegridscrub"></div>
5                 <div class="packagegridinfo">
6                         <h3>
7                                 {{ package.title }}
8
9                                 {% if show_author %}<br />
10                                         <small>{{ package.author.display_name }}</small>
11                                 {% endif %}
12                         </h3>
13
14                         <p>
15                                 {{ package.shortDesc }}
16                         </p>
17
18
19                         {% if not package.license.is_foss and not package.media_license.is_foss and package.type != package.type.TXP  %}
20                                 <p style="color:#f33;">
21                                         <b>Warning:</b> Non-free code and media.
22                                 </p>
23                         {% elif not package.license.is_foss and package.type != package.type.TXP %}
24                                 <p style="color:#f33;">
25                                         <b>Warning:</b> Non-free code.
26                                 </p>
27                         {% elif not package.media_license.is_foss %}
28                                 <p style="color:#f33;">
29                                         <b>Warning:</b> Non-free media.
30                                 </p>
31                         {% endif %}
32                 </div>
33         </a></li>
34 {% endmacro %}
35
36 {% macro render_pkggrid(packages, show_author=True) -%}
37         <ul class="d-flex p-0 flex-row flex-wrap justify-content-start align-content-start ">
38                 {% for p in packages %}
39                         {{ render_pkgtile(p, show_author) }}
40                 {% else %}
41                         <li><i>No packages available</i></ul>
42                 {% endfor %}
43                 {% for i in range(4) %}
44                         <li class="packagetile flex-fill"></li>
45                 {% endfor %}
46         </ul>
47 {% endmacro %}