aboutsummaryrefslogtreecommitdiff
path: root/app/templates/macros/packagegridtile.html
blob: 9f70c1c2bde1715e3c840a2c3cfabbd2a603b578 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{% macro render_pkgtile(package, show_author) -%}
	<li class="packagetile flex-fill"><a href="{{ package.getDetailsURL() }}"
		style="background-image: url({{ package.getThumbnailURL() or '/static/placeholder.png' }});">
		<div class="packagegridscrub"></div>
		<div class="packagegridinfo">
			<h3>
				{{ package.title }}

				{% if show_author %}<br />
					<small>{{ package.author.display_name }}</small>
				{% endif %}
			</h3>

			<p>
				{{ package.short_desc }}
			</p>


			{% if not package.license.is_foss and not package.media_license.is_foss and package.type != package.type.TXP  %}
				<p style="color:#f33;">
					<b>Warning:</b> Non-free code and media.
				</p>
			{% elif not package.license.is_foss and package.type != package.type.TXP %}
				<p style="color:#f33;">
					<b>Warning:</b> Non-free code.
				</p>
			{% elif not package.media_license.is_foss %}
				<p style="color:#f33;">
					<b>Warning:</b> Non-free media.
				</p>
			{% endif %}
		</div>
	</a></li>
{% endmacro %}

{% macro render_pkggrid(packages, show_author=True) -%}
	<ul class="d-flex p-0 flex-row flex-wrap justify-content-start align-content-start ">
		{% for p in packages %}
			{{ render_pkgtile(p, show_author) }}
		{% else %}
			<li><i>No packages available</i></ul>
		{% endfor %}
		{% for i in range(4) %}
			<li class="packagetile flex-fill"></li>
		{% endfor %}
	</ul>
{% endmacro %}