De weebify & strip down site

This commit is contained in:
simon987 2020-12-04 21:54:07 -05:00
parent 4fe0ff5b1a
commit 26caa656ec
26 changed files with 765 additions and 860 deletions

View File

@ -1,227 +0,0 @@
import os
import re
DEBUG = True
######################
## Maintenance mode ##
######################
# A read-only maintenance mode, in which the database is not modified
MAINTENANCE_MODE = False
# A maintenance message (used in layout.html template)
MAINTENANCE_MODE_MESSAGE = 'Site is currently in read-only maintenance mode.'
# Allow logging in during maintenance (without updating last login date)
MAINTENANCE_MODE_LOGINS = True
# Block *anonymous* uploads completely
RAID_MODE_LIMIT_UPLOADS = False
# Message prepended to the full error message (account.py)
RAID_MODE_UPLOADS_MESSAGE = 'Anonymous uploads are currently disabled.'
# Require manual activation for newly registered accounts
RAID_MODE_LIMIT_REGISTER = False
# Message prepended to the full error message (account.py)
RAID_MODE_REGISTER_MESSAGE = 'Registration is currently being limited.'
#############
## General ##
#############
# What the site identifies itself as. This affects templates, not database stuff.
SITE_NAME = 'Nyaa'
# What the both sites are labeled under (used for eg. email subjects)
GLOBAL_SITE_NAME = 'Nyaa.si'
# General prefix for running multiple sites, eg. most database tables are site-prefixed
SITE_FLAVOR = 'nyaa' # 'nyaa' or 'sukebei'
# Full external urls to both sites, used for site-change links
EXTERNAL_URLS = {'fap':'***', 'main':'***'}
# Secret keys for Flask
CSRF_SESSION_KEY = '***'
SECRET_KEY = '***'
# Present a recaptcha for anonymous uploaders
USE_RECAPTCHA = False
# Require email validation
USE_EMAIL_VERIFICATION = False
# Use MySQL or Sqlite3 (mostly deprecated)
USE_MYSQL = True
# Show seeds/peers/completions in torrent list/page
ENABLE_SHOW_STATS = True
# Enable password recovery (by reset link to given email address)
# Depends on email support!
ALLOW_PASSWORD_RESET = True
# A list of strings or compiled regexes to deny registering emails by.
# Regexes will be .search()'d against emails,
# while strings will be a simple 'string in email.lower()' check.
# Leave empty to disable the blacklist.
EMAIL_BLACKLIST = (
# Hotmail completely rejects "untrusted" emails,
# so it's less of a headache to blacklist them as users can't receive the mails anyway.
# (Hopefully) complete list of Microsoft email domains follows:
re.compile(r'(?i)@hotmail\.(co|co\.uk|com|de|dk|eu|fr|it|net|org|se)'),
re.compile(r'(?i)@live\.(co|co.uk|com|de|dk|eu|fr|it|net|org|se|no)'),
re.compile(r'(?i)@outlook\.(at|be|cl|co|co\.(id|il|nz|th)|com|com\.(ar|au|au|br|gr|pe|tr|vn)|cz|de|de|dk|dk|es|eu|fr|fr|hu|ie|in|it|it|jp|kr|lv|my|org|ph|pt|sa|se|sg|sk)'),
re.compile(r'(?i)@(msn\.com|passport\.(com|net))'),
# '@dodgydomain.tk'
)
EMAIL_SERVER_BLACKLIST = (
# Bad mailserver IPs here (MX server.com -> A mail.server.com > 11.22.33.44)
# '1.2.3.4', '11.22.33.44'
)
# Recaptcha keys (https://www.google.com/recaptcha)
RECAPTCHA_PUBLIC_KEY = '***'
RECAPTCHA_PRIVATE_KEY = '***'
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
if USE_MYSQL:
SQLALCHEMY_DATABASE_URI = ('mysql://test:test123@localhost/nyaav2?charset=utf8mb4')
else:
SQLALCHEMY_DATABASE_URI = (
'sqlite:///' + os.path.join(BASE_DIR, 'test.db') + '?check_same_thread=False')
###########
## EMAIL ##
###########
# 'smtp' or 'mailgun'
MAIL_BACKEND = 'mailgun'
MAIL_FROM_ADDRESS = 'Sender Name <sender@domain.com>'
# Mailgun settings
MAILGUN_API_BASE = 'https://api.mailgun.net/v3/YOUR_DOMAIN_NAME'
MAILGUN_API_KEY = 'YOUR_API_KEY'
# SMTP settings
SMTP_SERVER = '***'
SMTP_PORT = 587
SMTP_USERNAME = '***'
SMTP_PASSWORD = '***'
# The maximum number of files a torrent can contain
# until the site says "Too many files to display."
MAX_FILES_VIEW = 1000
# Verify uploaded torrents have the given tracker in them?
ENFORCE_MAIN_ANNOUNCE_URL = False
MAIN_ANNOUNCE_URL = 'http://127.0.0.1:6881/announce'
# Tracker API integration - don't mind this
TRACKER_API_URL = 'http://127.0.0.1:6881/api'
TRACKER_API_AUTH = 'topsecret'
#############
## Account ##
#############
# Limit torrent upload rate
RATELIMIT_UPLOADS = True
RATELIMIT_ACCOUNT_AGE = 7 * 24 * 3600
# After uploading MAX_UPLOAD_BURST torrents within UPLOAD_BURST_DURATION,
# the following uploads must be at least UPLOAD_TIMEOUT seconds after the previous upload.
MAX_UPLOAD_BURST = 5
UPLOAD_BURST_DURATION = 45 * 60
UPLOAD_TIMEOUT = 15 * 60
# Torrents uploaded without an account must be at least this big in total (bytes)
# Set to 0 to disable
MINIMUM_ANONYMOUS_TORRENT_SIZE = 1 * 1024 * 1024
# Minimum age for an account not to be served a captcha (seconds)
# Relies on USE_RECAPTCHA. Set to 0 to disable.
ACCOUNT_RECAPTCHA_AGE = 7 * 24 * 3600 # A week
# Seconds after which an IP is allowed to register another account
# (0 disables the limitation)
PER_IP_ACCOUNT_COOLDOWN = 24 * 3600
# Backup original .torrent uploads
BACKUP_TORRENT_FOLDER = 'torrents'
############
## Search ##
############
# How many results should a page contain. Applies to RSS as well.
RESULTS_PER_PAGE = 75
# How many pages we'll return at most
MAX_PAGES = 100
# How long and how many entries to cache for count queries
COUNT_CACHE_SIZE = 256
COUNT_CACHE_DURATION = 30
# Use baked queries for database search
USE_BAKED_SEARCH = False
# Use better searching with ElasticSearch
# See README.MD on setup!
USE_ELASTIC_SEARCH = False
# Highlight matches (for debugging)
ENABLE_ELASTIC_SEARCH_HIGHLIGHT = False
# Max ES search results, do not set over 10000
ES_MAX_SEARCH_RESULT = 1000
# ES index name generally (nyaa or sukebei)
ES_INDEX_NAME = SITE_FLAVOR
# ES hosts
ES_HOSTS = ['localhost:9200']
################
## Commenting ##
################
# Time limit for editing a comment after it has been posted (seconds)
# Set to 0 to disable
EDITING_TIME_LIMIT = 0
# Whether to use Gravatar or just always use the default avatar
# (Useful if run as development instance behind NAT/firewall)
ENABLE_GRAVATAR = True
##########################
## Trusted Requirements ##
##########################
# Minimum number of uploads the user needs to have in order to apply for trusted
TRUSTED_MIN_UPLOADS = 10
# Minimum number of cumulative downloads the user needs to have across their
# torrents in order to apply for trusted
TRUSTED_MIN_DOWNLOADS = 10000
# Number of days an applicant needs to wait before re-applying
TRUSTED_REAPPLY_COOLDOWN = 90
###########
## Cache ##
###########
# Interesting types include "simple", "redis" and "uwsgi"
# See https://pythonhosted.org/Flask-Caching/#configuring-flask-caching
CACHE_TYPE = "simple"
# Maximum number of items the cache will store
# Only applies to "simple" and "filesystem" cache types
CACHE_THRESHOLD = 8192
# If you want to use redis, try this
# CACHE_TYPE = "redis"
# CACHE_REDIS_HOST = "127.0.0.1"
# CACHE_KEY_PREFIX = "catcache_"
###############
## Ratelimit ##
###############
# To actually make this work across multiple worker processes, use redis
# RATELIMIT_STORAGE_URL="redis://host:port"
RATELIMIT_KEY_PREFIX="nyaaratelimit_"

View File

@ -7,18 +7,14 @@ from nyaa.extensions import db
app = create_app('config') app = create_app('config')
NYAA_CATEGORIES = [ NYAA_CATEGORIES = [
('Anime', ['Anime Music Video', 'English-translated', 'Non-English-translated', 'Raw']), ('Books', ['Fiction', 'Non-Fiction']),
('Audio', ['Lossless', 'Lossy']), ('Media', ['Audio', 'Video', 'Images']),
('Literature', ['English-translated', 'Non-English-translated', 'Raw']), ('Software', ['Misc', 'Games']),
('Live Action', ['English-translated', 'Idol/Promotional Video', 'Non-English-translated', 'Raw']), ('NSFW', ['Pictures', 'Videos', 'Audio']),
('Pictures', ['Graphics', 'Photos']), ('Misc', ['Other']),
('Software', ['Applications', 'Games']),
] ]
SUKEBEI_CATEGORIES = [ SUKEBEI_CATEGORIES = [
('Art', ['Anime', 'Doujinshi', 'Games', 'Manga', 'Pictures']),
('Real Life', ['Photobooks / Pictures', 'Videos']),
] ]
@ -27,7 +23,7 @@ def add_categories(categories, main_class, sub_class):
main_cat = main_class(name=main_cat_name) main_cat = main_class(name=main_cat_name)
for i, sub_cat_name in enumerate(sub_cat_names): for i, sub_cat_name in enumerate(sub_cat_names):
# Composite keys can't autoincrement, set sub_cat id manually (1-index) # Composite keys can't autoincrement, set sub_cat id manually (1-index)
sub_cat = sub_class(id=i+1, name=sub_cat_name, main_category=main_cat) sub_cat = sub_class(id=i + 1, name=sub_cat_name, main_category=main_cat)
db.session.add(main_cat) db.session.add(main_cat)

File diff suppressed because it is too large Load Diff

BIN
nyaa/static/img/icons/nyaa/1_1.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 723 B

BIN
nyaa/static/img/icons/nyaa/1_2.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 851 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

BIN
nyaa/static/img/icons/nyaa/2_1.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 622 B

BIN
nyaa/static/img/icons/nyaa/2_2.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 671 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

BIN
nyaa/static/img/icons/nyaa/3_1.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 746 B

BIN
nyaa/static/img/icons/nyaa/3_2.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

BIN
nyaa/static/img/icons/nyaa/4_1.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

BIN
nyaa/static/img/icons/nyaa/4_2.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 608 B

BIN
nyaa/static/img/icons/nyaa/4_3.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

BIN
nyaa/static/img/icons/nyaa/5_1.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 870 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -28,9 +28,9 @@
{# prev and next are only show if a symbol has been passed. #} {# prev and next are only show if a symbol has been passed. #}
{% if prev != None -%} {% if prev != None -%}
{% if pagination.has_prev %} {% if pagination.has_prev %}
<li><a rel="prev" href="{{_arg_url_for(endpoint, url_args, p=pagination.prev_num)}}">{{prev}}</a></li> <li><a rel="prev" href="{{_arg_url_for(endpoint, url_args, p=pagination.prev_num)}}"><i class="fa fa-chevron-left"></i></a></li>
{% else %} {% else %}
<li class="disabled"><a href="#">{{prev}}</a></li> <li class="disabled"><a href="#"><i class="fa fa-chevron-left"></i></a></li>
{% endif %} {% endif %}
{%- endif -%} {%- endif -%}
@ -48,9 +48,9 @@
{% if next != None -%} {% if next != None -%}
{% if pagination.has_next %} {% if pagination.has_next %}
<li><a rel="next" href="{{_arg_url_for(endpoint, url_args, p=pagination.next_num)}}">{{next}}</a></li> <li><a rel="next" href="{{_arg_url_for(endpoint, url_args, p=pagination.next_num)}}"><i class="fa fa-chevron-right"></i></a></li>
{% else %} {% else %}
<li class="disabled"><a href="#">{{next}}</a></li> <li class="disabled"><a href="#"><i class="fa fa-chevron-right"></i></a></li>
{% endif %} {% endif %}
{%- endif -%} {%- endif -%}
</ul> </ul>

View File

@ -95,7 +95,7 @@
<hr> <hr>
<div class="row"> <div class="row">
<div class="col-md-5""> <div class="col-md-5">
<div class="panel panel-danger"> <div class="panel panel-danger">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title">Danger Zone</h3> <h3 class="panel-title">Danger Zone</h3>

View File

@ -1,287 +1,316 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>{% block title %}{{ config.SITE_NAME }}{% endblock %}</title> <title>{% block title %}{{ config.SITE_NAME }}{% endblock %}</title>
<meta name="viewport" content="width=480px"> <meta name="viewport" content="width=480px">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="shortcut icon" type="image/png" href="{{ url_for('static', filename='favicon.png') }}"> <link rel="shortcut icon" type="image/png" href="{{ url_for('static', filename='favicon.png') }}">
<link rel="icon" type="image/png" href="{{ url_for('static', filename='favicon.png') }}"> <link rel="icon" type="image/png" href="{{ url_for('static', filename='favicon.png') }}">
<link rel="mask-icon" href="{{ url_for('static', filename='pinned-tab.svg') }}" color="#3582F7"> <link rel="mask-icon" href="{{ url_for('static', filename='pinned-tab.svg') }}" color="#3582F7">
<link rel="alternate" type="application/rss+xml" href="{% if rss_filter %}{{ url_for('main.home', page='rss', _external=True, **rss_filter) }}{% else %}{{ url_for('main.home', page='rss', _external=True) }}{% endif %}" /> <link rel="alternate" type="application/rss+xml" href="
{% if rss_filter %}{{ url_for('main.home', page='rss', _external=True, **rss_filter) }}{% else %}{{ url_for('main.home', page='rss', _external=True) }}{% endif %}"/>
<meta property="og:site_name" content="{{ config.SITE_NAME }}"> <meta property="og:site_name" content="{{ config.SITE_NAME }}">
<meta property="og:title" content="{{ self.title() }}"> <meta property="og:title" content="{{ self.title() }}">
<meta property="og:image" content="{% block meta_image %}/static/img/avatar/default.png{% endblock %}"> <meta property="og:image" content="{% block meta_image %}/static/img/avatar/default.png{% endblock %}">
{% block metatags %} {% block metatags %}
{# Filled by children #} {# Filled by children #}
{% endblock %} {% endblock %}
<!-- Bootstrap core CSS --> <!-- Bootstrap core CSS -->
<!-- <!--
Note: This has been customized at http://getbootstrap.com/customize/ to Note: This has been customized at http://getbootstrap.com/customize/ to
set the column breakpoint to tablet mode, instead of mobile. This is to set the column breakpoint to tablet mode, instead of mobile. This is to
make the navbar not look awful on tablets. make the navbar not look awful on tablets.
--> -->
{# These are extracted here for the dark mode toggle #} {# These are extracted here for the dark mode toggle #}
{% set bootstrap_light = static_cachebuster('css/bootstrap.min.css') %} {% set bootstrap_light = static_cachebuster('css/bootstrap.min.css') %}
{% set bootstrap_dark = static_cachebuster('css/bootstrap-dark.min.css') %} {% set bootstrap_dark = static_cachebuster('css/bootstrap-dark.min.css') %}
<link href="{{ bootstrap_light }}" rel="stylesheet" id="bsThemeLink"> <link href="{{ bootstrap_light }}" rel="stylesheet" id="bsThemeLink">
<link href="{{ static_cachebuster('css/bootstrap-xl-mod.css') }}" rel="stylesheet"> <link href="{{ static_cachebuster('css/bootstrap-xl-mod.css') }}" rel="stylesheet">
<!-- <!--
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
--> -->
<script>function toggleDarkMode(){"dark"===localStorage.getItem("theme")?setThemeLight():setThemeDark()}function setThemeDark(){bsThemeLink.href="{{ bootstrap_dark }}",localStorage.setItem("theme","dark"),document.body!==null&&document.body.classList.add('dark')}function setThemeLight(){bsThemeLink.href="{{ bootstrap_light }}",localStorage.setItem("theme","light"),document.body!==null&&document.body.classList.remove('dark')}if("undefined"!=typeof Storage){var bsThemeLink=document.getElementById("bsThemeLink");"dark"===localStorage.getItem("theme")&&setThemeDark()}</script> <script>function toggleDarkMode() {
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.2/css/bootstrap-select.min.css" integrity="sha256-an4uqLnVJ2flr7w0U74xiF4PJjO2N5Df91R2CUmCLCA=" crossorigin="anonymous" /> "dark" === localStorage.getItem("theme") ? setThemeLight() : setThemeDark()
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" /> }
<!-- Custom styles for this template --> function setThemeDark() {
<link href="{{ static_cachebuster('css/main.css') }}" rel="stylesheet"> bsThemeLink.href = "{{ bootstrap_dark }}", localStorage.setItem("theme", "dark"), document.body !== null && document.body.classList.add('dark')
}
<!-- Core JavaScript --> function setThemeLight() {
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script> bsThemeLink.href = "{{ bootstrap_light }}", localStorage.setItem("theme", "light"), document.body !== null && document.body.classList.remove('dark')
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script> }
<script src="https://cdnjs.cloudflare.com/ajax/libs/markdown-it/8.3.1/markdown-it.min.js" integrity="sha256-3WZyZQOe+ql3pLo90lrkRtALrlniGdnf//gRpW0UQks=" crossorigin="anonymous"></script>
<!-- Modified to not apply border-radius to selectpickers and stuff so our navbar looks cool -->
{% assets "bs_js" %}
<script src="{{ static_cachebuster('js/bootstrap-select.min.js') }}"></script>
{% endassets %}
{% assets "main_js" %}
<script src="{{ static_cachebuster('js/main.min.js') }}"></script>
{% endassets %}
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> if ("undefined" != typeof Storage) {
<!--[if lt IE 9]> var bsThemeLink = document.getElementById("bsThemeLink");
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> "dark" === localStorage.getItem("theme") && setThemeDark()
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> }</script>
<![endif]--> <link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.2/css/bootstrap-select.min.css"
integrity="sha256-an4uqLnVJ2flr7w0U74xiF4PJjO2N5Df91R2CUmCLCA=" crossorigin="anonymous"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous"/>
{% if config.SITE_FLAVOR == 'nyaa' %} <!-- Custom styles for this template -->
<link rel="search" type="application/opensearchdescription+xml" title="Nyaa.si" href="/static/search.xml"> <link href="{{ static_cachebuster('css/main.css') }}" rel="stylesheet">
{% elif config.SITE_FLAVOR == 'sukebei' %}
<link rel="search" type="application/opensearchdescription+xml" title="Sukebei (Nyaa.si)" href="/static/search-sukebei.xml">
{% endif %}
</head>
<body>
<!-- Fixed navbar -->
<nav class="navbar navbar-default navbar-static-top navbar-inverse">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{ url_for('main.home') }}">{{ config.SITE_NAME }}</a>
</div><!--/.navbar-header -->
{% set search_username = (user.username + ("'" if user.username[-1] == 's' else "'s")) if user_page else None %}
{% set search_placeholder = 'Search {} torrents...'.format(search_username) if user_page else 'Search...' %}
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li {% if request.path == url_for('torrents.upload') %}class="active"{% endif %}><a href="{{ url_for('torrents.upload') }}">Upload</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
Info
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li {% if request.path == url_for('site.rules') %}class="active"{% endif %}><a href="{{ url_for('site.rules') }}">Rules</a></li>
<li {% if request.path == url_for('site.help') %}class="active"{% endif %}><a href="{{ url_for('site.help') }}">Help</a></li>
<li {% if request.path == url_for('site.trusted') %}class="active"{% endif %}><a href="{{ url_for('site.trusted') }}">Trusted</a></li>
</ul>
</li>
<li><a href="{% if rss_filter %}{{ url_for('main.home', page='rss', **rss_filter) }}{% else %}{{ url_for('main.home', page='rss') }}{% endif %}">RSS</a></li>
{% if config.SITE_FLAVOR == 'nyaa' %}
<li><a href="//{{ config.EXTERNAL_URLS['fap'] }}">Fap</a></li>
{% elif config.SITE_FLAVOR == 'sukebei' %}
<li><a href="//{{ config.EXTERNAL_URLS['main'] }}">Fun</a></li>
{% endif %}
{% if g.user.is_moderator %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
Admin
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li {% if request.path == url_for('admin.reports') %}class="active"{% endif %}><a href="{{ url_for('admin.reports') }}">Reports</a></li>
<li {% if request.path == url_for('admin.log') %}class="active"{% endif %}><a href="{{ url_for('admin.log') }}">Log</a></li>
<li {% if request.path == url_for('admin.bans') %}class="active"{% endif %}><a href="{{ url_for('admin.bans') }}">Bans</a></li>
<li {% if request.path == url_for('admin.trusted') %}class="active"{% endif %}><a href="{{ url_for('admin.trusted') }}">Trusted</a></li>
</ul>
</li>
{% endif %}
</ul>
<ul class="nav navbar-nav navbar-right"> <!-- Core JavaScript -->
{% if g.user %} <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"
<li class="dropdown"> integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<a href="#" class="dropdown-toggle visible-lg visible-sm visible-xs" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"
<i class="fa fa-user fa-fw"></i> integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
{{ g.user.username }} <script src="https://cdnjs.cloudflare.com/ajax/libs/markdown-it/8.3.1/markdown-it.min.js"
<span class="caret"></span> integrity="sha256-3WZyZQOe+ql3pLo90lrkRtALrlniGdnf//gRpW0UQks=" crossorigin="anonymous"></script>
</a> <!-- Modified to not apply border-radius to selectpickers and stuff so our navbar looks cool -->
<a href="#" class="dropdown-toggle hidden-lg hidden-sm hidden-xs" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> {% assets "bs_js" %}
<i class="fa fa-user fa-fw"></i> <script src="{{ static_cachebuster('js/bootstrap-select.min.js') }}"></script>
<span class="caret"></span> {% endassets %}
</a> {% assets "main_js" %}
<ul class="dropdown-menu"> <script src="{{ static_cachebuster('js/main.min.js') }}"></script>
<li class="hidden-lg hidden-sm hidden-xs"> {% endassets %}
<a><i class="fa fa-user fa-fw"></i>Logged in as {{ g.user.username }}</a>
</li>
<li class="hidden-lg hidden-sm hidden-xs divider" role="separator">
</li> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<li> <!--[if lt IE 9]>
<a href="{{ url_for('users.view_user', user_name=g.user.username) }}"> <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<i class="fa fa-user fa-fw"></i> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
Torrents <![endif]-->
</a>
</li>
<li>
<a href="{{ url_for('account.profile') }}">
<i class="fa fa-gear fa-fw"></i>
Profile
</a>
</li>
<li>
<a href="{{ url_for('account.logout') }}">
<i class="fa fa-times fa-fw"></i>
Logout
</a>
</li>
</ul>
</li>
{% else %}
<li class="dropdown">
<a href="#" class="dropdown-toggle visible-lg visible-sm visible-xs" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-user fa-fw"></i>
Guest
<span class="caret"></span>
</a>
<a href="#" class="dropdown-toggle hidden-lg hidden-sm hidden-xs" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-user fa-fw"></i>
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li>
<a href="{{ url_for('account.login') }}">
<i class="fa fa-sign-in fa-fw"></i>
Login
</a>
</li>
<li>
<a href="{{ url_for('account.register') }}">
<i class="fa fa-pencil fa-fw"></i>
Register
</a>
</li>
</ul>
</li>
{% endif %}
</ul>
{% set nyaa_cats = [('1_0', 'Anime', 'Anime'),
('1_1', '- Anime Music Video', 'Anime - AMV'),
('1_2', '- English-translated', 'Anime - English'),
('1_3', '- Non-English-translated', 'Anime - Non-English'),
('1_4', '- Raw', 'Anime - Raw'),
('2_0', 'Audio', 'Audio'),
('2_1', '- Lossless', 'Audio - Lossless'),
('2_2', '- Lossy', 'Audio - Lossy'),
('3_0', 'Literature', 'Literature'),
('3_1', '- English-translated', 'Literature - English'),
('3_2', '- Non-English-translated', 'Literature - Non-English'),
('3_3', '- Raw', 'Literature - Raw'),
('4_0', 'Live Action', 'Live Action'),
('4_1', '- English-translated', 'Live Action - English'),
('4_2', '- Idol/Promotional Video', 'Live Action - Idol/PV'),
('4_3', '- Non-English-translated', 'Live Action - Non-English'),
('4_4', '- Raw', 'Live Action - Raw'),
('5_0', 'Pictures', 'Pictures'),
('5_1', '- Graphics', 'Pictures - Graphics'),
('5_2', '- Photos', 'Pictures - Photos'),
('6_0', 'Software', 'Software'),
('6_1', '- Applications', 'Software - Apps'),
('6_2', '- Games', 'Software - Games')]
%}
{% set suke_cats = [('1_0', 'Art', 'Art'), {% if config.SITE_FLAVOR == 'nyaa' %}
('1_1', '- Anime', 'Art - Anime'), <link rel="search" type="application/opensearchdescription+xml" title="Nyaa.si" href="/static/search.xml">
('1_2', '- Doujinshi', 'Art - Doujinshi'), {% elif config.SITE_FLAVOR == 'sukebei' %}
('1_3', '- Games', 'Art - Games'), <link rel="search" type="application/opensearchdescription+xml" title="Sukebei (Nyaa.si)"
('1_4', '- Manga', 'Art - Manga'), href="/static/search-sukebei.xml">
('1_5', '- Pictures', 'Art - Pictures'), {% endif %}
('2_0', 'Real Life', 'Real Life'), </head>
('2_1', '- Photobooks and Pictures', 'Real Life - Pictures'), <body>
('2_2', '- Videos', 'Real Life - Videos')] <!-- Fixed navbar -->
%} <nav class="navbar navbar-default navbar-static-top navbar-inverse">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{ url_for('main.home') }}">{{ config.SITE_NAME }}</a>
</div><!--/.navbar-header -->
{% set search_username = (user.username + ("'" if user.username[-1] == 's' else "'s")) if user_page else None %}
{% set search_placeholder = 'Search {} torrents...'.format(search_username) if user_page else 'Search...' %}
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li {% if request.path == url_for('torrents.upload') %}class="active"{% endif %}><a
href="{{ url_for('torrents.upload') }}">Upload</a></li>
{# <li class="dropdown">#}
{# <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">#}
{# Info#}
{# <span class="caret"></span>#}
{# </a>#}
{# <ul class="dropdown-menu">#}
{# <li {% if request.path == url_for('site.rules') %}class="active"{% endif %}><a href="{{ url_for('site.rules') }}">Rules</a></li>#}
{# <li {% if request.path == url_for('site.help') %}class="active"{% endif %}><a href="{{ url_for('site.help') }}">Help</a></li>#}
{# <li {% if request.path == url_for('site.trusted') %}class="active"{% endif %}><a href="{{ url_for('site.trusted') }}">Trusted</a></li>#}
{# </ul>#}
{# </li>#}
<li><a href="
{% if rss_filter %}{{ url_for('main.home', page='rss', **rss_filter) }}{% else %}{{ url_for('main.home', page='rss') }}{% endif %}">RSS</a>
</li>
{% if g.user.is_moderator %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
aria-expanded="false">
Admin
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li {% if request.path == url_for('admin.reports') %}class="active"{% endif %}><a
href="{{ url_for('admin.reports') }}">Reports</a></li>
<li {% if request.path == url_for('admin.log') %}class="active"{% endif %}><a
href="{{ url_for('admin.log') }}">Log</a></li>
<li {% if request.path == url_for('admin.bans') %}class="active"{% endif %}><a
href="{{ url_for('admin.bans') }}">Bans</a></li>
<li {% if request.path == url_for('admin.trusted') %}class="active"{% endif %}><a
href="{{ url_for('admin.trusted') }}">Trusted</a></li>
</ul>
</li>
{% endif %}
</ul>
{% if config.SITE_FLAVOR == 'nyaa' %} <ul class="nav navbar-nav navbar-right">
{% set used_cats = nyaa_cats %} {% if g.user %}
{% elif config.SITE_FLAVOR == 'sukebei' %} <li class="dropdown">
{% set used_cats = suke_cats %} <a href="#" class="dropdown-toggle visible-lg visible-sm visible-xs" data-toggle="dropdown"
{% endif %} role="button" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-user fa-fw"></i>
{{ g.user.username }}
<span class="caret"></span>
</a>
<a href="#" class="dropdown-toggle hidden-lg hidden-sm hidden-xs" data-toggle="dropdown"
role="button" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-user fa-fw"></i>
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li class="hidden-lg hidden-sm hidden-xs">
<a><i class="fa fa-user fa-fw"></i>Logged in as {{ g.user.username }}</a>
</li>
<li class="hidden-lg hidden-sm hidden-xs divider" role="separator">
<div class="search-container visible-xs visible-sm"> </li>
{# The mobile menu #} <li>
{% if user_page %} <a href="{{ url_for('users.view_user', user_name=g.user.username) }}">
<form class="navbar-form navbar-right form" action="{{ url_for('users.view_user', user_name=user.username) }}" method="get"> <i class="fa fa-user fa-fw"></i>
{% else %} Torrents
<form class="navbar-form navbar-right form" action="{{ url_for('main.home') }}" method="get"> </a>
{% endif %} </li>
<li>
<a href="{{ url_for('account.profile') }}">
<i class="fa fa-gear fa-fw"></i>
Profile
</a>
</li>
<li>
<a href="{{ url_for('account.logout') }}">
<i class="fa fa-times fa-fw"></i>
Logout
</a>
</li>
</ul>
</li>
{% else %}
<li class="dropdown">
<a href="#" class="dropdown-toggle visible-lg visible-sm visible-xs" data-toggle="dropdown"
role="button" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-user fa-fw"></i>
Guest
<span class="caret"></span>
</a>
<a href="#" class="dropdown-toggle hidden-lg hidden-sm hidden-xs" data-toggle="dropdown"
role="button" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-user fa-fw"></i>
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li>
<a href="{{ url_for('account.login') }}">
<i class="fa fa-sign-in fa-fw"></i>
Login
</a>
</li>
<li>
<a href="{{ url_for('account.register') }}">
<i class="fa fa-pencil fa-fw"></i>
Register
</a>
</li>
</ul>
</li>
{% endif %}
</ul>
{% set used_cats = [('1_0', 'Books', 'Books'),
('1_1', '- Fiction', 'Books - Fiction'),
('1_2', '- Non-Fiction', 'Books - Non-Fiction'),
('2_0', 'Media', 'Media'),
('2_1', '- Audio', 'Media - Audio'),
('2_2', '- Video', 'Media - Video'),
('2_2', '- Images', 'Media - Images'),
('3_0', 'Software', 'Software'),
('3_1', '- Misc', 'Software - Misc'),
('3_2', '- Games', 'Software - Games'),
('4_0', 'NSFW', 'NSFW'),
('4_1', '- Pictures', 'NSFW - Pictures'),
('4_2', '- Videos', 'NSFW - Videos'),
('4_2', '- Audio', 'NSFW - Audio'),
('5_0', 'Misc', 'Misc'),
('5_1', '- Other', 'Misc - Other')] %}
<input type="text" class="form-control" name="q" placeholder="{{ search_placeholder }}" value="{{ search["term"] if search is defined else '' }}"> <div class="search-container visible-xs visible-sm">
<br> {# The mobile menu #}
{% if user_page %}
<form class="navbar-form navbar-right form"
action="{{ url_for('users.view_user', user_name=user.username) }}" method="get">
{% else %}
<form class="navbar-form navbar-right form" action="{{ url_for('main.home') }}" method="get">
{% endif %}
<select class="form-control" title="Filter" data-width="120px" name="f"> <input type="text" class="form-control" name="q" placeholder="{{ search_placeholder }}"
<option value="0" title="No filter" {% if search is defined and search["quality_filter"] == "0" %}selected{% else %}selected{% endif %}>No filter</option> value="{{ search["term"] if search is defined else '' }}">
<option value="1" title="No remakes" {% if search is defined and search["quality_filter"] == "1" %}selected{% endif %}>No remakes</option> <br>
<option value="2" title="Trusted only" {% if search is defined and search["quality_filter"] == "2" %}selected{% endif %}>Trusted only</option>
</select>
<br> <select class="form-control" title="Filter" data-width="120px" name="f">
<option value="0" title="No filter"
{% if search is defined and search["quality_filter"] == "0" %}selected{% else %}selected{% endif %}>
No filter
</option>
<option value="1" title="No remakes"
{% if search is defined and search["quality_filter"] == "1" %}selected{% endif %}>No remakes
</option>
<option value="2" title="Trusted only"
{% if search is defined and search["quality_filter"] == "2" %}selected{% endif %}>Trusted
only
</option>
</select>
<select class="form-control" title="Category" data-width="200px" name="c"> <br>
<option value="0_0" title="All categories" {% if search is defined and search["category"] == "0_0" %}selected{% else %}selected{% endif %}>
All categories
</option>
{% for cat_id, cat_name, cat_title in used_cats %}
<option value="{{ cat_id }}" title="{{ cat_title }}" {% if search is defined and search.category == cat_id %}selected{% endif %}>
{{ cat_name }}
</option>
{% endfor %}
</select>
<br> <select class="form-control" title="Category" data-width="200px" name="c">
<option value="0_0" title="All categories"
{% if search is defined and search["category"] == "0_0" %}selected{% else %}selected{% endif %}>
All categories
</option>
{% for cat_id, cat_name, cat_title in used_cats %}
<option value="{{ cat_id }}" title="{{ cat_title }}"
{% if search is defined and search.category == cat_id %}selected{% endif %}>
{{ cat_name }}
</option>
{% endfor %}
</select>
<button class="btn btn-primary form-control" type="submit"> <br>
<i class="fa fa-search fa-fw"></i> Search
</button>
</form>
</div><!--/.search-container -->
{% if user_page %} <button class="btn btn-primary form-control" type="submit">
<form class="navbar-form navbar-right form" action="{{ url_for('users.view_user', user_name=user.username) }}" method="get"> <i class="fa fa-search fa-fw"></i> Search
{% else %} </button>
<form class="navbar-form navbar-right form" action="{{ url_for('main.home') }}" method="get"> </form>
{% endif %} </div><!--/.search-container -->
<div class="input-group search-container hidden-xs hidden-sm">
<div class="input-group-btn nav-filter" id="navFilter-criteria">
<select class="selectpicker show-tick" title="Filter" data-width="120px" name="f">
<option value="0" title="No filter" {% if search is defined and search["quality_filter"] == "0" %}selected{% else %}selected{% endif %}>No filter</option>
<option value="1" title="No remakes" {% if search is defined and search["quality_filter"] == "1" %}selected{% endif %}>No remakes</option>
<option value="2" title="Trusted only" {% if search is defined and search["quality_filter"] == "2" %}selected{% endif %}>Trusted only</option>
</select>
</div>
<div class="input-group-btn nav-filter" id="navFilter-category"> {% if user_page %}
<!-- <form class="navbar-form navbar-right form hidden-xs hidden-sm"
On narrow viewports, there isn't enough room to fit the full stuff in the selectpicker, so we show a full-width one on wide viewports, but squish it on narrow ones. action="{{ url_for('users.view_user', user_name=user.username) }}" method="get">
--> {% else %}
{# XXX Search breaks with multiple fields with the same name: default to the shorter one so we don't break visuals. This is a hack! #} <form class="navbar-form navbar-right form hidden-xs hidden-sm" action="{{ url_for('main.home') }}"
{# method="get">
{% endif %}
<div class="input-group search-container">
<div class="input-group-btn nav-filter" id="navFilter-criteria">
<select class="selectpicker show-tick" title="Filter" data-width="120px" name="f">
<option value="0" title="No filter"
{% if search is defined and search["quality_filter"] == "0" %}selected{% else %}selected{% endif %}>
No filter
</option>
<option value="1" title="No remakes"
{% if search is defined and search["quality_filter"] == "1" %}selected{% endif %}>No
remakes
</option>
<option value="2" title="Trusted only"
{% if search is defined and search["quality_filter"] == "2" %}selected{% endif %}>
Trusted only
</option>
</select>
</div>
<div class="input-group-btn nav-filter" id="navFilter-category">
<!--
On narrow viewports, there isn't enough room to fit the full stuff in the selectpicker, so we show a full-width one on wide viewports, but squish it on narrow ones.
-->
{# XXX Search breaks with multiple fields with the same name: default to the shorter one so we don't break visuals. This is a hack! #}
{#
<select class="selectpicker show-tick visible-lg" title="Category" data-width="200px" name="c"> <select class="selectpicker show-tick visible-lg" title="Category" data-width="200px" name="c">
<option value="0_0" title="All categories" {% if search is defined and search["category"] == "0_0" %}selected{% else %}selected{% endif %}> <option value="0_0" title="All categories" {% if search is defined and search["category"] == "0_0" %}selected{% else %}selected{% endif %}>
All categories All categories
@ -293,46 +322,49 @@
{% endfor %} {% endfor %}
</select> </select>
#} #}
<select class="selectpicker show-tick" title="Category" data-width="130px" name="c"> <select class="selectpicker show-tick" title="Category" data-width="130px" name="c">
<option value="0_0" title="All categories" {% if search is defined and search["category"] == "0_0" %}selected{% else %}selected{% endif %}> <option value="0_0" title="All categories"
All categories {% if search is defined and search["category"] == "0_0" %}selected{% else %}selected{% endif %}>
</option> All categories
{% for cat_id, cat_name, cat_title in used_cats %} </option>
<option value="{{ cat_id }}" title="{{ cat_title }}" {% if search is defined and search.category == cat_id %}selected{% endif %}> {% for cat_id, cat_name, cat_title in used_cats %}
{{ cat_name }} <option value="{{ cat_id }}" title="{{ cat_title }}"
</option> {% if search is defined and search.category == cat_id %}selected{% endif %}>
{% endfor %} {{ cat_name }}
</select> </option>
</div> {% endfor %}
<input type="text" class="form-control search-bar" name="q" placeholder="{{ search_placeholder }}" value="{{ search['term'] if search is defined else '' }}" /> </select>
<div class="input-group-btn search-btn"> </div>
<button class="btn btn-primary" type="submit"> <input type="text" class="form-control search-bar" name="q" placeholder="{{ search_placeholder }}"
<i class="fa fa-search fa-fw"></i> value="{{ search['term'] if search is defined else '' }}"/>
</button> <div class="input-group-btn search-btn">
</div> <button class="btn btn-primary" type="submit">
</div> <i class="fa fa-search fa-fw"></i>
</form> </button>
</div><!--/.nav-collapse --> </div>
</div><!--/.container --> </div>
</nav> </form>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</nav>
<div class="container"> <div class="container">
{% include "flashes.html" %} {% include "flashes.html" %}
{% if config.MAINTENANCE_MODE and config.MAINTENANCE_MODE_MESSAGE %} {% if config.MAINTENANCE_MODE and config.MAINTENANCE_MODE_MESSAGE %}
<div class="alert alert-dismissable alert-warning" role="alert"> <div class="alert alert-dismissable alert-warning" role="alert">
<button type="button" class="close" data-dismiss="alert">&times;</button> <button type="button" class="close" data-dismiss="alert">&times;</button>
{{ config.MAINTENANCE_MODE_MESSAGE | safe }} {{ config.MAINTENANCE_MODE_MESSAGE | safe }}
</div> </div>
{% endif %} {% endif %}
{% block body %}{% endblock %} {% block body %}{% endblock %}
</div> <!-- /container --> </div> <!-- /container -->
<footer style="text-align: center;"> {# <footer style="text-align: center;">#}
<p>Dark Mode: <a href="#" id="themeToggle">Toggle</a></p> {# <p>Dark Mode: <a href="#" id="themeToggle">Toggle</a></p>#}
{% if config.COMMIT_HASH %} {# {% if config.COMMIT_HASH %}#}
<p>Commit: <a href="https://github.com/nyaadevs/nyaa/tree/{{ config.COMMIT_HASH }}">{{ config.COMMIT_HASH[:7] }}</a></p> {# <p>Commit: <a href="https://github.com/nyaadevs/nyaa/tree/{{ config.COMMIT_HASH }}">{{ config.COMMIT_HASH[:7] }}</a></p>#}
{% endif %} {# {% endif %}#}
</footer> {# </footer>#}
</body> </body>
</html> </html>

View File

@ -19,7 +19,7 @@
{% if (use_elastic and torrent_query.hits.total.value > 0) or (torrent_query.items) %} {% if (use_elastic and torrent_query.hits.total.value > 0) or (torrent_query.items) %}
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-bordered table-hover table-striped torrent-list"> <table class="table torrent-list">
<thead> <thead>
<tr> <tr>
{%+ call render_column_header("hdr-category", "width:80px;", center_text=True) -%} {%+ call render_column_header("hdr-category", "width:80px;", center_text=True) -%}
@ -58,7 +58,7 @@
{% set icon_dir = config.SITE_FLAVOR %} {% set icon_dir = config.SITE_FLAVOR %}
{% set torrents = torrent_query if use_elastic else torrent_query.items %} {% set torrents = torrent_query if use_elastic else torrent_query.items %}
{% for torrent in torrents %} {% for torrent in torrents %}
<tr class="{% if torrent.deleted %}deleted{% elif torrent.hidden %}warning{% elif torrent.remake %}danger{% elif torrent.trusted %}success{% else %}default{% endif %}"> <tr class="{% if torrent.deleted %}deleted{% elif torrent.hidden %}warning{% elif torrent.remake %}danger{% elif torrent.trusted %}default{% else %}default{% endif %}">
{% set cat_id = use_elastic and ((torrent.main_category_id|string) + '_' + (torrent.sub_category_id|string)) or torrent.sub_category.id_as_string %} {% set cat_id = use_elastic and ((torrent.main_category_id|string) + '_' + (torrent.sub_category_id|string)) or torrent.sub_category.id_as_string %}
<td> <td>
{% if use_elastic %} {% if use_elastic %}

View File

@ -18,7 +18,7 @@
{{ upload_form.csrf_token }} {{ upload_form.csrf_token }}
{% if config.ENFORCE_MAIN_ANNOUNCE_URL %}<p><strong>Important:</strong> Please include <kbd>{{ config.MAIN_ANNOUNCE_URL }}</kbd> in your trackers.</p>{% endif %} {% if config.ENFORCE_MAIN_ANNOUNCE_URL %}<p><strong>Important:</strong> Please include <kbd>{{ config.MAIN_ANNOUNCE_URL }}</kbd> in your trackers.</p>{% endif %}
<p><strong>Important:</strong> Make sure you have read <strong><a href="{{ url_for('site.rules') }}">the rules</a></strong> before uploading!</p> {# <p><strong>Important:</strong> Make sure you have read <strong><a href="{{ url_for('site.rules') }}">the rules</a></strong> before uploading!</p>#}
<br> <br>
{% if show_ratelimit %} {% if show_ratelimit %}