{% macro render_column_header(header_class, header_style, center_text=False, sort_key=None, header_title=None) %} {% set class_suffix = (search.sort == sort_key) and ("_" + search.order) or "" %} {% set th_classes = filter_truthy([header_class, sort_key and "sorting" + class_suffix, center_text and "text-center"]) %} {%- if sort_key -%} {%- endif -%} {{- caller() -}} {% endmacro %} {% if special_results is defined and not search.user %} {% if special_results.first_word_user %}
Click here to see only results uploaded by {{ special_results.first_word_user.username }}
{% endif %} {% endif %} {% if (use_elastic and torrent_query.hits.total.value > 0) or (torrent_query.items) %}
{%+ call render_column_header("hdr-category", "width:80px;", center_text=True) -%} Category {%- endcall %} {%+ call render_column_header("hdr-name", "width:auto;") -%} Name {%- endcall %} {%+ call render_column_header("hdr-comments", "width:50px;", center_text=True, sort_key="comments", header_title="Comments") -%} {%- endcall %} {%+ call render_column_header("hdr-link", "width:70px;", center_text=True) -%} Link {%- endcall %} {%+ call render_column_header("hdr-size", "width:100px;", center_text=True, sort_key="size") -%} Size {%- endcall %} {%+ call render_column_header("hdr-date", "width:140px;", center_text=True, sort_key="id", header_title="In UTC") -%} Date {%- endcall %} {% if config.ENABLE_SHOW_STATS %} {%+ call render_column_header("hdr-seeders", "width:50px;", center_text=True, sort_key="seeders", header_title="Seeders") -%} {%- endcall %} {%+ call render_column_header("hdr-leechers", "width:50px;", center_text=True, sort_key="leechers", header_title="Leechers") -%} {%- endcall %} {%+ call render_column_header("hdr-downloads", "width:50px;", center_text=True, sort_key="downloads", header_title="Completed downloads") -%} {%- endcall %} {% endif %} {% set icon_dir = config.SITE_FLAVOR %} {% set torrents = torrent_query if use_elastic else torrent_query.items %} {% for torrent in torrents %} {% set cat_id = use_elastic and ((torrent.main_category_id|string) + '_' + (torrent.sub_category_id|string)) or torrent.sub_category.id_as_string %} {% if use_elastic %} {% else %} {% endif %} {% if config.ENABLE_SHOW_STATS %} {% if use_elastic %} {% else %} {% endif %} {% endif %} {% endfor %}
{% if use_elastic %} {% else %} {% endif %} {{ category_name(cat_id) }} {% set torrent_id = torrent.meta.id if use_elastic else torrent.id %} {% set com_count = torrent.comment_count %} {% if com_count %} {{ com_count -}} {% endif %} {% if use_elastic %} {%if "highlight" in torrent.meta %}{{ torrent.meta.highlight.display_name[0] | safe }}{% else %}{{torrent.display_name}}{% endif %} {% else %} {{ torrent.display_name | escape }} {% endif %} {% if torrent.has_torrent %} {% endif %} {% if use_elastic %} {% else %} {% endif %} {{ torrent.filesize | filesizeformat(True) }}{{ torrent.created_time | display_time }}{{ torrent.created_time.strftime('%Y-%m-%d %H:%M') }}{{ torrent.seed_count }} {{ torrent.leech_count }} {{ torrent.download_count }}{{ torrent.stats.seed_count }} {{ torrent.stats.leech_count }} {{ torrent.stats.download_count }}
{% else %}

No results found

{% endif %}
{% if use_elastic %} {{ pagination.info }} {{ pagination.links }} {% else %} {% from "bootstrap/pagination.html" import render_pagination %} {{ render_pagination(torrent_query) }} {% endif %}