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)

View File

@ -1,12 +1,12 @@
.panel-heading-collapse a:after { .panel-heading-collapse a:after {
font-family:'Glyphicons Halflings'; font-family: 'Glyphicons Halflings';
content:"\e114"; content: "\e114";
float: right; float: right;
color: grey; color: grey;
} }
.panel-heading-collapse a.collapsed:after { .panel-heading-collapse a.collapsed:after {
content:"\e080"; content: "\e080";
} }
.torrent-list > tbody > tr > td { .torrent-list > tbody > tr > td {
@ -89,6 +89,7 @@ table.torrent-list tbody .comments {
font-size: small; font-size: small;
background-color: #ffffff; background-color: #ffffff;
} }
table.torrent-list tbody .comments i { table.torrent-list tbody .comments i {
padding-right: 2px; padding-right: 2px;
} }
@ -96,14 +97,17 @@ table.torrent-list tbody .comments i {
table.torrent-list td:first-child { table.torrent-list td:first-child {
padding: 0 4px; padding: 0 4px;
} }
table.torrent-list td:nth-child(4) { table.torrent-list td:nth-child(4) {
white-space: nowrap; white-space: nowrap;
} }
table.torrent-list td:nth-child(6), table.torrent-list td:nth-child(6),
body.dark table.torrent-list > tbody > tr.success > td:nth-child(6), body.dark table.torrent-list > tbody > tr.success > td:nth-child(6),
body.dark table.torrent-list > tbody > tr.danger > td:nth-child(6) { body.dark table.torrent-list > tbody > tr.danger > td:nth-child(6) {
color: green; color: green;
} }
table.torrent-list td:nth-child(7), table.torrent-list td:nth-child(7),
body.dark table.torrent-list > tbody > tr.success > td:nth-child(7), body.dark table.torrent-list > tbody > tr.success > td:nth-child(7),
body.dark table.torrent-list > tbody > tr.danger > td:nth-child(7) { body.dark table.torrent-list > tbody > tr.danger > td:nth-child(7) {
@ -115,34 +119,34 @@ body.dark table.torrent-list > tbody > tr.danger > td:nth-child(7) {
} }
.table > tbody > tr.deleted > td, .table > tbody > tr.deleted > th, .table > tbody > tr > td.deleted, .table > tbody > tr > th.deleted, .table > tfoot > tr.deleted > td, .table > tfoot > tr.deleted > th, .table > tfoot > tr > td.deleted, .table > tfoot > tr > th.deleted, .table > thead > tr.deleted > td, .table > thead > tr.deleted > th, .table > thead > tr > td.deleted, .table > thead > tr > th.deleted { .table > tbody > tr.deleted > td, .table > tbody > tr.deleted > th, .table > tbody > tr > td.deleted, .table > tbody > tr > th.deleted, .table > tfoot > tr.deleted > td, .table > tfoot > tr.deleted > th, .table > tfoot > tr > td.deleted, .table > tfoot > tr > th.deleted, .table > thead > tr.deleted > td, .table > thead > tr.deleted > th, .table > thead > tr > td.deleted, .table > thead > tr > th.deleted {
background-color:#9e9e9e; background-color: #9e9e9e;
} }
.table-hover > tbody > tr.deleted:hover > td, .table-hover > tbody > tr.deleted:hover > th, .table-hover > tbody > tr:hover > .deleted, .table-hover > tbody > tr > td.deleted:hover, .table-hover > tbody > tr > th.deleted:hover { .table-hover > tbody > tr.deleted:hover > td, .table-hover > tbody > tr.deleted:hover > th, .table-hover > tbody > tr:hover > .deleted, .table-hover > tbody > tr > td.deleted:hover, .table-hover > tbody > tr > th.deleted:hover {
background-color:#bdbdbd; background-color: #bdbdbd;
} }
.panel-deleted { .panel-deleted {
border-color:#757575; border-color: #757575;
} }
.panel-deleted > .panel-heading { .panel-deleted > .panel-heading {
color:#212121; color: #212121;
background-color:#9e9e9e; background-color: #9e9e9e;
border-color:#757575; border-color: #757575;
} }
.panel-deleted > .panel-heading + .panel-collapse > .panel-body { .panel-deleted > .panel-heading + .panel-collapse > .panel-body {
border-top-color:#757575; border-top-color: #757575;
} }
.panel-deleted > .panel-heading .badge { .panel-deleted > .panel-heading .badge {
color:#9e9e9e; color: #9e9e9e;
background-color:#212121; background-color: #212121;
} }
.panel-deleted > .panel-footer + .panel-collapse > .panel-body { .panel-deleted > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color:#757575; border-bottom-color: #757575;
} }
.markdown-editor label { .markdown-editor label {
@ -226,8 +230,7 @@ body.dark table.torrent-list > tbody > tr.danger > td:nth-child(7) {
} }
/* Upload page drop zone */ /* Upload page drop zone */
#upload-drop-zone #upload-drop-zone {
{
visibility: hidden; visibility: hidden;
opacity: 0; opacity: 0;
position: absolute; position: absolute;
@ -245,8 +248,7 @@ body.dark table.torrent-list > tbody > tr.danger > td:nth-child(7) {
font: bold 42px Tahoma, sans-serif; font: bold 42px Tahoma, sans-serif;
} }
#upload-drop-zone span #upload-drop-zone span {
{
display: table-cell; display: table-cell;
text-align: center; text-align: center;
vertical-align: middle; vertical-align: middle;
@ -260,7 +262,7 @@ body.dark table.torrent-list > tbody > tr.danger > td:nth-child(7) {
padding: 0 3px; padding: 0 3px;
border-radius: 3px; border-radius: 3px;
border: 1px solid rgba(100, 56, 0, 0.8); border: 1px solid rgba(100, 56, 0, 0.8);
background: rgba(200,127,0,0.3); background: rgba(200, 127, 0, 0.3);
} }
ul.nav-tabs#profileTabs { ul.nav-tabs#profileTabs {
@ -273,13 +275,16 @@ ul.nav-tabs#profileTabs {
margin-top: 10px; margin-top: 10px;
margin-bottom: 10px; margin-bottom: 10px;
} }
.comment-panel .panel-body { .comment-panel .panel-body {
padding-top: 10px; padding-top: 10px;
padding-bottom: 10px; padding-bottom: 10px;
} }
.comment-panel .col-md-2 p { .comment-panel .col-md-2 p {
margin-bottom: 5px; margin-bottom: 5px;
} }
.comment-panel:target { .comment-panel:target {
border-color: black; border-color: black;
border-width: 2px; border-width: 2px;
@ -305,6 +310,7 @@ a.text-purple:hover, a.text-purple:active, a.text-purple:focus {
.comment-content { .comment-content {
overflow-wrap: break-word; overflow-wrap: break-word;
} }
.comment-content img { .comment-content img {
max-width: 100%; max-width: 100%;
max-height: 600px; max-height: 600px;
@ -448,8 +454,9 @@ h6:hover .header-anchor {
visibility: visible; visibility: visible;
display: inline-block; display: inline-block;
} }
.trusted-form textarea { .trusted-form textarea {
height:12em; height: 12em;
} }
/* Dark theme */ /* Dark theme */
@ -519,13 +526,16 @@ body.dark .torrent-list > tbody > tr.success > td {
color: inherit; color: inherit;
background-color: rgba(60, 206, 0, 0.12); background-color: rgba(60, 206, 0, 0.12);
} }
body.dark .torrent-list > tbody > tr.success:hover > td { body.dark .torrent-list > tbody > tr.success:hover > td {
background-color: rgba(60, 206, 0, 0.18); background-color: rgba(60, 206, 0, 0.18);
} }
body.dark div.panel-success, body.dark div.panel-success,
body.dark div.panel-success > .panel-heading { body.dark div.panel-success > .panel-heading {
border-color: #33452c; /* == trusted entry in torrent list */ border-color: #33452c; /* == trusted entry in torrent list */
} }
body.dark div.panel-success > .panel-heading { body.dark div.panel-success > .panel-heading {
background-color: #56704b; /* == trusted entry in torrent list + hover */ background-color: #56704b; /* == trusted entry in torrent list + hover */
} }
@ -535,14 +545,17 @@ body.dark .torrent-list > tbody > tr.danger > td {
color: inherit; color: inherit;
background-color: rgba(208, 0, 0, 0.12); background-color: rgba(208, 0, 0, 0.12);
} }
body.dark .torrent-list > tbody > tr.danger:hover > td { body.dark .torrent-list > tbody > tr.danger:hover > td {
color: inherit; color: inherit;
background-color: rgba(208, 0, 0, 0.18); background-color: rgba(208, 0, 0, 0.18);
} }
body.dark div.panel-danger, body.dark div.panel-danger,
body.dark div.panel-danger > .panel-heading { body.dark div.panel-danger > .panel-heading {
border-color: #452c2c; /* == remake entry in torrent list */ border-color: #452c2c; /* == remake entry in torrent list */
} }
body.dark div.panel-danger > .panel-heading { body.dark div.panel-danger > .panel-heading {
background-color: #714b4b; /* == remake entry in torrent list + hover */ background-color: #714b4b; /* == remake entry in torrent list + hover */
} }
@ -551,9 +564,11 @@ body.dark div.panel-danger > .panel-heading {
body.dark .torrent-list > tbody > tr.deleted > td { body.dark .torrent-list > tbody > tr.deleted > td {
background-color: rgba(255, 255, 255, 0.20); background-color: rgba(255, 255, 255, 0.20);
} }
body.dark .torrent-list > tbody > tr.deleted:hover > td { body.dark .torrent-list > tbody > tr.deleted:hover > td {
background-color: rgba(255, 255, 255, 0.26); background-color: rgba(255, 255, 255, 0.26);
} }
body.dark .panel-deleted > .panel-heading { body.dark .panel-deleted > .panel-heading {
color: #232323; color: #232323;
} }
@ -577,7 +592,9 @@ body.dark .panel-deleted > .panel-heading {
.torrent-list .hdr-date, .torrent-list .hdr-date,
.torrent-list .hdr-downloads, .torrent-list .hdr-downloads,
.torrent-list td: nth-of-type(5), .torrent-list td:
nth-of-type(5),
.torrent-list td:nth-of-type(8) { .torrent-list td:nth-of-type(8) {
display: none; display: none;
} }
@ -680,3 +697,90 @@ blockquote {
height: auto; height: auto;
} }
} }
.navbar-inverse {
background-color: #ee6e73;
border: none;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}
.navbar-inverse .navbar-nav > li > a {
color: #EEEEEE;
}
.navbar-inverse .navbar-brand {
color: #EEEEEE;
}
.navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus {
color: #fff;
background-color: #eb595f;
}
.navbar-inverse .navbar-nav > .open > a, .navbar-inverse .navbar-nav > .open > a:hover, .navbar-inverse .navbar-nav > .open > a:focus {
background-color: #eb595f;
}
.btn-primary {
background-color: #56adaa;
border-color: #4fa2a0;
}
.btn-primary:hover {
background-color: #4fa2a0;
border-color: #4fa2a0;
}
.pagination > .active > a, .pagination > .active > span, .pagination > .active > a:hover, .pagination > .active > span:hover, .pagination > .active > a:focus, .pagination > .active > span:focus {
background-color: #4fa2a0;
}
a {
color: #4fa2a0;
}
table.torrent-list tbody tr td a:visited {
color: #4fa2a0;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
color: #EEEEEE;
}
.navbar-inverse .navbar-toggle {
border-color: #ef7d82;
}
.navbar-inverse .navbar-toggle:hover, .navbar-inverse .navbar-toggle:focus {
background-color: #eb595f;
}
.navbar-form {
margin-bottom: 0;
}
.navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form {
border-color: #eb595f;
}
@media (min-width: 1000px) {
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
color: #111111;
}
}
.table > tbody > tr > td, .table > thead > tr > th {
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}
td, th {
padding: 15px 10px;
}
table.torrent-list td:nth-child(7), body.dark table.torrent-list > tbody > tr.success > td:nth-child(7), body.dark table.torrent-list > tbody > tr.danger > td:nth-child(7) {
color: #e57373;
}
table.torrent-list td:nth-child(6), body.dark table.torrent-list > tbody > tr.success > td:nth-child(7), body.dark table.torrent-list > tbody > tr.danger > td:nth-child(7) {
color: #66BB6A;
}

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,6 +1,6 @@
<!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>
@ -9,7 +9,8 @@
<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() }}">
@ -33,17 +34,38 @@
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" /> }
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>
<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"/>
<!-- Custom styles for this template --> <!-- Custom styles for this template -->
<link href="{{ static_cachebuster('css/main.css') }}" rel="stylesheet"> <link href="{{ static_cachebuster('css/main.css') }}" rel="stylesheet">
<!-- Core JavaScript --> <!-- Core JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script> integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" 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> <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 --> <!-- Modified to not apply border-radius to selectpickers and stuff so our navbar looks cool -->
{% assets "bs_js" %} {% assets "bs_js" %}
<script src="{{ static_cachebuster('js/bootstrap-select.min.js') }}"></script> <script src="{{ static_cachebuster('js/bootstrap-select.min.js') }}"></script>
@ -61,15 +83,17 @@
{% if config.SITE_FLAVOR == 'nyaa' %} {% if config.SITE_FLAVOR == 'nyaa' %}
<link rel="search" type="application/opensearchdescription+xml" title="Nyaa.si" href="/static/search.xml"> <link rel="search" type="application/opensearchdescription+xml" title="Nyaa.si" href="/static/search.xml">
{% elif config.SITE_FLAVOR == 'sukebei' %} {% elif config.SITE_FLAVOR == 'sukebei' %}
<link rel="search" type="application/opensearchdescription+xml" title="Sukebei (Nyaa.si)" href="/static/search-sukebei.xml"> <link rel="search" type="application/opensearchdescription+xml" title="Sukebei (Nyaa.si)"
href="/static/search-sukebei.xml">
{% endif %} {% endif %}
</head> </head>
<body> <body>
<!-- Fixed navbar --> <!-- Fixed navbar -->
<nav class="navbar navbar-default navbar-static-top navbar-inverse"> <nav class="navbar navbar-default navbar-static-top navbar-inverse">
<div class="container"> <div class="container">
<div class="navbar-header"> <div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <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="sr-only">Toggle navigation</span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
@ -81,35 +105,38 @@
{% set search_placeholder = 'Search {} torrents...'.format(search_username) if user_page else 'Search...' %} {% set search_placeholder = 'Search {} torrents...'.format(search_username) if user_page else 'Search...' %}
<div id="navbar" class="navbar-collapse collapse"> <div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav"> <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 {% if request.path == url_for('torrents.upload') %}class="active"{% endif %}><a
<li class="dropdown"> href="{{ url_for('torrents.upload') }}">Upload</a></li>
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> {# <li class="dropdown">#}
Info {# <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">#}
<span class="caret"></span> {# Info#}
</a> {# <span class="caret"></span>#}
<ul class="dropdown-menu"> {# </a>#}
<li {% if request.path == url_for('site.rules') %}class="active"{% endif %}><a href="{{ url_for('site.rules') }}">Rules</a></li> {# <ul class="dropdown-menu">#}
<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.rules') %}class="active"{% endif %}><a href="{{ url_for('site.rules') }}">Rules</a></li>#}
<li {% if request.path == url_for('site.trusted') %}class="active"{% endif %}><a href="{{ url_for('site.trusted') }}">Trusted</a></li> {# <li {% if request.path == url_for('site.help') %}class="active"{% endif %}><a href="{{ url_for('site.help') }}">Help</a></li>#}
</ul> {# <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> </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 %} {% if g.user.is_moderator %}
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
aria-expanded="false">
Admin Admin
<span class="caret"></span> <span class="caret"></span>
</a> </a>
<ul class="dropdown-menu"> <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.reports') %}class="active"{% endif %}><a
<li {% if request.path == url_for('admin.log') %}class="active"{% endif %}><a href="{{ url_for('admin.log') }}">Log</a></li> href="{{ url_for('admin.reports') }}">Reports</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.log') %}class="active"{% endif %}><a
<li {% if request.path == url_for('admin.trusted') %}class="active"{% endif %}><a href="{{ url_for('admin.trusted') }}">Trusted</a></li> 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> </ul>
</li> </li>
{% endif %} {% endif %}
@ -118,12 +145,14 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
{% if g.user %} {% if g.user %}
<li class="dropdown"> <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"> <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> <i class="fa fa-user fa-fw"></i>
{{ g.user.username }} {{ g.user.username }}
<span class="caret"></span> <span class="caret"></span>
</a> </a>
<a href="#" class="dropdown-toggle hidden-lg hidden-sm hidden-xs" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> <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> <i class="fa fa-user fa-fw"></i>
<span class="caret"></span> <span class="caret"></span>
</a> </a>
@ -156,12 +185,14 @@
</li> </li>
{% else %} {% else %}
<li class="dropdown"> <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"> <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> <i class="fa fa-user fa-fw"></i>
Guest Guest
<span class="caret"></span> <span class="caret"></span>
</a> </a>
<a href="#" class="dropdown-toggle hidden-lg hidden-sm hidden-xs" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> <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> <i class="fa fa-user fa-fw"></i>
<span class="caret"></span> <span class="caret"></span>
</a> </a>
@ -182,73 +213,60 @@
</li> </li>
{% endif %} {% endif %}
</ul> </ul>
{% set nyaa_cats = [('1_0', 'Anime', 'Anime'), {% set used_cats = [('1_0', 'Books', 'Books'),
('1_1', '- Anime Music Video', 'Anime - AMV'), ('1_1', '- Fiction', 'Books - Fiction'),
('1_2', '- English-translated', 'Anime - English'), ('1_2', '- Non-Fiction', 'Books - Non-Fiction'),
('1_3', '- Non-English-translated', 'Anime - Non-English'), ('2_0', 'Media', 'Media'),
('1_4', '- Raw', 'Anime - Raw'), ('2_1', '- Audio', 'Media - Audio'),
('2_0', 'Audio', 'Audio'), ('2_2', '- Video', 'Media - Video'),
('2_1', '- Lossless', 'Audio - Lossless'), ('2_2', '- Images', 'Media - Images'),
('2_2', '- Lossy', 'Audio - Lossy'), ('3_0', 'Software', 'Software'),
('3_0', 'Literature', 'Literature'), ('3_1', '- Misc', 'Software - Misc'),
('3_1', '- English-translated', 'Literature - English'), ('3_2', '- Games', 'Software - Games'),
('3_2', '- Non-English-translated', 'Literature - Non-English'), ('4_0', 'NSFW', 'NSFW'),
('3_3', '- Raw', 'Literature - Raw'), ('4_1', '- Pictures', 'NSFW - Pictures'),
('4_0', 'Live Action', 'Live Action'), ('4_2', '- Videos', 'NSFW - Videos'),
('4_1', '- English-translated', 'Live Action - English'), ('4_2', '- Audio', 'NSFW - Audio'),
('4_2', '- Idol/Promotional Video', 'Live Action - Idol/PV'), ('5_0', 'Misc', 'Misc'),
('4_3', '- Non-English-translated', 'Live Action - Non-English'), ('5_1', '- Other', 'Misc - Other')] %}
('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'),
('1_1', '- Anime', 'Art - Anime'),
('1_2', '- Doujinshi', 'Art - Doujinshi'),
('1_3', '- Games', 'Art - Games'),
('1_4', '- Manga', 'Art - Manga'),
('1_5', '- Pictures', 'Art - Pictures'),
('2_0', 'Real Life', 'Real Life'),
('2_1', '- Photobooks and Pictures', 'Real Life - Pictures'),
('2_2', '- Videos', 'Real Life - Videos')]
%}
{% if config.SITE_FLAVOR == 'nyaa' %}
{% set used_cats = nyaa_cats %}
{% elif config.SITE_FLAVOR == 'sukebei' %}
{% set used_cats = suke_cats %}
{% endif %}
<div class="search-container visible-xs visible-sm"> <div class="search-container visible-xs visible-sm">
{# The mobile menu #} {# The mobile menu #}
{% if user_page %} {% if user_page %}
<form class="navbar-form navbar-right form" action="{{ url_for('users.view_user', user_name=user.username) }}" method="get"> <form class="navbar-form navbar-right form"
action="{{ url_for('users.view_user', user_name=user.username) }}" method="get">
{% else %} {% else %}
<form class="navbar-form navbar-right form" action="{{ url_for('main.home') }}" method="get"> <form class="navbar-form navbar-right form" action="{{ url_for('main.home') }}" method="get">
{% endif %} {% endif %}
<input type="text" class="form-control" name="q" placeholder="{{ search_placeholder }}" value="{{ search["term"] if search is defined else '' }}"> <input type="text" class="form-control" name="q" placeholder="{{ search_placeholder }}"
value="{{ search["term"] if search is defined else '' }}">
<br> <br>
<select class="form-control" title="Filter" data-width="120px" name="f"> <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="0" title="No filter"
<option value="1" title="No remakes" {% if search is defined and search["quality_filter"] == "1" %}selected{% endif %}>No remakes</option> {% if search is defined and search["quality_filter"] == "0" %}selected{% else %}selected{% endif %}>
<option value="2" title="Trusted only" {% if search is defined and search["quality_filter"] == "2" %}selected{% endif %}>Trusted only</option> 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>
<br> <br>
<select class="form-control" title="Category" data-width="200px" name="c"> <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 %}> <option value="0_0" title="All categories"
{% if search is defined and search["category"] == "0_0" %}selected{% else %}selected{% endif %}>
All categories All categories
</option> </option>
{% for cat_id, cat_name, cat_title in used_cats %} {% 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 %}> <option value="{{ cat_id }}" title="{{ cat_title }}"
{% if search is defined and search.category == cat_id %}selected{% endif %}>
{{ cat_name }} {{ cat_name }}
</option> </option>
{% endfor %} {% endfor %}
@ -263,16 +281,27 @@
</div><!--/.search-container --> </div><!--/.search-container -->
{% if user_page %} {% if user_page %}
<form class="navbar-form navbar-right form" action="{{ url_for('users.view_user', user_name=user.username) }}" method="get"> <form class="navbar-form navbar-right form hidden-xs hidden-sm"
action="{{ url_for('users.view_user', user_name=user.username) }}" method="get">
{% else %} {% else %}
<form class="navbar-form navbar-right form" action="{{ url_for('main.home') }}" method="get"> <form class="navbar-form navbar-right form hidden-xs hidden-sm" action="{{ url_for('main.home') }}"
method="get">
{% endif %} {% endif %}
<div class="input-group search-container hidden-xs hidden-sm"> <div class="input-group search-container">
<div class="input-group-btn nav-filter" id="navFilter-criteria"> <div class="input-group-btn nav-filter" id="navFilter-criteria">
<select class="selectpicker show-tick" title="Filter" data-width="120px" name="f"> <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="0" title="No filter"
<option value="1" title="No remakes" {% if search is defined and search["quality_filter"] == "1" %}selected{% endif %}>No remakes</option> {% if search is defined and search["quality_filter"] == "0" %}selected{% else %}selected{% endif %}>
<option value="2" title="Trusted only" {% if search is defined and search["quality_filter"] == "2" %}selected{% endif %}>Trusted only</option> 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>
</div> </div>
@ -294,17 +323,20 @@
</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"
{% if search is defined and search["category"] == "0_0" %}selected{% else %}selected{% endif %}>
All categories All categories
</option> </option>
{% for cat_id, cat_name, cat_title in used_cats %} {% 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 %}> <option value="{{ cat_id }}" title="{{ cat_title }}"
{% if search is defined and search.category == cat_id %}selected{% endif %}>
{{ cat_name }} {{ cat_name }}
</option> </option>
{% endfor %} {% endfor %}
</select> </select>
</div> </div>
<input type="text" class="form-control search-bar" name="q" placeholder="{{ search_placeholder }}" value="{{ search['term'] if search is defined else '' }}" /> <input type="text" class="form-control search-bar" name="q" placeholder="{{ search_placeholder }}"
value="{{ search['term'] if search is defined else '' }}"/>
<div class="input-group-btn search-btn"> <div class="input-group-btn search-btn">
<button class="btn btn-primary" type="submit"> <button class="btn btn-primary" type="submit">
<i class="fa fa-search fa-fw"></i> <i class="fa fa-search fa-fw"></i>
@ -314,9 +346,9 @@
</form> </form>
</div><!--/.nav-collapse --> </div><!--/.nav-collapse -->
</div><!--/.container --> </div><!--/.container -->
</nav> </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">
@ -326,13 +358,13 @@
{% 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 %}