mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-22 20:50:00 +00:00
"Unfix" the page
This commit is contained in:
parent
1705bfd6ea
commit
e13235fc97
|
@ -2,7 +2,7 @@
|
||||||
{% block title %}{{ torrent.display_name }} :: {{ config.SITE_NAME }}{% endblock %}
|
{% block title %}{{ torrent.display_name }} :: {{ config.SITE_NAME }}{% endblock %}
|
||||||
{% block body %}
|
{% block body %}
|
||||||
{% from "_formhelpers.html" import render_field %}
|
{% from "_formhelpers.html" import render_field %}
|
||||||
<div class="panel panel-{% if torrent.deleted %}deleted{% elif torrent.remake %}danger{% elif torrent.trusted %}success{% else %}default{% endif %}">
|
<div class="panel panel-{% if torrent.deleted %}deleted{% elif torrent.remake %}danger{% elif torrent.trusted %}success{% else %}default{% endif %}">
|
||||||
<div class="panel-heading"{% if torrent.hidden %} style="background-color: darkgray;"{% endif %}>
|
<div class="panel-heading"{% if torrent.hidden %} style="background-color: darkgray;"{% endif %}>
|
||||||
<h3 class="panel-title">
|
<h3 class="panel-title">
|
||||||
{% if can_edit %}
|
{% if can_edit %}
|
||||||
|
@ -15,25 +15,19 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-1">Category:</div>
|
<div class="col-md-1">Category:</div>
|
||||||
<div class="col-md-5">
|
<div class="col-md-5">
|
||||||
<a href="{{ url_for("home", c=torrent.main_category.id_as_string) }}">{{ torrent.main_category.name }}</a>
|
<a href="{{ url_for("home", c=torrent.main_category.id_as_string) }}">{{ torrent.main_category.name }}</a> - <a href="{{ url_for("home", c=torrent.sub_category.id_as_string) }}">{{ torrent.sub_category.name }}</a>
|
||||||
- <a
|
|
||||||
href="{{ url_for("home", c=torrent.sub_category.id_as_string) }}">{{ torrent.sub_category.name }}</a>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-1">Date:</div>
|
<div class="col-md-1">Date:</div>
|
||||||
<div class="col-md-5"
|
<div class="col-md-5" data-timestamp="{{ torrent.created_utc_timestamp|int }}">{{ torrent.created_time.strftime('%Y-%m-%d %H:%M UTC') }}</div>
|
||||||
data-timestamp="{{ torrent.created_utc_timestamp|int }}">{{ torrent.created_time.strftime('%Y-%m-%d %H:%M UTC') }}</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-1">Submitter:</div>
|
<div class="col-md-1">Submitter:</div>
|
||||||
<div class="col-md-5">{% if not torrent.anonymous and torrent.user %}
|
<div class="col-md-5">{% if not torrent.anonymous and torrent.user %}<a href="{{ url_for('view_user', user_name=torrent.user.username) }}">{{ torrent.user.username }}</a>{% else %}Anonymous{% endif %}</div>
|
||||||
<a href="{{ url_for('view_user', user_name=torrent.user.username) }}">{{ torrent.user.username }}</a>{% else %}
|
|
||||||
Anonymous{% endif %}</div>
|
|
||||||
|
|
||||||
<div class="col-md-1">Seeders:</div>
|
<div class="col-md-1">Seeders:</div>
|
||||||
<div class="col-md-5"><span style="color: green;">{% if config.ENABLE_SHOW_STATS %}
|
<div class="col-md-5"><span style="color: green;">{% if config.ENABLE_SHOW_STATS %}{{ torrent.stats.seed_count }}{% else %}Coming soon{% endif %}</span></div>
|
||||||
{{ torrent.stats.seed_count }}{% else %}Coming soon{% endif %}</span></div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -44,12 +38,11 @@
|
||||||
{{ torrent.information_as_link | safe }}
|
{{ torrent.information_as_link | safe }}
|
||||||
{% else %}
|
{% else %}
|
||||||
No information.
|
No information.
|
||||||
{% endif %}
|
{% endif%}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-1">Leechers:</div>
|
<div class="col-md-1">Leechers:</div>
|
||||||
<div class="col-md-5"><span style="color: red;">{% if config.ENABLE_SHOW_STATS %}
|
<div class="col-md-5"><span style="color: red;">{% if config.ENABLE_SHOW_STATS %}{{ torrent.stats.leech_count }}{% else %}Coming soon{% endif %}</span></div>
|
||||||
{{ torrent.stats.leech_count }}{% else %}Coming soon{% endif %}</span></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -57,41 +50,35 @@
|
||||||
<div class="col-md-5">{{ torrent.filesize | filesizeformat(True) }}</div>
|
<div class="col-md-5">{{ torrent.filesize | filesizeformat(True) }}</div>
|
||||||
|
|
||||||
<div class="col-md-1">Downloads:</div>
|
<div class="col-md-1">Downloads:</div>
|
||||||
<div class="col-md-5">
|
<div class="col-md-5">{% if config.ENABLE_SHOW_STATS %}{{ torrent.stats.download_count }}{% else %}Coming soon{% endif %}</div>
|
||||||
{% if config.ENABLE_SHOW_STATS %}{{ torrent.stats.download_count }}{% else %}Coming
|
|
||||||
soon{% endif %}</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-footer" style="font-size: large">
|
<div class="panel-footer clearfix" style="font-size: large">
|
||||||
{% if torrent.has_torrent %}
|
{% if torrent.has_torrent %}<a href="/view/{{ torrent.id }}/torrent"><i class="fa fa-download fa-fw"></i>Download Torrent</a> or {% endif %}<a href="{{ torrent.magnet_uri }}" class="card-footer-item"><i class="fa fa-magnet fa-fw"></i>Magnet</a>
|
||||||
<a href="/view/{{ torrent.id }}/torrent"><i class="fa fa-download fa-fw"></i>Download Torrent</a>
|
|
||||||
or {% endif %}<a href="{{ torrent.magnet_uri }}" class="card-footer-item"><i
|
|
||||||
class="fa fa-magnet fa-fw"></i>Magnet</a>
|
|
||||||
<button type="button" class="btn btn-danger pull-right" data-toggle="modal" data-target="#reportModal">
|
<button type="button" class="btn btn-danger pull-right" data-toggle="modal" data-target="#reportModal">
|
||||||
Report
|
Report
|
||||||
</button>
|
</button>
|
||||||
<div class="clearfix"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="panel panel-default">
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="panel panel-default">
|
||||||
<div class="panel-body" id="torrent-description">
|
<div class="panel-body" id="torrent-description">
|
||||||
{% if torrent.description %}
|
{% if torrent.description %}
|
||||||
{# Escape newlines into html entities because CF strips blank newlines #}
|
{# Escape newlines into html entities because CF strips blank newlines #}
|
||||||
{{ torrent.description | escape | replace('\r\n', '\n') | replace('\n', ' '|safe) }}
|
{{ torrent.description | escape | replace('\r\n', '\n') | replace('\n', ' '|safe) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
#### No description.
|
#### No description.
|
||||||
{% endif %}
|
{% endif%}
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{% if files and files.__len__() <= config.MAX_FILES_VIEW %}
|
{% if files and files.__len__() <= config.MAX_FILES_VIEW %}
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading panel-heading-collapse">
|
<div class="panel-heading panel-heading-collapse">
|
||||||
<h3 class="panel-title">
|
<h3 class="panel-title">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<a class="collapsed col-md-12" data-target="#collapseFileList" data-toggle="collapse"
|
<a class="collapsed col-md-12" data-target="#collapseFileList" data-toggle="collapse" style="color:inherit;text-decoration:none;">File list</a>
|
||||||
style="color:inherit;text-decoration:none;">File list</a>
|
|
||||||
</div>
|
</div>
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
|
@ -106,13 +93,11 @@
|
||||||
{%- for key, value in files.items() recursive %}
|
{%- for key, value in files.items() recursive %}
|
||||||
<tr>
|
<tr>
|
||||||
{%- if value is iterable %}
|
{%- if value is iterable %}
|
||||||
<td colspan="2"
|
<td colspan="2" {% if loop.depth0 is greaterthan 0 %}style="padding-left: {{ loop.depth0 * 20 }}px"{% endif %}>
|
||||||
{% if loop.depth0 is greaterthan 0 %}style="padding-left: {{ loop.depth0 * 20 }}px"{% endif %}>
|
|
||||||
<i class="glyphicon glyphicon-folder-open"></i> <b>{{ key }}</b></td>
|
<i class="glyphicon glyphicon-folder-open"></i> <b>{{ key }}</b></td>
|
||||||
{{ loop(value.items()) }}
|
{{ loop(value.items()) }}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
<td{% if loop.depth0 is greaterthan 0 %}
|
<td{% if loop.depth0 is greaterthan 0 %} style="padding-left: {{ loop.depth0 * 20 }}px"{% endif %}>
|
||||||
style="padding-left: {{ loop.depth0 * 20 }}px"{% endif %}>
|
|
||||||
<i class="glyphicon glyphicon-file"></i> {{ key }}</td>
|
<i class="glyphicon glyphicon-file"></i> {{ key }}</td>
|
||||||
<td class="col-md-2">{{ value | filesizeformat(True) }}</td>
|
<td class="col-md-2">{{ value | filesizeformat(True) }}</td>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
@ -120,30 +105,26 @@
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% elif files %}
|
{% elif files %}
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading panel-heading-collapse">
|
<div class="panel-heading panel-heading-collapse">
|
||||||
<h3 class="panel-title">
|
<h3 class="panel-title">
|
||||||
<div class="row">
|
<div class="row"><div class="col-md-12">Too many files to display.</div></div>
|
||||||
<div class="col-md-12">Too many files to display.</div>
|
|
||||||
</div>
|
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading panel-heading-collapse">
|
<div class="panel-heading panel-heading-collapse">
|
||||||
<h3 class="panel-title">
|
<h3 class="panel-title">
|
||||||
<div class="row">
|
<div class="row"><div class="col-md-12">File list is not available for this torrent.</div></div>
|
||||||
<div class="col-md-12">File list is not available for this torrent.</div>
|
|
||||||
</div>
|
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="modal fade" id="reportModal" tabindex="-1" role="dialog" aria-labelledby="reportModalLabel">
|
<div class="modal fade" id="reportModal" tabindex="-1" role="dialog" aria-labelledby="reportModalLabel">
|
||||||
<div class="modal-dialog" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
|
@ -160,21 +141,20 @@
|
||||||
<button type="submit" class="btn btn-danger">Report</button>
|
<button type="submit" class="btn btn-danger">Report</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer" style="border-top: none;">
|
<div class="modal-footer" style="border-top: none;">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var target = document.getElementById('torrent-description');
|
var target = document.getElementById('torrent-description');
|
||||||
var text = target.innerHTML;
|
var text = target.innerHTML;
|
||||||
var reader = new commonmark.Parser({safe: true});
|
var reader = new commonmark.Parser({safe: true});
|
||||||
var writer = new commonmark.HtmlRenderer({safe: true, softbreak: '<br />'});
|
var writer = new commonmark.HtmlRenderer({safe: true, softbreak: '<br />'});
|
||||||
var parsed = reader.parse(text.trim());
|
var parsed = reader.parse(text.trim());
|
||||||
target.innerHTML = writer.render(parsed);
|
target.innerHTML = writer.render(parsed);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
Loading…
Reference in a new issue