From f0b20cad5575920bc7fc86980345629cb327e637 Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 30 Dec 2022 14:14:18 +0200 Subject: [PATCH] the worst fucking code you'll ever see --- files/assets/css/main.css | 3 +- files/assets/event/css/blizzard.css | 2 +- files/assets/js/award_modal.js | 8 + files/assets/js/bottom.js | 105 ++++++++++ files/assets/js/comments.js | 5 +- files/assets/js/core.js | 15 +- files/assets/js/emoji_modal.js | 13 +- files/assets/js/settings_security.js | 2 + files/assets/js/signup.js | 5 + files/assets/js/top.js | 1 + files/classes/submission.py | 2 +- files/routes/allroutes.py | 8 +- files/templates/admin/admin_home.html | 6 +- files/templates/admin/alt_votes.html | 4 +- files/templates/admin/alts.html | 12 +- files/templates/admin/app.html | 6 +- files/templates/admin/apps.html | 6 +- files/templates/admin/badge_admin.html | 2 +- files/templates/admin/banned_domains.html | 6 +- files/templates/admin/edit_rules.html | 2 +- files/templates/app.html | 4 +- files/templates/casino/blackjack_screen.html | 10 +- files/templates/casino/game_screen.html | 2 +- files/templates/comments.html | 182 +++++++++--------- files/templates/contact.html | 6 +- files/templates/errors/nsfw.html | 2 +- files/templates/hats.html | 8 +- files/templates/header.html | 10 +- files/templates/home.html | 12 +- files/templates/log.html | 2 +- files/templates/login/forgot_password.html | 2 +- files/templates/login/lost_2fa.html | 2 +- files/templates/login/reset_password.html | 2 +- files/templates/login/sign_up.html | 2 +- files/templates/modals/award.html | 8 +- files/templates/modals/emoji.html | 4 +- files/templates/modals/gif.html | 2 +- files/templates/notifications.html | 4 +- files/templates/oauth.html | 2 +- files/templates/post_actions.html | 64 +++--- files/templates/post_actions_mobile.html | 40 ++-- .../templates/post_admin_actions_mobile.html | 30 +-- files/templates/root.html | 7 +- files/templates/search.html | 16 +- files/templates/settings/advanced.html | 14 +- files/templates/settings/apps.html | 10 +- files/templates/settings/common.html | 16 +- files/templates/settings/css.html | 4 +- files/templates/settings/personal.html | 20 +- files/templates/settings/security.html | 28 +-- files/templates/shop.html | 4 +- files/templates/sidebar_WPD.html | 4 +- files/templates/sidebar_rDrama.html | 6 +- files/templates/sub/exilees.html | 2 +- files/templates/sub/mods.html | 6 +- files/templates/sub/settings.html | 16 +- files/templates/submission.html | 40 ++-- files/templates/submission_listing.html | 36 ++-- files/templates/submit.html | 30 +-- files/templates/submit_hats.html | 6 +- files/templates/submit_marseys.html | 6 +- files/templates/update_assets.html | 2 +- files/templates/user_listing.html | 4 +- files/templates/userpage/admintools.html | 46 ++--- files/templates/userpage/banner.html | 98 +++++----- files/templates/userpage/blocking.html | 2 +- files/templates/userpage/followers.html | 2 +- files/templates/userpage/following.html | 2 +- files/templates/util/macros.html | 24 +-- 69 files changed, 594 insertions(+), 470 deletions(-) create mode 100644 files/assets/js/bottom.js create mode 100644 files/assets/js/top.js diff --git a/files/assets/css/main.css b/files/assets/css/main.css index 098b4ccd1..324d6a32a 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -4901,7 +4901,6 @@ video { color: var(--primary); display: inline-block; cursor: pointer; - height: 100%; width: 10px; content: "\f056"; position: static; @@ -5022,7 +5021,7 @@ code { .noshadow { box-shadow: none !important; } -[role="button"], :not(textarea)[onclick], th { +[role="button"], :not(textarea)[onclick], :not(textarea)[data-onclick], th { cursor: pointer !important; } diff --git a/files/assets/event/css/blizzard.css b/files/assets/event/css/blizzard.css index 9584995aa..78690a5af 100644 --- a/files/assets/event/css/blizzard.css +++ b/files/assets/event/css/blizzard.css @@ -247,7 +247,7 @@ body { background-color: #235E6F; } - #snow { + #snow:not([data-nonce]) { height: 100%; color: #FFF; display: block; diff --git a/files/assets/js/award_modal.js b/files/assets/js/award_modal.js index daf63f8d1..a45f5b27f 100644 --- a/files/assets/js/award_modal.js +++ b/files/assets/js/award_modal.js @@ -165,3 +165,11 @@ function giveaward(t) { } ); } + +const data_url = document.querySelectorAll('[data-url]'); +for (const element of data_url) { + if (element.dataset.nonce != nonce) continue + element.onclick = () => { + document.getElementById('giveaward').dataset.action = element.dataset.url + }; +} diff --git a/files/assets/js/bottom.js b/files/assets/js/bottom.js new file mode 100644 index 000000000..cccca24aa --- /dev/null +++ b/files/assets/js/bottom.js @@ -0,0 +1,105 @@ +function execute(element, attr) { + if (element.dataset.nonce != nonce) return + const funcs = element.getAttribute(`data-${attr}`).split(';') + for (const func of funcs) { + if (func) { + const split = func.split('(') + const name = split[0] + const args = split[1].replace(/[' )]/g, "").split(',') + if (args[0] == 'this') args[0] = element + try { + window[name](...args); + } + catch (e) { + console.log(name) + } + } + } +} + +document.addEventListener("click", function(e){ + const element = e.target + if (element instanceof HTMLImageElement && element.alt.startsWith('![](')) + expandImage() + else if (element.tagName == "TH") + sort_table(element) + else if (element.classList.contains('giphy')) + insertGIF(e.target.src); + else if (element.classList.contains('gif-cat-overlay')) + searchGifs(e.target.firstElementChild.innerHTML); + else if (element.dataset.onclick) + execute(element, 'onclick'); + else if (element.dataset.href) + location.href = element.dataset.href; + + if (element.dataset.toggleelement) { + document.getElementById(element.dataset.toggleelement).classList.toggle(element.dataset.toggleattr) + } +}); + +const oninput = document.querySelectorAll('[data-oninput]'); +for (const element of oninput) { + element.oninput = ()=>{execute(element, 'oninput')}; +} + +const onmouseover = document.querySelectorAll('[data-onmouseover]'); +for (const element of onmouseover) { + element.onmouseover = ()=>{execute(element, 'onmouseover')}; +} + +const onchange = document.querySelectorAll('[data-onchange]'); +for (const element of onchange) { + element.onchange = ()=>{execute(element, 'onchange')}; +} + +const onsubmit = document.querySelectorAll('[data-onsubmit]'); +for (const element of onsubmit) { + element.onsubmit = ()=>{execute(element, 'onsubmit')}; +} + +const onfocus = document.querySelectorAll('[data-onfocus]'); +for (const element of onfocus) { + element.onfocus = ()=>{execute(element, 'onfocus')}; +} + +const click_submit = document.querySelectorAll('[click_submit]'); +for (const element of click_submit) { + if (element.dataset.nonce != nonce) continue + element.onclick = () => {element.form.submit()}; +} + +const change_submit = document.querySelectorAll('[change_submit]'); +for (const element of change_submit) { + if (element.dataset.nonce != nonce) continue + element.onchange = () => {element.form.submit()}; +} + +const undisableelement = document.querySelectorAll('[undisableelement]'); +for (const element of undisableelement) { + if (element.dataset.nonce != nonce) continue + element.oninput = () => { + document.getElementById(element.dataset.undisableelement).disabled = false; + }; +} + +// data-on[^"]*?="[^"]+?\.(?![%a-z._ ]+?\}) + +const setting_switchs = document.getElementsByClassName('setting_switch'); +for (const element of setting_switchs) { + if (element.dataset.nonce != nonce) continue + element.onchange = () => { + postToastSwitch(this,`/settings/${element.name}?poor=${element.checked}`); + }; +} + +const setting_reloads = document.getElementsByClassName('setting_reload'); +for (const element of setting_reloads) { + if (element.dataset.nonce != nonce) continue + element.onchange = () => { + postToastReload(this,`/settings/${element.name}?poor=${element.checked}`); + }; +} + +const reload_page = document.getElementById('reload-page') +if (reload_page) + reload_page.onclick = ()=>{location.reload()}; diff --git a/files/assets/js/comments.js b/files/assets/js/comments.js index 8472ab60c..e5018b8a7 100644 --- a/files/assets/js/comments.js +++ b/files/assets/js/comments.js @@ -17,7 +17,8 @@ function expandMarkdown(id,type) { } }; -function collapse_comment(id, element) { +function collapse_comment(id) { + const element = document.getElementById(`comment-${id}`) const closed = element.classList.toggle("collapsed") const top = element.getBoundingClientRect().y @@ -38,4 +39,4 @@ function collapse_comment(id, element) { const ta = document.getElementById('markdown-'+id); if (!ta.classList.contains('d-none')) expandMarkdown(id,'c') -}; \ No newline at end of file +}; diff --git a/files/assets/js/core.js b/files/assets/js/core.js index 79c861bf3..13d31a4b7 100644 --- a/files/assets/js/core.js +++ b/files/assets/js/core.js @@ -334,7 +334,7 @@ function areyousure(t) { else t.innerHTML = t.innerHTML.replace(t.textContent, 'Are you sure?') - t.setAttribute("onclick", t.dataset.click); + t.setAttribute("data-onclick", t.dataset.areyousure); if (t.dataset.dismiss) t.setAttribute("data-bs-dismiss", t.dataset.dismiss); @@ -436,19 +436,6 @@ function sort_table(t) { } } - -document.addEventListener("click", function(e){ - const element = e.target - if (element instanceof HTMLImageElement && element.alt.startsWith('![](')) - expandImage() - else if (element.tagName == "TH") - sort_table(element) - else if (element.classList.contains('giphy')) - insertGIF(e.target.src); - else if (element.classList.contains('gif-cat-overlay')) - searchGifs(e.target.firstElementChild.innerHTML); -}); - if (window.matchMedia('(display-mode: minimal-ui)')['matches']) { const links = document.querySelectorAll('a[data-target="t"]'); for (const link of links) { diff --git a/files/assets/js/emoji_modal.js b/files/assets/js/emoji_modal.js index 359361a6c..e5a01ee51 100644 --- a/files/assets/js/emoji_modal.js +++ b/files/assets/js/emoji_modal.js @@ -15,6 +15,7 @@ Copyright (C) 2022 Dr Steven Transmisia, anti-evil engineer, */ // Status +let favs = null; let emojiEngineStarted = false; // DOM stuff @@ -280,9 +281,11 @@ function switchEmojiTab(e) for(const emojiDOM of Object.values(emojiDOMs)) emojiDOM.hidden = true; - for (const emoji of favs) - if(emojiDOMs[emoji] instanceof HTMLElement) - emojiDOMs[emoji].hidden = false; + if (favs) { + for (const emoji of favs) + if(emojiDOMs[emoji] instanceof HTMLElement) + emojiDOMs[emoji].hidden = false; + } return; } @@ -291,6 +294,10 @@ function switchEmojiTab(e) emojiDOM.hidden = emojiDOM.dataset.className !== className; } +for (const emojitab of document.getElementsByClassName('emojitab')) { + emojitab.addEventListener('click', (e)=>{switchEmojiTab(e)}) +} + async function start_search() { emojiSearcher.addQuery(emojiSearchBarDOM.value.trim()); diff --git a/files/assets/js/settings_security.js b/files/assets/js/settings_security.js index 58bff296e..831c846f1 100644 --- a/files/assets/js/settings_security.js +++ b/files/assets/js/settings_security.js @@ -41,3 +41,5 @@ function unblock_user(t, url) { } ); } + +document.getElementById('2faToggle').onchange = () => {twoStepModal.show()} diff --git a/files/assets/js/signup.js b/files/assets/js/signup.js index 72bd14fc6..b6a40088e 100644 --- a/files/assets/js/signup.js +++ b/files/assets/js/signup.js @@ -39,3 +39,8 @@ document.getElementById('username-register').addEventListener('input', function } } }); + + +document.getElementById('email-register').onfocus () => { + if (this.hasAttribute('readonly')) {this.removeAttribute('readonly');this.blur();this.focus()} +} diff --git a/files/assets/js/top.js b/files/assets/js/top.js new file mode 100644 index 000000000..1e5864cbe --- /dev/null +++ b/files/assets/js/top.js @@ -0,0 +1 @@ +const nonce = document.getElementById('gnonce').value diff --git a/files/classes/submission.py b/files/classes/submission.py index 3b5724f31..9915c3007 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -297,7 +297,7 @@ class Submission(Base): body += " - WINNER!" if not winner and v and v.admin_level >= PERMS['POST_BETS_DISTRIBUTE']: - body += f'''''' + body += f'''''' body += "" else: input_type = 'radio' if o.exclusive else 'checkbox' diff --git a/files/routes/allroutes.py b/files/routes/allroutes.py index 8c1b3ba12..77d032468 100644 --- a/files/routes/allroutes.py +++ b/files/routes/allroutes.py @@ -56,6 +56,8 @@ def before_request(): limiter.check() g.db = db_session() + g.nonce = secrets.token_urlsafe(31) + CSP = { @@ -75,11 +77,12 @@ CSP = { "style-src": "'self' 'unsafe-inline'", "script-src-elem": "'self' challenges.cloudflare.com", - "script-src-attr": "'unsafe-inline'", - "script-src": "'self' 'unsafe-inline' challenges.cloudflare.com", + "script-src-attr": "'none'", + "script-src": "'self' challenges.cloudflare.com", "media-src": "https:", "img-src": "https: data:", + "frame-src": "challenges.cloudflare.com www.youtube-nocookie.com platform.twitter.com", "connect-src": "'self' tls-use1.fpapi.io api.fpjs.io", @@ -90,6 +93,7 @@ CSP = { if IS_LOCALHOST: CSP["style-src-elem"] += " rdrama.net" CSP["script-src-elem"] += " rdrama.net" + CSP["media-src"] += " http:" CSP["img-src"] += " http:" CSP_str = '' diff --git a/files/templates/admin/admin_home.html b/files/templates/admin/admin_home.html index f12f1810c..1c9c2b24b 100644 --- a/files/templates/admin/admin_home.html +++ b/files/templates/admin/admin_home.html @@ -111,13 +111,13 @@ {% if v.admin_level >= PERMS['SITE_SETTINGS'] %} {% for setting in site_settings.keys() %}
- +
{% endfor %} {% if v.admin_level >= PERMS['SITE_SETTINGS_UNDER_ATTACK'] %}
- +
{% endif %} @@ -127,7 +127,7 @@ {% if v.admin_level >= PERMS['SITE_CACHE_PURGE_CDN'] %}

Caching

{% if v.admin_level >= PERMS['SITE_CACHE_PURGE_CDN'] %} - + {% endif %} {% endif %} diff --git a/files/templates/admin/alt_votes.html b/files/templates/admin/alt_votes.html index 5e49cf064..0f529b7e4 100644 --- a/files/templates/admin/alt_votes.html +++ b/files/templates/admin/alt_votes.html @@ -7,7 +7,7 @@ - + {% if u1 and u2 %} @@ -56,7 +56,7 @@

Two accounts controlled by different people should have most uniqueness percentages at or above 70-80%

A sockpuppet account will have its uniqueness percentages significantly lower.

- + {% endif %} {% endif %} {% endif %} diff --git a/files/templates/admin/alts.html b/files/templates/admin/alts.html index 32da5d425..6f0fe17c4 100644 --- a/files/templates/admin/alts.html +++ b/files/templates/admin/alts.html @@ -10,7 +10,7 @@
- +
{% if u %} @@ -40,8 +40,8 @@ {{user._alt_created_utc|timestamp}} {{user._is_manual}} - - + + Alts {% if v.admin_level >= PERMS['VIEW_ALT_VOTES'] %} Alt Votes @@ -57,11 +57,11 @@ Adding linked will link the two alts together manually, while adding delinked will attempt to delink alts whereever possible.
You're on your own for reversing any propagation though.

-
+ - - + +
{% endif %} diff --git a/files/templates/admin/app.html b/files/templates/admin/app.html index 275a176ad..296cabcc6 100644 --- a/files/templates/admin/app.html +++ b/files/templates/admin/app.html @@ -28,12 +28,12 @@
{% if not app.client_id%} - - + + {% else %} - + {% endif %}
diff --git a/files/templates/admin/apps.html b/files/templates/admin/apps.html index af320420a..8ae130ac7 100644 --- a/files/templates/admin/apps.html +++ b/files/templates/admin/apps.html @@ -34,12 +34,12 @@
{% if not app.client_id %} - - + + {% else %} - + {% endif %}
diff --git a/files/templates/admin/badge_admin.html b/files/templates/admin/badge_admin.html index 854f13507..1e8009356 100644 --- a/files/templates/admin/badge_admin.html +++ b/files/templates/admin/badge_admin.html @@ -50,7 +50,7 @@ {% endif %} - + diff --git a/files/templates/admin/banned_domains.html b/files/templates/admin/banned_domains.html index b694e8c6f..0e594bef1 100644 --- a/files/templates/admin/banned_domains.html +++ b/files/templates/admin/banned_domains.html @@ -21,7 +21,7 @@ {{domain.domain}} {{domain.reason}} - + {% endfor %} @@ -32,8 +32,8 @@
- - + +
diff --git a/files/templates/admin/edit_rules.html b/files/templates/admin/edit_rules.html index 6c2bd8bbf..ed38184f9 100644 --- a/files/templates/admin/edit_rules.html +++ b/files/templates/admin/edit_rules.html @@ -18,7 +18,7 @@
- +
diff --git a/files/templates/app.html b/files/templates/app.html index d678ec8d5..958762676 100644 --- a/files/templates/app.html +++ b/files/templates/app.html @@ -11,9 +11,9 @@ {% endif %}
First step:
- First step + First step
Second step:
- Second step + Second step {% endblock %} diff --git a/files/templates/casino/blackjack_screen.html b/files/templates/casino/blackjack_screen.html index b02b29e60..8b3558366 100644 --- a/files/templates/casino/blackjack_screen.html +++ b/files/templates/casino/blackjack_screen.html @@ -14,13 +14,13 @@
- - - + + - -
diff --git a/files/templates/casino/game_screen.html b/files/templates/casino/game_screen.html index 8ee1f0dff..7704da8d4 100644 --- a/files/templates/casino/game_screen.html +++ b/files/templates/casino/game_screen.html @@ -68,7 +68,7 @@
- diff --git a/files/templates/comments.html b/files/templates/comments.html index f7e6e64c2..11690d665 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -24,13 +24,13 @@ {% if c.is_blocking and not c.ghost or (c.is_banned or c.deleted_utc) and not (v and v.admin_level >= PERMS['POST_COMMENT_MODERATION']) and not (v and v.id==c.author_id) %}
- +
@@ -43,7 +43,7 @@ {{single_comment(reply, level=level+1)}} {% endfor %} {% elif replies %} - + More comments {% endif %}
@@ -114,14 +114,14 @@
{% if not isreply %} - + {% endif %}
diff --git a/files/templates/hats.html b/files/templates/hats.html index 0fa29c030..0ba69e3b1 100644 --- a/files/templates/hats.html +++ b/files/templates/hats.html @@ -69,18 +69,18 @@ {% if hat.id not in owned_hat_ids and hat.is_purchasable %}
- + {% if FEATURES['MARSEYBUX'] %} - + {% endif %}
{% endif %}
- + - +
diff --git a/files/templates/header.html b/files/templates/header.html index e675285e7..c2dbcc7ec 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -83,8 +83,8 @@
{% endif %} - {% if g.browser in ('webview','apple') %} - + {% if g.browser in ('webview','apple') or True %} + {% endif %} {% if v %} @@ -231,7 +231,7 @@ Archives {% endif %} Contact us - +
@@ -256,7 +256,7 @@
- {{ma.age_string}} + {{ma.age_string}}
diff --git a/files/templates/login/forgot_password.html b/files/templates/login/forgot_password.html index d76bbf1f1..edc041822 100644 --- a/files/templates/login/forgot_password.html +++ b/files/templates/login/forgot_password.html @@ -9,7 +9,7 @@ - +
{% endblock %} diff --git a/files/templates/login/lost_2fa.html b/files/templates/login/lost_2fa.html index d623555d2..3b01366de 100644 --- a/files/templates/login/lost_2fa.html +++ b/files/templates/login/lost_2fa.html @@ -11,7 +11,7 @@ - + {% endblock %} diff --git a/files/templates/login/reset_password.html b/files/templates/login/reset_password.html index 6bb016a0d..b780d3f0e 100644 --- a/files/templates/login/reset_password.html +++ b/files/templates/login/reset_password.html @@ -11,7 +11,7 @@ - + {% endblock %} diff --git a/files/templates/login/sign_up.html b/files/templates/login/sign_up.html index 6de6df162..55eab6b28 100644 --- a/files/templates/login/sign_up.html +++ b/files/templates/login/sign_up.html @@ -76,7 +76,7 @@ (optional) + aria-describedby="emailHelpRegister" type="email" pattern='{{EMAIL_REGEX_PATTERN}}' name="email" readonly data-nonce="{{g.nonce}}" data-onfocus="if (this.hasAttribute('readonly')) {this.removeAttribute('readonly');this.blur();this.focus()}"> diff --git a/files/templates/modals/award.html b/files/templates/modals/award.html index b44aed85c..5029fd6c1 100644 --- a/files/templates/modals/award.html +++ b/files/templates/modals/award.html @@ -12,7 +12,7 @@
- +
diff --git a/files/templates/modals/gif.html b/files/templates/modals/gif.html index 278975d16..bbca046c1 100644 --- a/files/templates/modals/gif.html +++ b/files/templates/modals/gif.html @@ -4,7 +4,7 @@ diff --git a/files/templates/notifications.html b/files/templates/notifications.html index 305e196f0..62690f2e6 100644 --- a/files/templates/notifications.html +++ b/files/templates/notifications.html @@ -50,7 +50,7 @@
- +
@@ -87,7 +87,7 @@ {{ma.string | safe}}
- {{ma.age_string}} + {{ma.age_string}}
diff --git a/files/templates/oauth.html b/files/templates/oauth.html index 6e2097e09..048454ba6 100644 --- a/files/templates/oauth.html +++ b/files/templates/oauth.html @@ -12,7 +12,7 @@ - + No, back to {{SITE_NAME}} diff --git a/files/templates/post_actions.html b/files/templates/post_actions.html index 66c9e2536..3dd3b698e 100644 --- a/files/templates/post_actions.html +++ b/files/templates/post_actions.html @@ -1,7 +1,7 @@ {% if v and v.id==p.author_id and p.private %}
- +
{% endif %} @@ -11,30 +11,30 @@ {% endif %} {% if v and FEATURES['AWARDS'] %} - + {% endif %} {% if v %} - - + + - - + + - + {% endif %} {% if v and v.id==p.author_id %} {% if request.path.startswith('/@') %} - - + + {% endif %} - + - + {% endif %} {% if v %} @@ -44,47 +44,47 @@ API App {% endif %} {% if v.can_edit(p) %} - - + + {% endif %} {% if v.admin_level >= PERMS['POST_COMMENT_DISTINGUISH'] %} - - + + {% endif %} {% if v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %} - - + + {% endif %} {% if p.sub and v.mods(p.sub) %} - - + + {% endif %} {% if v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %} - - + + {% endif %} {% if v.id != p.author_id and not p.ghost %} - - + + {% endif %} {% if p.sub and v.mods(p.sub) %} - + {% if not p.author.mods(p.sub) %} - - + + {% endif %} {% endif %} {% if v.id==p.author_id or v.admin_level >= PERMS['POST_COMMENT_MODERATION'] or (p.sub and v.mods(p.sub)) %} - - + + {% endif %} {% if v.admin_level >= PERMS['USER_BAN'] and v.id != p.author_id %} - - + + {% endif %} {% if v.admin_level >= PERMS['USER_AGENDAPOSTER'] and v.id != p.author_id %} - - + + {% endif %} {% endif %} diff --git a/files/templates/post_actions_mobile.html b/files/templates/post_actions_mobile.html index aeb8eba67..6b52b44cf 100644 --- a/files/templates/post_actions_mobile.html +++ b/files/templates/post_actions_mobile.html @@ -1,7 +1,7 @@ {% if v and v.id==p.author_id and p.private %}
- +
{% endif %} @@ -14,51 +14,51 @@ - + {% if FEATURES['AWARDS'] -%} - + {%- endif %} - + - + - - + + {% if p.sub and v.mods(p.sub) %} - - + + {% endif %} {% if v.id==p.author_id %} {% if request.path.startswith('/@') %} - - + + {% endif %} - + - + {% else %} {% if not p.ghost %} - - + + {% endif %} {% endif %} {% if v.id==p.author_id or (p.sub and v.mods(p.sub)) %} - - + + {% endif %} {% if p.sub and v.mods(p.sub) %} - + {% if not p.author.mods(p.sub) %} - - + + {% endif %} {% endif %} diff --git a/files/templates/post_admin_actions_mobile.html b/files/templates/post_admin_actions_mobile.html index a81835575..54f4f118e 100644 --- a/files/templates/post_admin_actions_mobile.html +++ b/files/templates/post_admin_actions_mobile.html @@ -14,36 +14,36 @@ {% endif %} {% if (request.path.startswith('/post/') or request.path.startswith('/h/')) and v.admin_level >= PERMS['POST_EDITING'] and p.id %} - + {% endif %} {% if v.can_edit(p) %} - - + + {% endif %} {% if v.admin_level >= PERMS['POST_COMMENT_DISTINGUISH'] and (v.id == p.author.id or v.admin_level >= PERMS['POST_COMMENT_MODERATION']) %} - + - + {% endif %} {% if v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %} - - - - + + + + {% endif %} {% if v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %} - - + + {% endif %} {% if v.id != p.author_id and v.admin_level >= PERMS['USER_BAN'] %} - - + + {% endif %} {% if v.id != p.author_id and v.admin_level >= PERMS['USER_AGENDAPOSTER'] %} - - + + {% endif %} diff --git a/files/templates/root.html b/files/templates/root.html index f974f70ac..5868f48b1 100644 --- a/files/templates/root.html +++ b/files/templates/root.html @@ -7,6 +7,10 @@ {% endblock %} {%- import 'util/macros.html' as macros with context -%} {%- import 'util/html_head.html' as html_head with context -%} + + + + @@ -21,8 +25,9 @@ {% block head_final %}{% endblock %} {% endblock %} - + {% block body required %}{% endblock %} {{html_head.stylesheets_lower()}} + diff --git a/files/templates/search.html b/files/templates/search.html index cc71eae33..998a26482 100644 --- a/files/templates/search.html +++ b/files/templates/search.html @@ -35,38 +35,38 @@ diff --git a/files/templates/settings/advanced.html b/files/templates/settings/advanced.html index 9065305c1..b43d9e5fc 100644 --- a/files/templates/settings/advanced.html +++ b/files/templates/settings/advanced.html @@ -14,7 +14,7 @@
- +
Makes the site faster for low-end devices: @@ -38,7 +38,7 @@

Change how many posts appear on every page.

- {% for entry in PAGE_SIZES %} {% endfor %} @@ -53,7 +53,7 @@

Change the default sorting for comments.

- {% for entry in COMMENT_SORTS %} {% endfor %} @@ -68,7 +68,7 @@

Change the default sorting for posts.

- {% for entry in SORTS %} {% endfor %} @@ -83,7 +83,7 @@

Change the default time filter for posts.

- {% for entry in TIME_FILTERS %} {% endfor %} @@ -112,7 +112,7 @@

Change the domain you would like to view reddit posts in.

- {% for entry in ['old.reddit.com', 'reddit.com', 'i.reddit.com', 'unddit.com', 'teddit.net', 'libredd.it'] %} {% endfor %} @@ -142,7 +142,7 @@ rows="3" name="filters" form="custom-filter" maxlength="1000">{% if v.custom_filter_list %}{{v.custom_filter_list}}{% endif %}
Use a new line for each filter entry. Limit of 1000 characters. - +
diff --git a/files/templates/settings/apps.html b/files/templates/settings/apps.html index 6a2086271..fe3493436 100644 --- a/files/templates/settings/apps.html +++ b/files/templates/settings/apps.html @@ -31,8 +31,8 @@
@@ -67,7 +67,7 @@
@@ -91,7 +91,7 @@
@@ -118,7 +118,7 @@
diff --git a/files/templates/settings/common.html b/files/templates/settings/common.html index 1789e1ccb..7bf4a2ecb 100644 --- a/files/templates/settings/common.html +++ b/files/templates/settings/common.html @@ -25,7 +25,7 @@
{% for themecolor in COLORS %} - +
@@ -60,10 +60,10 @@
{% if show_marseys %} -
+
{% endif %} {{below_text}} - +
@@ -81,21 +81,21 @@ {% if show_extras %}
- +   - +   {% if show_file_upload %} {% endif %}
{% endif %}
{{below_text}} - +
diff --git a/files/templates/settings/css.html b/files/templates/settings/css.html index e18ec7aa9..4fa601a7b 100644 --- a/files/templates/settings/css.html +++ b/files/templates/settings/css.html @@ -14,7 +14,7 @@ Limit of {{CSS_LENGTH_LIMIT}} characters
- +
@@ -32,7 +32,7 @@ Limit of {{CSS_LENGTH_LIMIT}} characters
- +
diff --git a/files/templates/settings/personal.html b/files/templates/settings/personal.html index 245de8494..d3c508df0 100644 --- a/files/templates/settings/personal.html +++ b/files/templates/settings/personal.html @@ -29,7 +29,7 @@
- {% for entry in THEMES %}
diff --git a/files/templates/settings/security.html b/files/templates/settings/security.html index fab5df3d7..55b0b1929 100644 --- a/files/templates/settings/security.html +++ b/files/templates/settings/security.html @@ -18,7 +18,7 @@ {% if v.email and not v.is_activated %} -
Email not verified. You will not be able to recover your account with this email until you verify it.
+
Email not verified. You will not be able to recover your account with this email until you verify it.
{% elif not v.email %}
Add an email to secure your account in case you forget your password.
{% endif %} @@ -37,15 +37,15 @@
{% if FEATURES['MARSEYBUX'] %} {% if KOFI_TOKEN %} - + {% else %} - + {% endif %} {% endif %} {% if v.email %} - + {% else %} - + {% endif %}
{% if FEATURES['MARSEYBUX'] %} @@ -90,7 +90,7 @@
- +
@@ -105,7 +105,7 @@
- +
This requires entering a randomly-generated, 6-digit code and your password to login. @@ -128,7 +128,7 @@
@@ -162,7 +162,7 @@ {% include "user_in_table.html" %} - + {% else %} @@ -213,7 +213,7 @@ - + {% set action = "Enable" %} {% else %} @@ -240,7 +240,7 @@ @@ -69,7 +69,7 @@
- +
@@ -86,9 +86,9 @@
- +
@@ -110,7 +110,7 @@
- +
@@ -131,7 +131,7 @@
- +
diff --git a/files/templates/submission.html b/files/templates/submission.html index 85a40e346..2bf4a4653 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -44,9 +44,9 @@ @@ -136,7 +136,7 @@
@@ -175,23 +175,23 @@ - +
- - + +
- - + +
Formatting help
@@ -217,11 +217,11 @@ {% if v and v.can_edit(p) %} - + {% endif %} {% if v and v.id != p.author_id and p.body and not v_forbid_deleted %} - + {% endif %} {% include 'post_actions.html' %} @@ -232,19 +232,19 @@ {% if v %}
-
+
{{score}} -
+
{% else %}
-
+
{{score}} -
+
{% endif %}
@@ -277,10 +277,10 @@ {% endif %}
  • {% if v %} - + {% else %} - + {% endif %} @@ -288,9 +288,9 @@ {{score}} {% if v %} - + {% else %} - + {% endif %} diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index 63034c0f8..4e0795f4b 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -31,7 +31,7 @@ Reported by:
      {% for f in p.filtered_flags(v) %} -
    • {{f.user.username}}{% if f.reason %}: {{f.realreason(v) | safe}}{% endif %} {% if v and v.admin_level >= PERMS['FLAGS_REMOVE'] %}{% endif %}
    • +
    • {{f.user.username}}{% if f.reason %}: {{f.realreason(v) | safe}}{% endif %} {% if v and v.admin_level >= PERMS['FLAGS_REMOVE'] %}{% endif %}
    • {% endfor %}
    @@ -42,26 +42,26 @@
    {% if error %}{{error | safe}}{% endif %} - +
    diff --git a/files/templates/submit_hats.html b/files/templates/submit_hats.html index 08bae0f99..cff9b8fea 100644 --- a/files/templates/submit_hats.html +++ b/files/templates/submit_hats.html @@ -38,7 +38,7 @@ @@ -87,9 +87,9 @@
    - + {% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_HATS'] %} - + {% endif %}
    diff --git a/files/templates/submit_marseys.html b/files/templates/submit_marseys.html index 1cd97810c..b76af9b08 100644 --- a/files/templates/submit_marseys.html +++ b/files/templates/submit_marseys.html @@ -33,7 +33,7 @@ @@ -73,9 +73,9 @@
    - + {% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_MARSEYS'] %} - + {% endif %}
    diff --git a/files/templates/update_assets.html b/files/templates/update_assets.html index d1835bc47..b2b5dfb46 100644 --- a/files/templates/update_assets.html +++ b/files/templates/update_assets.html @@ -32,7 +32,7 @@ {% endif %} diff --git a/files/templates/user_listing.html b/files/templates/user_listing.html index 4984264d7..b5d21a418 100644 --- a/files/templates/user_listing.html +++ b/files/templates/user_listing.html @@ -17,9 +17,9 @@ {% if v %} {% if v.id != u.id and not u.is_private %} -
    +
    -
    +
    {% endif %} {% else %} diff --git a/files/templates/userpage/admintools.html b/files/templates/userpage/admintools.html index 66f3ddcfb..b12aa4f1b 100644 --- a/files/templates/userpage/admintools.html +++ b/files/templates/userpage/admintools.html @@ -26,79 +26,79 @@ {% if v.admin_level >= PERMS['USER_TITLE_CHANGE'] %}
    -
    +
    -
    +
    - +
    {% endif %} {% if v.admin_level >= PERMS['USER_BAN'] %} - + -
    + - +
    - +
    {% endif %} {% if v.admin_level >= PERMS['USER_SHADOWBAN'] %} - + -
    + - - + +
    {% endif %} {% if v.admin_level >= PERMS['USER_AGENDAPOSTER'] %} - + -
    + - +
    {% endif %}
    {% if v.admin_level >= PERMS['ADMIN_ADD'] %} - + {% endif %} {% if v.admin_level >= PERMS['ADMIN_REMOVE'] %} - + {% endif %} {% if v.admin_level >= PERMS['ADMIN_ACTIONS_REVERT'] and u.admin_level %} - + {% endif %} {% if v.admin_level >= PERMS['USER_BAN'] %} - - + + {% endif %} {% if v and v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %} -
    + - +
    -
    + - +
    {% endif %}
    diff --git a/files/templates/userpage/banner.html b/files/templates/userpage/banner.html index 2a7c5bcb1..e5b364e27 100644 --- a/files/templates/userpage/banner.html +++ b/files/templates/userpage/banner.html @@ -14,9 +14,9 @@
    @@ -82,10 +82,10 @@ follows {{u.follow_count}} user{{'s' if u.follow_count != 1 else ''}} {%- endif %} - joined {{u.created_date}} + joined {{u.created_date}} {% if v and v.admin_level >= PERMS['VIEW_LAST_ACTIVE'] -%} - last active {{u.last_active_date}} + last active {{u.last_active_date}} {%- endif %}
    @@ -135,44 +135,44 @@ {% if v and v.id != u.id %}
    - + - - + + {% if FEATURES['USERS_SUICIDE'] -%} - + {%- endif %} - + {% if FEATURES['MARSEYBUX'] -%} - + {%- endif %} - +
    -
    + - - + +   - +
    - +
    {{u.username}} will receive 0 coins
    - +
    - +
    {{u.username}} will receive 0 marseybux
    - +
    {{userpage_admintools.userAdminTools('desktop')}} @@ -184,7 +184,7 @@ {% endif %} {% if FEATURES['USERS_PROFILE_SONG'] and u.song and v and (v.id == u.id or v.mute and not u.unmutable) %} - + {% endif %} {% if v and v.id == u.id %} @@ -198,12 +198,12 @@ Upload Profile Background {% endif %} - + {% if v.profile_background -%}
    - @@ -242,10 +242,10 @@ {% for b in u.badges %} {% if b.url %} - {{b.name}} + {{b.name}} {% else %} - {{b.name}} + {{b.name}} {% endif %} {% endfor %}
    @@ -264,7 +264,7 @@ @@ -272,9 +272,9 @@
    @@ -338,10 +338,10 @@ follows {{u.follow_count}} user{{'s' if u.follow_count != 1 else ''}} {%- endif %} -
    joined {{u.created_date}} +
    joined {{u.created_date}} {% if v and v.admin_level >= PERMS['VIEW_LAST_ACTIVE'] -%} -
    last active {{u.last_active_date}} +
    last active {{u.last_active_date}} {%- endif %}
    @@ -388,10 +388,10 @@ {% for b in u.badges %} {% if b.url %} - {{b.name}} + {{b.name}} {% else %} - {{b.name}} + {{b.name}} {% endif %} {% endfor %} @@ -402,7 +402,7 @@ {% endif %} {% if FEATURES['USERS_PROFILE_SONG'] and u.song and v and (v.id == u.id or v.mute and not u.unmutable) %} - + {% endif %} {% if v and v.id == u.id %} @@ -417,12 +417,12 @@ Upload Profile Background {% endif %} - + {% if v.profile_background -%}
    - @@ -434,46 +434,46 @@ {% endif %} {% if v and v.id != u.id %} - + - + - + {% if FEATURES['USERS_SUICIDE'] -%} - + {%- endif %} - + {% if FEATURES['MARSEYBUX'] -%} - + {%- endif %} - + {% endif %}
    {% if v and v.id != u.id %} -
    + - - + +   - +
    - +
    {{u.username}} will receive 0 coins
    - +
    - +
    {{u.username}} will receive 0 marseybux
    - +
    {{userpage_admintools.userAdminTools('mobile')}} {% endif %} diff --git a/files/templates/userpage/blocking.html b/files/templates/userpage/blocking.html index 6307c49a8..ba3a02eff 100644 --- a/files/templates/userpage/blocking.html +++ b/files/templates/userpage/blocking.html @@ -12,7 +12,7 @@
    You are blocking @{{u.username}}.

    So we aren't going to show you their profile.

    - {% endif %} + {% if p.active_flags(v) %}{% endif %} {% if p.ghost %} 👻 @@ -84,7 +84,7 @@ {% if p.author.verified %} {% endif %} - +
    {% if p.author.hat_active(v)[0] -%} @@ -100,11 +100,11 @@ {{p.author.customtitle | safe}} {% endif %} {% endif %} -  {{p.age_string}} +  {{p.age_string}}   ({% if p.is_image %}image post{% elif p.is_video %}video post{% elif p.is_audio %}audio post{% elif p.domain %}{% else %}text post{% endif %}) {% if p.edited_utc %} - Edited {{p.edited_string}} + Edited {{p.edited_string}} {% endif %} {{p.views}} thread views {% endmacro %} @@ -116,27 +116,27 @@
    - +
      - +   {% if allow_file_upload %} {% endif %}
    - + {% if enable_cancel_button %} - + {% endif %}
    @@ -144,7 +144,7 @@
    {% else %}
    - +