mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-22 14:10:00 +00:00
S T O P H A R D C O D I N G U R L S
This commit is contained in:
parent
38a3ba277c
commit
b2b8ae9722
|
@ -312,7 +312,6 @@ def _jinja2_filter_rfc822(date, fmt=None):
|
||||||
def render_rss(label, query):
|
def render_rss(label, query):
|
||||||
rss_xml = flask.render_template('rss.xml',
|
rss_xml = flask.render_template('rss.xml',
|
||||||
term=label,
|
term=label,
|
||||||
site_url=flask.request.url_root,
|
|
||||||
query=query)
|
query=query)
|
||||||
response = flask.make_response(rss_xml)
|
response = flask.make_response(rss_xml)
|
||||||
response.headers['Content-Type'] = 'application/xml'
|
response.headers['Content-Type'] = 'application/xml'
|
||||||
|
|
|
@ -4,16 +4,16 @@
|
||||||
<description>
|
<description>
|
||||||
RSS Feed for {{ term }}
|
RSS Feed for {{ term }}
|
||||||
</description>
|
</description>
|
||||||
<link>{{ site_url }}</link>
|
<link>{{ url_for('home', _external=True) }}</link>
|
||||||
<atom:link href="{{ site_url }}rss" rel="self" type="application/rss+xml" />
|
<atom:link href="{{ url_for('home', page='rss', _external=True) }}" rel="self" type="application/rss+xml" />
|
||||||
{% for torrent in query %}
|
{% for torrent in query %}
|
||||||
{% if torrent.has_torrent %}
|
{% if torrent.has_torrent %}
|
||||||
<item>
|
<item>
|
||||||
<title>{{ torrent.display_name }}</title>
|
<title>{{ torrent.display_name }}</title>
|
||||||
<link>
|
<link>
|
||||||
{{ site_url }}view/{{ torrent.id }}/torrent
|
{{ url_for('download_torrent', torrent_id=torrent.id, _external=True) }}
|
||||||
</link>
|
</link>
|
||||||
<guid isPermaLink="true">{{ site_url }}view/{{ torrent.id }}</guid>
|
<guid isPermaLink="true">{{ url_for('view_torrent', torrent_id=torrent.id, _external=True) }}</guid>
|
||||||
<pubDate>{{ torrent.created_time|rfc822 }}</pubDate>
|
<pubDate>{{ torrent.created_time|rfc822 }}</pubDate>
|
||||||
</item>
|
</item>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{% macro render_column_header(header_style, center_text=False, sort_key=None, header_title=None) %}
|
{% macro render_column_header(header_style, center_text=False, sort_key=None, header_title=None) %}
|
||||||
{% set class_suffix = (search.sort == sort_key) and ("_" + search.order) or "" %}
|
{% set class_suffix = (search.sort == sort_key) and ("_" + search.order) or "" %}
|
||||||
{% set th_classes = filter_truthy([sort_key and "sorting" + class_suffix, center_text and "text-center"]) %}
|
{% set th_classes = filter_truthy([sort_key and "sorting" + class_suffix, center_text and "text-center"]) %}
|
||||||
<th {% if th_classes %} class="{{ ' '.join(th_classes) }}"{% endif %} {% if header_title %}title="{{header_title}}"{% endif %} style="{{header_style}}">
|
<th {% if th_classes %} class="{{ ' '.join(th_classes) }}"{% endif %} {% if header_title %}title="{{header_title}}"{% endif %} style="{{ header_style }}">
|
||||||
{% if sort_key %}
|
{% if sort_key %}
|
||||||
<a href="{% if class_suffix == '_desc' %}{{ modify_query(s=sort_key, o="asc") }}{% else %}{{ modify_query(s=sort_key, o="desc") }}{% endif %}"></a>
|
<a href="{% if class_suffix == '_desc' %}{{ modify_query(s=sort_key, o="asc") }}{% else %}{{ modify_query(s=sort_key, o="desc") }}{% endif %}"></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -54,9 +54,9 @@
|
||||||
<img src="/static/img/icons/{{ icon_dir }}/{{ cat_id }}.png">
|
<img src="/static/img/icons/{{ icon_dir }}/{{ cat_id }}.png">
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td><a href="/view/{{ torrent.id }}">{{ torrent.display_name | escape }}</a></td>
|
<td><a href="{{ url_for('view_torrent', torrent_id=torrent.id) }}">{{ torrent.display_name | escape }}</a></td>
|
||||||
<td style="white-space: nowrap;text-align: center;">
|
<td style="white-space: nowrap;text-align: center;">
|
||||||
{% if torrent.has_torrent %}<a href="/view/{{ torrent.id }}/torrent"><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 %}
|
||||||
<a href="{{ torrent.magnet_uri }}"><i class="fa fa-fw fa-magnet"></i></a>
|
<a href="{{ torrent.magnet_uri }}"><i class="fa fa-fw fa-magnet"></i></a>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">{{ torrent.filesize | filesizeformat(True) }}</td>
|
<td class="text-center">{{ torrent.filesize | filesizeformat(True) }}</td>
|
||||||
|
|
Loading…
Reference in a new issue