Add number of comments to torrent lists

Will only show when number of comments is above zero.
This commit is contained in:
Kfir Hadas 2017-05-23 10:51:28 +03:00
parent b6ecad898d
commit 90695cad11
2 changed files with 20 additions and 5 deletions

View File

@ -62,6 +62,18 @@ table.torrent-list tbody tr td a:visited {
color: #1d4568;
}
table.torrent-list tbody .comments {
float: right;
border: 1px solid #d7d7d7;
border-radius: 3px;
color: #383838;
padding: 0 5px 0 5px;
background-color: #ffffff;
}
table.torrent-list tbody .comments i {
padding-right: 2px;
}
#torrent-description img {
max-width: 100%;
}

View File

@ -68,11 +68,14 @@
<img src="/static/img/icons/{{ icon_dir }}/{{ cat_id }}.png" alt="{{ category_name(cat_id) }}">
</a>
</td>
{% if use_elastic %}
<td><a href="{{ url_for('view_torrent', torrent_id=torrent.meta.id) }}" title="{{ torrent.display_name | escape }}">{%if "highlight" in torrent.meta %}{{ torrent.meta.highlight.display_name[0] | safe }}{% else %}{{torrent.display_name}}{%endif%}</a></td>
{% else %}
<td><a href="{{ url_for('view_torrent', torrent_id=torrent.id) }}" title="{{ torrent.display_name | escape }}">{{ torrent.display_name | escape }}</a></td>
{% endif %}
<td>
{% if torrent.comments %}<span class="comments"><i class="fa fa-comments-o"></i>{{ torrent.comments | length }}</span>{% endif %}
{% if use_elastic %}
<a href="{{ url_for('view_torrent', torrent_id=torrent.meta.id) }}" title="{{ torrent.display_name | escape }}">{%if "highlight" in torrent.meta %}{{ torrent.meta.highlight.display_name[0] | safe }}{% else %}{{torrent.display_name}}{%endif%}</a>
{% else %}
<a href="{{ url_for('view_torrent', torrent_id=torrent.id) }}" title="{{ torrent.display_name | escape }}">{{ torrent.display_name | escape }}</a>
{% endif %}
</td>
<td style="white-space: nowrap;text-align: center;">
{% if torrent.has_torrent %}<a href="{{ url_for('download_torrent', torrent_id=torrent.id) }}"><i class="fa fa-fw fa-download"></i></a>{% endif %}
{% if use_elastic %}