mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-23 14:32:25 +01:00
Move package grid to macro
This commit is contained in:
parent
0b1aa8980b
commit
6711eb4afe
@ -24,22 +24,7 @@ Dashboard
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<ul class="packagegrid">
|
{% from "macros/packagegridtile.html" import render_pkggrid %}
|
||||||
{% for p in packages %}
|
{{ render_pkggrid(packages) }}
|
||||||
<li><a href="{{ p.getDetailsURL() }}"
|
|
||||||
style="background-image: url({{ p.getMainScreenshotURL() or '/static/placeholder.png' }});">
|
|
||||||
<div class="packagegridscrub"></div>
|
|
||||||
<div class="packagegridinfo">
|
|
||||||
<h3>{{ p.title }} by {{ p.author.display_name }}</h3>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
{{ p.shortDesc }}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</a></li>
|
|
||||||
{% else %}
|
|
||||||
<li><i>No packages available</i></ul>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
</main>
|
</main>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
23
app/templates/macros/packagegridtile.html
Normal file
23
app/templates/macros/packagegridtile.html
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{% macro render_pkgtile(package) -%}
|
||||||
|
<li><a href="{{ package.getDetailsURL() }}"
|
||||||
|
style="background-image: url({{ package.getMainScreenshotURL() or '/static/placeholder.png' }});">
|
||||||
|
<div class="packagegridscrub"></div>
|
||||||
|
<div class="packagegridinfo">
|
||||||
|
<h3>{{ package.title }} by {{ package.author.display_name }}</h3>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
{{ package.shortDesc }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</a></li>
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% macro render_pkggrid(packages) -%}
|
||||||
|
<ul class="packagegrid">
|
||||||
|
{% for p in packages %}
|
||||||
|
{{ render_pkgtile(p) }}
|
||||||
|
{% else %}
|
||||||
|
<li><i>No packages available</i></ul>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% endmacro %}
|
Loading…
Reference in New Issue
Block a user