diff --git a/config.example.py b/config.example.py deleted file mode 100644 index 253cb06..0000000 --- a/config.example.py +++ /dev/null @@ -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 ' - -# 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_" diff --git a/db_create.py b/db_create.py index 30fe4fe..0ec693c 100755 --- a/db_create.py +++ b/db_create.py @@ -7,18 +7,14 @@ from nyaa.extensions import db app = create_app('config') NYAA_CATEGORIES = [ - ('Anime', ['Anime Music Video', 'English-translated', 'Non-English-translated', 'Raw']), - ('Audio', ['Lossless', 'Lossy']), - ('Literature', ['English-translated', 'Non-English-translated', 'Raw']), - ('Live Action', ['English-translated', 'Idol/Promotional Video', 'Non-English-translated', 'Raw']), - ('Pictures', ['Graphics', 'Photos']), - ('Software', ['Applications', 'Games']), + ('Books', ['Fiction', 'Non-Fiction']), + ('Media', ['Audio', 'Video', 'Images']), + ('Software', ['Misc', 'Games']), + ('NSFW', ['Pictures', 'Videos', 'Audio']), + ('Misc', ['Other']), ] - 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) for i, sub_cat_name in enumerate(sub_cat_names): # 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) diff --git a/nyaa/static/css/main.css b/nyaa/static/css/main.css index 0ecd081..a8393d2 100644 --- a/nyaa/static/css/main.css +++ b/nyaa/static/css/main.css @@ -1,442 +1,448 @@ .panel-heading-collapse a:after { - font-family:'Glyphicons Halflings'; - content:"\e114"; - float: right; - color: grey; + font-family: 'Glyphicons Halflings'; + content: "\e114"; + float: right; + color: grey; } .panel-heading-collapse a.collapsed:after { - content:"\e080"; + content: "\e080"; } .torrent-list > tbody > tr > td { - vertical-align: middle; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - max-width: 603px; /*Will this break something?*/ + vertical-align: middle; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 603px; /*Will this break something?*/ } table.torrent-list thead th { - position: relative; - background-image: none !important; + position: relative; + background-image: none !important; } table.torrent-list thead th a { - position: absolute; - width: 100%; - height: 100%; - top: 0; - left: 0; - text-decoration: none; - z-index: 10; - /* IE Workaround */ - background-color: white; - opacity: 0; - filter: alpha(opacity=1); + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; + text-decoration: none; + z-index: 10; + /* IE Workaround */ + background-color: white; + opacity: 0; + filter: alpha(opacity=1); } .category-icon { - width: 80px; - height: 28px; + width: 80px; + height: 28px; } table.torrent-list thead th.sorting:after, table.torrent-list thead th.sorting_asc:after, table.torrent-list thead th.sorting_desc:after { - position: absolute; - top: 12px; - right: 8px; - display: block; - font-family: FontAwesome; + position: absolute; + top: 12px; + right: 8px; + display: block; + font-family: FontAwesome; } table.torrent-list thead th.sorting:after { - content: "\f0dc"; - color: #808080; - font-size: 0.85em; + content: "\f0dc"; + color: #808080; + font-size: 0.85em; } table.torrent-list thead th.sorting_asc:after { - content: "\f0de"; + content: "\f0de"; } table.torrent-list thead th.sorting_desc:after { - content: "\f0dd"; + content: "\f0dd"; } table.torrent-list tbody tr td a:visited { - color: #1d4568; + color: #1d4568; } /* comments count */ table.torrent-list .hdr-comments { - border-left: hidden; - font-size: medium; + border-left: hidden; + font-size: medium; } table.torrent-list .hdr-comments i { - margin-right: 6px; + margin-right: 6px; } table.torrent-list tbody .comments { - position: relative; - float: right; - border: 1px solid #d7d7d7; - border-radius: 3px; - color: #383838; - padding: 0 5px; - font-size: small; - background-color: #ffffff; + position: relative; + float: right; + border: 1px solid #d7d7d7; + border-radius: 3px; + color: #383838; + padding: 0 5px; + font-size: small; + background-color: #ffffff; } + table.torrent-list tbody .comments i { - padding-right: 2px; + padding-right: 2px; } table.torrent-list td:first-child { - padding: 0 4px; + padding: 0 4px; } + table.torrent-list td:nth-child(4) { - white-space: nowrap; + white-space: nowrap; } + 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.danger > td:nth-child(6) { - color: green; + color: green; } + 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: red; + color: red; } #torrent-description img { - max-width: 100%; + max-width: 100%; } .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 { - background-color:#bdbdbd; + background-color: #bdbdbd; } .panel-deleted { - border-color:#757575; + border-color: #757575; } .panel-deleted > .panel-heading { - color:#212121; - background-color:#9e9e9e; - border-color:#757575; + color: #212121; + background-color: #9e9e9e; + border-color: #757575; } .panel-deleted > .panel-heading + .panel-collapse > .panel-body { - border-top-color:#757575; + border-top-color: #757575; } .panel-deleted > .panel-heading .badge { - color:#9e9e9e; - background-color:#212121; + color: #9e9e9e; + background-color: #212121; } .panel-deleted > .panel-footer + .panel-collapse > .panel-body { - border-bottom-color:#757575; + border-bottom-color: #757575; } .markdown-editor label { - padding: 1em 0; + padding: 1em 0; } .markdown-source { - min-height: 360px; + min-height: 360px; } .search-container { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-orient: vertical; - -webkit-box-direction: normal; - -ms-flex-direction: column; - flex-direction: column; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; } .search-container > .search-bar { - border-left: 0; + border-left: 0; } #navFilter-criteria > .bootstrap-select:first-child { - border-right: solid 1px; + border-right: solid 1px; } #navFilter-criteria > .bootstrap-select:first-child > button { - /* !important is used here to override the programmatically added style on element */ - border-top-left-radius: 4px !important; - border-bottom-left-radius: 4px !important; + /* !important is used here to override the programmatically added style on element */ + border-top-left-radius: 4px !important; + border-bottom-left-radius: 4px !important; } .form-control.search-bar { - -webkit-box-ordinal-group: 4; - -ms-flex-order: 3; - order: 3; - width: 99%; - padding-right: 1em; - border-left: 0; + -webkit-box-ordinal-group: 4; + -ms-flex-order: 3; + order: 3; + width: 99%; + padding-right: 1em; + border-left: 0; } .search-btn { - -webkit-box-ordinal-group: 5; - -ms-flex-order: 4; - order: 4; - -ms-flex-item-align: end; - align-self: flex-end; - top: -34px; - height: 0; - width: auto; - z-index: 3; + -webkit-box-ordinal-group: 5; + -ms-flex-order: 4; + order: 4; + -ms-flex-item-align: end; + align-self: flex-end; + top: -34px; + height: 0; + width: auto; + z-index: 3; } #navFilter-criteria { - -webkit-box-ordinal-group: 2; - -ms-flex-order: 1; - order: 1; + -webkit-box-ordinal-group: 2; + -ms-flex-order: 1; + order: 1; } #navFilter-category { - -webkit-box-ordinal-group: 3; - -ms-flex-order: 2; - order: 2; + -webkit-box-ordinal-group: 3; + -ms-flex-order: 2; + order: 2; } .nav-filter { - width: 100%; - padding: 1em 0; + width: 100%; + padding: 1em 0; } .bootstrap-select > button { - margin-top: 1em; + margin-top: 1em; } /* Allows the bootstrap selects on nav show outside the collapsible section of the navigation */ .navbar-collapse.in { - overflow-y: visible; + overflow-y: visible; } /* Upload page drop zone */ -#upload-drop-zone -{ - visibility: hidden; - opacity: 0; - position: absolute; - top: 0; - left: 0; - z-index: 9999999999; - width: 100%; - height: 100%; - background-color: rgba(0, 0, 0, 0.5); - transition: visibility 175ms, opacity 175ms; - display: table; - text-shadow: 1px 1px 2px #000; - color: #fff; - background: rgba(0, 0, 0, 0.45); - font: bold 42px Tahoma, sans-serif; +#upload-drop-zone { + visibility: hidden; + opacity: 0; + position: absolute; + top: 0; + left: 0; + z-index: 9999999999; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); + transition: visibility 175ms, opacity 175ms; + display: table; + text-shadow: 1px 1px 2px #000; + color: #fff; + background: rgba(0, 0, 0, 0.45); + font: bold 42px Tahoma, sans-serif; } -#upload-drop-zone span -{ - display: table-cell; - text-align: center; - vertical-align: middle; - transition: font-size 175ms; +#upload-drop-zone span { + display: table-cell; + text-align: center; + vertical-align: middle; + transition: font-size 175ms; } /* elasticsearch term highlight */ .hlt1 { - font-style: normal; - display: inline-block; - padding: 0 3px; - border-radius: 3px; - border: 1px solid rgba(100, 56, 0, 0.8); - background: rgba(200,127,0,0.3); + font-style: normal; + display: inline-block; + padding: 0 3px; + border-radius: 3px; + border: 1px solid rgba(100, 56, 0, 0.8); + background: rgba(200, 127, 0, 0.3); } ul.nav-tabs#profileTabs { - margin-bottom: 15px; + margin-bottom: 15px; } .comment-panel { - width: 99%; - margin: 0 auto; - margin-top: 10px; - margin-bottom: 10px; + width: 99%; + margin: 0 auto; + margin-top: 10px; + margin-bottom: 10px; } + .comment-panel .panel-body { - padding-top: 10px; - padding-bottom: 10px; + padding-top: 10px; + padding-bottom: 10px; } + .comment-panel .col-md-2 p { - margin-bottom: 5px; + margin-bottom: 5px; } + .comment-panel:target { - border-color: black; - border-width: 2px; + border-color: black; + border-width: 2px; } .text-purple, a.text-purple:visited { - color: #a760bc; + color: #a760bc; } a.text-purple:hover, a.text-purple:active, a.text-purple:focus { - color: #a760e0; + color: #a760e0; } .comment-details { - margin-bottom: 10px; + margin-bottom: 10px; } /* workaround for Mozilla whitespace copypaste dumbfuckery */ .comment-body { - -moz-user-select: text; + -moz-user-select: text; } .comment-content { - overflow-wrap: break-word; + overflow-wrap: break-word; } + .comment-content img { - max-width: 100%; - max-height: 600px; + max-width: 100%; + max-height: 600px; } .comment-box { - width: 95%; - margin: 0 auto; - margin-top: 30px; - margin-bottom: 10px; + width: 95%; + margin: 0 auto; + margin-top: 30px; + margin-bottom: 10px; } .comment-actions { - position: relative; - float: right; + position: relative; + float: right; } .delete-comment-form { - display: inline-block; + display: inline-block; } .edit-comment-box { - display: none; + display: none; } .is-editing .edit-comment-box { - display: block; + display: block; } .is-editing .comment-content { - display: none; + display: none; } .edit-waiting { - float: right; - width: 20px; - height: 20px; - border: 2px solid; - border-color: gray transparent; - border-radius: 100%; - position: relative; - top: 4px; - animation: fa-spin 1s infinite linear; + float: right; + width: 20px; + height: 20px; + border: 2px solid; + border-color: gray transparent; + border-radius: 100%; + position: relative; + top: 4px; + animation: fa-spin 1s infinite linear; } #comment { - height: 8em; + height: 8em; } .avatar { - max-width: 120px; + max-width: 120px; } .btn-grey { - color: #000000; - background-color: #cccfd2; - border-color: #ccc; + color: #000000; + background-color: #cccfd2; + border-color: #ccc; } .btn-grey:hover, .btn-grey:focus, .btn-grey:active, .btn-grey.active, .open > .dropdown-toggle.btn-grey { - background-color: #aaaaaa; + background-color: #aaaaaa; } .btn span.glyphicon-check { - display: none; + display: none; } .btn.active span.glyphicon-check { - display: inline; + display: inline; } .btn span.glyphicon-unchecked { - display: inline; + display: inline; } .btn.active span.glyphicon-unchecked { - display: none; + display: none; } .center { - float: none; - margin: 0 auto; - text-align: center; + float: none; + margin: 0 auto; + text-align: center; } .strike { - text-decoration: line-through; + text-decoration: line-through; } /* Torrent file list */ .torrent-file-list ul { - padding: 5px 20px 0px 20px; - list-style: none; - display: none; + padding: 5px 20px 0px 20px; + list-style: none; + display: none; } .torrent-file-list > ul { - display: block; /* First level always visible */ - padding: 0; - margin: 0; + display: block; /* First level always visible */ + padding: 0; + margin: 0; } .torrent-file-list ul[data-show] { - /* Used to show first level's items based on amount */ - display: block; + /* Used to show first level's items based on amount */ + display: block; } .torrent-file-list li:not(:last-of-type) { - margin-bottom: 5px; + margin-bottom: 5px; } .torrent-file-list i.fa { - padding-right: 5px; + padding-right: 5px; } .torrent-file-list i.fa-folder-open { - padding-right: 3px; + padding-right: 3px; } .torrent-file-list a.folder { - font-weight: bold; - text-decoration: none; + font-weight: bold; + text-decoration: none; } .torrent-file-list .file-size { - font-weight: bold; + font-weight: bold; } .header-anchor { - padding-left: 0.5em; - visibility: hidden; - display: none; + padding-left: 0.5em; + visibility: hidden; + display: none; } h1:hover .header-anchor, @@ -445,238 +451,336 @@ h3:hover .header-anchor, h4:hover .header-anchor, h5:hover .header-anchor, h6:hover .header-anchor { - visibility: visible; - display: inline-block; + visibility: visible; + display: inline-block; } + .trusted-form textarea { - height:12em; + height: 12em; } /* Dark theme */ body.dark { - color: #afafaf; + color: #afafaf; } body.dark .navbar a { - color: #e2e2e2; + color: #e2e2e2; } body.dark kbd, body.dark .btn.edit-comment { - background-color: #4a4a4a; + background-color: #4a4a4a; } body.dark .alert-info { - color: #94ceff; /* == bg-color in light theme */ - background-color: #185586; - border-color: #247fcc; + color: #94ceff; /* == bg-color in light theme */ + background-color: #185586; + border-color: #247fcc; } body.dark .alert-info a:hover { - color: #4d9ee0; + color: #4d9ee0; } body.dark .torrent-list tbody tr td a:visited { - color: #205c90; + color: #205c90; } body.dark thead > tr, body.dark tbody > tr, body.dark .panel > .panel-heading, body.dark .report-action-column select { - color: #cbcbcb; + color: #cbcbcb; } body.dark .table-striped > tbody > tr:nth-of-type(odd) { - background-color: #363636; /* less pronounced striping effect */ + background-color: #363636; /* less pronounced striping effect */ } body.dark .table-hover > tbody > tr:hover { - background-color: rgba(255, 255, 255, 0.2); + background-color: rgba(255, 255, 255, 0.2); } body.dark .table-bordered > thead:first-child > tr:first-child > th, body.dark .table-bordered > tbody > tr > td { - border: 1px solid #212121; + border: 1px solid #212121; } body.dark table.torrent-list tbody .comments { - border-color: #212121; - color: #247fcc; - background-color: #2f2c2c; + border-color: #212121; + color: #247fcc; + background-color: #2f2c2c; } body.dark .comment-panel:target { - border-color: white; + border-color: white; } body.dark .table > table { - background-color: #323232; + background-color: #323232; } /* trusted */ body.dark .torrent-list > tbody > tr.success > td { - color: inherit; - background-color: rgba(60, 206, 0, 0.12); + color: inherit; + background-color: rgba(60, 206, 0, 0.12); } + 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 > .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 { - background-color: #56704b; /* == trusted entry in torrent list + hover */ + background-color: #56704b; /* == trusted entry in torrent list + hover */ } /* remake */ body.dark .torrent-list > tbody > tr.danger > td { - color: inherit; - background-color: rgba(208, 0, 0, 0.12); + color: inherit; + background-color: rgba(208, 0, 0, 0.12); } + body.dark .torrent-list > tbody > tr.danger:hover > td { - color: inherit; - background-color: rgba(208, 0, 0, 0.18); + color: inherit; + background-color: rgba(208, 0, 0, 0.18); } + body.dark div.panel-danger, 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 { - background-color: #714b4b; /* == remake entry in torrent list + hover */ + background-color: #714b4b; /* == remake entry in torrent list + hover */ } /* deleted */ 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 { - background-color: rgba(255, 255, 255, 0.26); + background-color: rgba(255, 255, 255, 0.26); } + body.dark .panel-deleted > .panel-heading { - color: #232323; + color: #232323; } @media (max-width: 991px) { - .panel-body .col-md-5 { - margin-left: 20px; - margin-bottom: 10px; - } + .panel-body .col-md-5 { + margin-left: 20px; + margin-bottom: 10px; + } - #navFilter-criteria > .bootstrap-select:first-child > button { - /* !important is used here to override the programmatically added style on element */ - border-top-left-radius: 0 !important; - border-bottom-left-radius: 0 !important; - } + #navFilter-criteria > .bootstrap-select:first-child > button { + /* !important is used here to override the programmatically added style on element */ + border-top-left-radius: 0 !important; + border-bottom-left-radius: 0 !important; + } - .search-container > .search-bar { - margin-top: 15px; - } + .search-container > .search-bar { + margin-top: 15px; + } - .torrent-list .hdr-date, - .torrent-list .hdr-downloads, - .torrent-list td: nth-of-type(5), - .torrent-list td:nth-of-type(8) { - display: none; - } + .torrent-list .hdr-date, + .torrent-list .hdr-downloads, + .torrent-list td: - .table-responsive > .table > tbody > tr > td:nth-of-type(2) { - white-space: unset; - word-break: break-all; - } - - .container { - width: unset; - } +nth-of-type(5), + .torrent-list td:nth-of-type(8) { + display: none; + } - .container > .row { - margin: unset; - } + .table-responsive > .table > tbody > tr > td:nth-of-type(2) { + white-space: unset; + word-break: break-all; + } + + .container { + width: unset; + } + + .container > .row { + margin: unset; + } } @media (min-width: 992px) { - .panel-body .col-md-5 { - word-wrap: break-word; - } + .panel-body .col-md-5 { + word-wrap: break-word; + } - .search-btn { - top: 0; - width: auto; - } + .search-btn { + top: 0; + width: auto; + } - .bootstrap-select > button { - margin-top: auto; - } + .bootstrap-select > button { + margin-top: auto; + } } table.table > tbody > tr.reports-row > td { - vertical-align: middle; + vertical-align: middle; } td.report-action-column { - min-width: 150px; + min-width: 150px; } @media (min-width: 992px) and (max-width: 1199px) { - /* Collapse navbar search form so it doesn't wrap to a new line */ - .search-container { - width: 400px; - } + /* Collapse navbar search form so it doesn't wrap to a new line */ + .search-container { + width: 400px; + } - .table-responsive > .table > tbody > tr > td:nth-of-type(2) { - white-space: unset; - } + .table-responsive > .table > tbody > tr > td:nth-of-type(2) { + white-space: unset; + } } /* Override
font size (assume main.css comes after bootstrap) */ blockquote { - font-size: inherit; + font-size: inherit; } /* Hide and resize some things on tiny screens to improve usability. */ @media (max-width: 767px) { - .hdr-size, .hdr-date, .hdr-downloads, - table.torrent-list > tbody > tr > td:nth-child(4), - table.torrent-list > tbody > tr > td:nth-child(5), - table.torrent-list > tbody > tr > td:nth-child(8) { - display: none; - } + .hdr-size, .hdr-date, .hdr-downloads, + table.torrent-list > tbody > tr > td:nth-child(4), + table.torrent-list > tbody > tr > td:nth-child(5), + table.torrent-list > tbody > tr > td:nth-child(8) { + display: none; + } - table.torrent-list > tbody > tr > td:nth-child(7) { - border-right: 0; - } + table.torrent-list > tbody > tr > td:nth-child(7) { + border-right: 0; + } - .table thead > tr > th { - border-right: none; - } + .table thead > tr > th { + border-right: none; + } - table.torrent-list > tbody > tr > td:nth-child(3) > a { - display: block; - } + table.torrent-list > tbody > tr > td:nth-child(3) > a { + display: block; + } - .hdr-link { - width: 32px !important; - } + .hdr-link { + width: 32px !important; + } - .hdr-seeders, .hdr-leechers { - width: 48px !important; - } + .hdr-seeders, .hdr-leechers { + width: 48px !important; + } - .hdr-category { - width: 20px !important; - overflow: hidden; - text-indent: -9999px; - } + .hdr-category { + width: 20px !important; + overflow: hidden; + text-indent: -9999px; + } - table.torrent-list > tbody > tr > td:first-child { - overflow: hidden; - } + table.torrent-list > tbody > tr > td:first-child { + overflow: hidden; + } - table.torrent-list > tbody > tr > td:first-child img { - width: 50px; - height: auto; - } + table.torrent-list > tbody > tr > td:first-child img { + width: 50px; + 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; } diff --git a/nyaa/static/img/icons/nyaa/1_1.png b/nyaa/static/img/icons/nyaa/1_1.png old mode 100644 new mode 100755 index b25c560..ebb4054 Binary files a/nyaa/static/img/icons/nyaa/1_1.png and b/nyaa/static/img/icons/nyaa/1_1.png differ diff --git a/nyaa/static/img/icons/nyaa/1_2.png b/nyaa/static/img/icons/nyaa/1_2.png old mode 100644 new mode 100755 index 2580af5..d1308ef Binary files a/nyaa/static/img/icons/nyaa/1_2.png and b/nyaa/static/img/icons/nyaa/1_2.png differ diff --git a/nyaa/static/img/icons/nyaa/1_3.png b/nyaa/static/img/icons/nyaa/1_3.png deleted file mode 100644 index b5aec84..0000000 Binary files a/nyaa/static/img/icons/nyaa/1_3.png and /dev/null differ diff --git a/nyaa/static/img/icons/nyaa/1_4.png b/nyaa/static/img/icons/nyaa/1_4.png deleted file mode 100644 index a5750bc..0000000 Binary files a/nyaa/static/img/icons/nyaa/1_4.png and /dev/null differ diff --git a/nyaa/static/img/icons/nyaa/2_1.png b/nyaa/static/img/icons/nyaa/2_1.png old mode 100644 new mode 100755 index 3aef4ac..633f3ce Binary files a/nyaa/static/img/icons/nyaa/2_1.png and b/nyaa/static/img/icons/nyaa/2_1.png differ diff --git a/nyaa/static/img/icons/nyaa/2_2.png b/nyaa/static/img/icons/nyaa/2_2.png old mode 100644 new mode 100755 index a45d97b..92ee865 Binary files a/nyaa/static/img/icons/nyaa/2_2.png and b/nyaa/static/img/icons/nyaa/2_2.png differ diff --git a/nyaa/static/img/icons/nyaa/2_3.png b/nyaa/static/img/icons/nyaa/2_3.png new file mode 100755 index 0000000..abe497b Binary files /dev/null and b/nyaa/static/img/icons/nyaa/2_3.png differ diff --git a/nyaa/static/img/icons/nyaa/3_1.png b/nyaa/static/img/icons/nyaa/3_1.png old mode 100644 new mode 100755 index d78a910..7b65622 Binary files a/nyaa/static/img/icons/nyaa/3_1.png and b/nyaa/static/img/icons/nyaa/3_1.png differ diff --git a/nyaa/static/img/icons/nyaa/3_2.png b/nyaa/static/img/icons/nyaa/3_2.png old mode 100644 new mode 100755 index ce38885..3e36ae5 Binary files a/nyaa/static/img/icons/nyaa/3_2.png and b/nyaa/static/img/icons/nyaa/3_2.png differ diff --git a/nyaa/static/img/icons/nyaa/3_3.png b/nyaa/static/img/icons/nyaa/3_3.png deleted file mode 100644 index 9d78c05..0000000 Binary files a/nyaa/static/img/icons/nyaa/3_3.png and /dev/null differ diff --git a/nyaa/static/img/icons/nyaa/4_1.png b/nyaa/static/img/icons/nyaa/4_1.png old mode 100644 new mode 100755 index 54bafbc..0108ea4 Binary files a/nyaa/static/img/icons/nyaa/4_1.png and b/nyaa/static/img/icons/nyaa/4_1.png differ diff --git a/nyaa/static/img/icons/nyaa/4_2.png b/nyaa/static/img/icons/nyaa/4_2.png old mode 100644 new mode 100755 index 7863b0e..ef32d90 Binary files a/nyaa/static/img/icons/nyaa/4_2.png and b/nyaa/static/img/icons/nyaa/4_2.png differ diff --git a/nyaa/static/img/icons/nyaa/4_3.png b/nyaa/static/img/icons/nyaa/4_3.png old mode 100644 new mode 100755 index 1637f81..07dd334 Binary files a/nyaa/static/img/icons/nyaa/4_3.png and b/nyaa/static/img/icons/nyaa/4_3.png differ diff --git a/nyaa/static/img/icons/nyaa/4_4.png b/nyaa/static/img/icons/nyaa/4_4.png deleted file mode 100644 index 4fdda69..0000000 Binary files a/nyaa/static/img/icons/nyaa/4_4.png and /dev/null differ diff --git a/nyaa/static/img/icons/nyaa/5_1.png b/nyaa/static/img/icons/nyaa/5_1.png old mode 100644 new mode 100755 index 8ac0fe6..844ae7b Binary files a/nyaa/static/img/icons/nyaa/5_1.png and b/nyaa/static/img/icons/nyaa/5_1.png differ diff --git a/nyaa/static/img/icons/nyaa/5_2.png b/nyaa/static/img/icons/nyaa/5_2.png deleted file mode 100644 index 0a6ba5c..0000000 Binary files a/nyaa/static/img/icons/nyaa/5_2.png and /dev/null differ diff --git a/nyaa/static/img/icons/nyaa/6_1.png b/nyaa/static/img/icons/nyaa/6_1.png deleted file mode 100644 index 79fe8e5..0000000 Binary files a/nyaa/static/img/icons/nyaa/6_1.png and /dev/null differ diff --git a/nyaa/static/img/icons/nyaa/6_2.png b/nyaa/static/img/icons/nyaa/6_2.png deleted file mode 100644 index 6ceba49..0000000 Binary files a/nyaa/static/img/icons/nyaa/6_2.png and /dev/null differ diff --git a/nyaa/templates/bootstrap/pagination.html b/nyaa/templates/bootstrap/pagination.html index fb6b747..1170a61 100644 --- a/nyaa/templates/bootstrap/pagination.html +++ b/nyaa/templates/bootstrap/pagination.html @@ -28,9 +28,9 @@ {# prev and next are only show if a symbol has been passed. #} {% if prev != None -%} {% if pagination.has_prev %} -
  • +
  • {% else %} -
  • {{prev}}
  • +
  • {% endif %} {%- endif -%} @@ -48,9 +48,9 @@ {% if next != None -%} {% if pagination.has_next %} -
  • +
  • {% else %} -
  • {{next}}
  • +
  • {% endif %} {%- endif -%} diff --git a/nyaa/templates/edit.html b/nyaa/templates/edit.html index b6d55ef..f63ac59 100644 --- a/nyaa/templates/edit.html +++ b/nyaa/templates/edit.html @@ -95,7 +95,7 @@
    -
    +

    Danger Zone

    diff --git a/nyaa/templates/layout.html b/nyaa/templates/layout.html index 029b1e3..7310bf9 100644 --- a/nyaa/templates/layout.html +++ b/nyaa/templates/layout.html @@ -1,287 +1,316 @@ - - - {% block title %}{{ config.SITE_NAME }}{% endblock %} + + + {% block title %}{{ config.SITE_NAME }}{% endblock %} - - - - - - + + + + + + - - - - {% block metatags %} - {# Filled by children #} - {% endblock %} + + + + {% block metatags %} + {# Filled by children #} + {% endblock %} - - - {# These are extracted here for the dark mode toggle #} - {% set bootstrap_light = static_cachebuster('css/bootstrap.min.css') %} - {% set bootstrap_dark = static_cachebuster('css/bootstrap-dark.min.css') %} - - - - - - + + + {# These are extracted here for the dark mode toggle #} + {% set bootstrap_light = static_cachebuster('css/bootstrap.min.css') %} + {% set bootstrap_dark = static_cachebuster('css/bootstrap-dark.min.css') %} + + + + - - - - {% assets "bs_js" %} - - {% endassets %} - {% assets "main_js" %} - - {% endassets %} + 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() + } + + - {% if config.SITE_FLAVOR == 'nyaa' %} - - {% elif config.SITE_FLAVOR == 'sukebei' %} - - {% endif %} - - - -
    +
    + -
    - {% include "flashes.html" %} - {% if config.MAINTENANCE_MODE and config.MAINTENANCE_MODE_MESSAGE %} - - {% endif %} +
    + {% include "flashes.html" %} + {% if config.MAINTENANCE_MODE and config.MAINTENANCE_MODE_MESSAGE %} + + {% endif %} - {% block body %}{% endblock %} -
    + {% block body %}{% endblock %} +
    - - +{# #} + diff --git a/nyaa/templates/search_results.html b/nyaa/templates/search_results.html index 76ac131..536eec4 100644 --- a/nyaa/templates/search_results.html +++ b/nyaa/templates/search_results.html @@ -19,7 +19,7 @@ {% if (use_elastic and torrent_query.hits.total.value > 0) or (torrent_query.items) %}
    - +
    {%+ call render_column_header("hdr-category", "width:80px;", center_text=True) -%} @@ -58,7 +58,7 @@ {% set icon_dir = config.SITE_FLAVOR %} {% set torrents = torrent_query if use_elastic else torrent_query.items %} {% for torrent in torrents %} - + {% set cat_id = use_elastic and ((torrent.main_category_id|string) + '_' + (torrent.sub_category_id|string)) or torrent.sub_category.id_as_string %}
    {% if use_elastic %} diff --git a/nyaa/templates/upload.html b/nyaa/templates/upload.html index 1ca14a7..d3e5e9d 100644 --- a/nyaa/templates/upload.html +++ b/nyaa/templates/upload.html @@ -18,7 +18,7 @@ {{ upload_form.csrf_token }} {% if config.ENFORCE_MAIN_ANNOUNCE_URL %}

    Important: Please include {{ config.MAIN_ANNOUNCE_URL }} in your trackers.

    {% endif %} -

    Important: Make sure you have read the rules before uploading!

    +{#

    Important: Make sure you have read the rules before uploading!

    #}
    {% if show_ratelimit %}