1
0
Fork 0
mirror of https://gitlab.com/SIGBUS/nyaa.git synced 2024-12-22 15:19:59 +00:00

Turn comments icon on search result into link to comments

Also cleans up torrent.id/torrent.meta.id
This commit is contained in:
TheAMM 2017-05-28 02:46:04 +03:00
parent f02836f75e
commit 32fa021f34
2 changed files with 7 additions and 6 deletions

View file

@ -70,20 +70,21 @@
</a> </a>
</td> </td>
<td colspan="2"> <td colspan="2">
{% set torrent_id = torrent.meta.id if use_elastic else torrent.id %}
{% set com_count = torrent.comment_count %} {% set com_count = torrent.comment_count %}
{% if com_count %} {% if com_count %}
<span class="comments" title="{{ '{c} comment{s}'.format(c=com_count, s='s' if com_count > 1 else '') }}"> <a href="{{ url_for('view_torrent', torrent_id=torrent_id, _anchor='comments') }}" class="comments" title="{{ '{c} comment{s}'.format(c=com_count, s='s' if com_count > 1 else '') }}">
<i class="fa fa-comments-o"></i>{{ com_count -}} <i class="fa fa-comments-o"></i>{{ com_count -}}
</span> </a>
{% endif %} {% endif %}
{% if use_elastic %} {% 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> <a href="{{ url_for('view_torrent', torrent_id=torrent_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 %} {% else %}
<a href="{{ url_for('view_torrent', torrent_id=torrent.id) }}" title="{{ torrent.display_name | escape }}">{{ torrent.display_name | escape }}</a> <a href="{{ url_for('view_torrent', torrent_id=torrent_id) }}" title="{{ torrent.display_name | escape }}">{{ torrent.display_name | escape }}</a>
{% endif %} {% endif %}
</td> </td>
<td class="text-center" style="white-space: nowrap;"> <td class="text-center" style="white-space: nowrap;">
{% 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 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 %} {% if use_elastic %}
<a href="{{ create_magnet_from_es_info(torrent.display_name, torrent.info_hash) }}"><i class="fa fa-fw fa-magnet"></i></a> <a href="{{ create_magnet_from_es_info(torrent.display_name, torrent.info_hash) }}"><i class="fa fa-fw fa-magnet"></i></a>
{% else %} {% else %}

View file

@ -128,7 +128,7 @@
</div> </div>
{% endif %} {% endif %}
<div class="panel panel-default"> <div id="comments" class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title"> <h3 class="panel-title">
Comments - {{ comments | length }} Comments - {{ comments | length }}