mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-21 16:50:01 +00:00
templates: move icon_dir set outside of the loop
Someone put this inside the loop despite it essentially being constant. Probably makes immeasurably little difference perf-wise, but why not fix it anyway.
This commit is contained in:
parent
8365894268
commit
a6d800b4ca
|
@ -55,11 +55,11 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% set icon_dir = config.SITE_FLAVOR %}
|
||||
{% set torrents = torrent_query if use_elastic else torrent_query.items %}
|
||||
{% for torrent in torrents %}
|
||||
<tr class="{% if torrent.deleted %}deleted{% elif torrent.hidden %}warning{% elif torrent.remake %}danger{% elif torrent.trusted %}success{% else %}default{% endif %}">
|
||||
{% set cat_id = use_elastic and ((torrent.main_category_id|string) + '_' + (torrent.sub_category_id|string)) or torrent.sub_category.id_as_string %}
|
||||
{% set icon_dir = config.SITE_FLAVOR %}
|
||||
<td style="padding:0 4px;">
|
||||
{% if use_elastic %}
|
||||
<a href="{{ url_for('main.home', c=cat_id) }}" title="{{ category_name(cat_id) }}">
|
||||
|
|
Loading…
Reference in a new issue