2018-05-29 23:58:46 +02:00
|
|
|
{% macro render_pkgtile(package, show_author) -%}
|
2023-08-25 21:49:55 +02:00
|
|
|
<li class="packagetile flex-fill"><a href="{{ package.get_url('packages.view') }}">
|
|
|
|
<img src="{{ package.get_thumb_or_placeholder(2) }}" loading="lazy">
|
2018-05-18 02:32:34 +02:00
|
|
|
<div class="packagegridscrub"></div>
|
|
|
|
<div class="packagegridinfo">
|
2018-05-29 23:58:46 +02:00
|
|
|
<h3>
|
|
|
|
{{ package.title }}
|
|
|
|
|
2018-12-23 17:28:15 +01:00
|
|
|
{% if show_author %}<br />
|
|
|
|
<small>{{ package.author.display_name }}</small>
|
2018-05-29 23:58:46 +02:00
|
|
|
{% endif %}
|
2021-07-22 12:38:20 +02:00
|
|
|
{% if not package.approved %}
|
2023-08-22 20:58:43 +02:00
|
|
|
<span class="badge ms-1 {% if package.state == package.state.CHANGES_NEEDED %}bg-danger{% else %}bg-warning{% endif %}">
|
2021-07-22 12:38:20 +02:00
|
|
|
{{ package.state.value }}
|
|
|
|
</span>
|
|
|
|
{% endif %}
|
2018-05-29 23:58:46 +02:00
|
|
|
</h3>
|
2018-05-18 02:32:34 +02:00
|
|
|
|
|
|
|
<p>
|
2019-01-29 04:00:01 +01:00
|
|
|
{{ package.short_desc }}
|
2018-05-18 02:32:34 +02:00
|
|
|
</p>
|
2018-05-29 22:24:50 +02:00
|
|
|
|
|
|
|
{% if not package.license.is_foss and not package.media_license.is_foss and package.type != package.type.TXP %}
|
|
|
|
<p style="color:#f33;">
|
2022-01-08 00:27:00 +01:00
|
|
|
{{ _("<b>Warning:</b> Non-free code and media.") }}
|
2018-05-29 22:24:50 +02:00
|
|
|
</p>
|
|
|
|
{% elif not package.license.is_foss and package.type != package.type.TXP %}
|
|
|
|
<p style="color:#f33;">
|
2022-01-08 00:27:00 +01:00
|
|
|
{{ _("<b>Warning:</b> Non-free code.") }}
|
2018-05-29 22:24:50 +02:00
|
|
|
</p>
|
|
|
|
{% elif not package.media_license.is_foss %}
|
|
|
|
<p style="color:#f33;">
|
2022-01-08 00:27:00 +01:00
|
|
|
{{ _("<b>Warning:</b> Non-free media.") }}
|
2018-05-29 22:24:50 +02:00
|
|
|
</p>
|
|
|
|
{% endif %}
|
2018-05-18 02:32:34 +02:00
|
|
|
</div>
|
|
|
|
</a></li>
|
|
|
|
{% endmacro %}
|
|
|
|
|
2018-05-29 23:58:46 +02:00
|
|
|
{% macro render_pkggrid(packages, show_author=True) -%}
|
2023-08-25 22:31:19 +02:00
|
|
|
<ul class="grid-300px gap-2 p-0">
|
2018-05-18 02:32:34 +02:00
|
|
|
{% for p in packages %}
|
2018-05-29 23:58:46 +02:00
|
|
|
{{ render_pkgtile(p, show_author) }}
|
2018-05-18 02:32:34 +02:00
|
|
|
{% else %}
|
2023-08-14 19:55:42 +02:00
|
|
|
<li class="packagetile"><i>{{ _("No packages available") }}</i></li>
|
2018-05-18 02:32:34 +02:00
|
|
|
{% endfor %}
|
2023-08-19 04:03:15 +02:00
|
|
|
{% if packages %}
|
|
|
|
{% for i in range(4) %}
|
|
|
|
<li class="packagetile flex-fill"></li>
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2018-05-18 02:32:34 +02:00
|
|
|
</ul>
|
|
|
|
{% endmacro %}
|