S T O P H A R D C O D I N G U R L S

This commit is contained in:
nyaadev 2017-05-13 01:59:52 +02:00
parent 38a3ba277c
commit b2b8ae9722
4 changed files with 11 additions and 12 deletions

View File

@ -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'

View File

@ -16,7 +16,7 @@
make the navbar not look awful on tablets. make the navbar not look awful on tablets.
--> -->
<link href="/static/css/bootstrap.min.css" rel="stylesheet" id="bsThemeLink"> <link href="/static/css/bootstrap.min.css" rel="stylesheet" id="bsThemeLink">
<!-- <!--
This theme changer script needs to be inline and right under the above stylesheet link to prevent FOUC (Flash Of Unstyled Content) This theme changer script needs to be inline and right under the above stylesheet link to prevent FOUC (Flash Of Unstyled Content)
Development version is commented out in static/js/main.js at the bottom of the file Development version is commented out in static/js/main.js at the bottom of the file
--> -->

View File

@ -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 %}

View File

@ -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 %}
@ -28,19 +28,19 @@
{% call render_column_header("width:140px;", center_text=True, sort_key="id", header_title="In UTC") %} {% call render_column_header("width:140px;", center_text=True, sort_key="id", header_title="In UTC") %}
<div>Date</div> <div>Date</div>
{% endcall %} {% endcall %}
{% if config.ENABLE_SHOW_STATS %} {% if config.ENABLE_SHOW_STATS %}
{% call render_column_header("width:50px;", center_text=True, sort_key="seeders", header_title="Seeds") %} {% call render_column_header("width:50px;", center_text=True, sort_key="seeders", header_title="Seeds") %}
<i class="fa fa-arrow-up" aria-hidden="true"></i> <i class="fa fa-arrow-up" aria-hidden="true"></i>
{% endcall %} {% endcall %}
{% call render_column_header("width:50px;", center_text=True, sort_key="leechers", header_title="Leeches") %} {% call render_column_header("width:50px;", center_text=True, sort_key="leechers", header_title="Leeches") %}
<i class="fa fa-arrow-down" aria-hidden="true"></i> <i class="fa fa-arrow-down" aria-hidden="true"></i>
{% endcall %} {% endcall %}
{% call render_column_header("width:50px;", center_text=True, sort_key="downloads", header_title="Completed downloads") %} {% call render_column_header("width:50px;", center_text=True, sort_key="downloads", header_title="Completed downloads") %}
<i class="fa fa-check" aria-hidden="true"></i> <i class="fa fa-check" aria-hidden="true"></i>
{% endcall %} {% endcall %}
{% endif %} {% endif %}
</tr> </tr>
</thead> </thead>
@ -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>