forked from rDrama/rDrama
1
0
Fork 0

remove ns. where it isnt needed

master
Aevann 2023-09-29 04:52:14 +03:00
parent a96cd919dd
commit 14df8b5223
2 changed files with 20 additions and 22 deletions

View File

@ -1,47 +1,45 @@
<nav>
<ul class="pagination pagination-sm mb-0 mt-4 pl-1">
{% set ns = namespace() %}
{% if not size %}
{% set size = PAGE_SIZE %}
{% endif %}
{% set num_pages = (total / size) | round(0, 'ceil') | int %}
{% set ns.start_point = page - 2 %}
{% if ns.start_point < 1 %}
{% set ns.start_point = 1 %}
{% set start_point = page - 2 %}
{% if start_point < 1 %}
{% set start_point = 1 %}
{% endif %}
{% set end_point = ns.start_point+4 %}
{% set end_point = start_point+4 %}
{% if end_point > num_pages %}
{% set ns.start_point = ns.start_point-(end_point-num_pages) %}
{% set start_point = start_point-(end_point-num_pages) %}
{% set end_point = num_pages %}
{% endif %}
{% if ns.start_point < 1 %}
{% set ns.start_point = 1 %}
{% if start_point < 1 %}
{% set start_point = 1 %}
{% endif %}
{% if ns.start_point > 1 %}
{% if start_point > 1 %}
<li class="page-item">
<small><a class="page-link" href="{{'page'|change_arg(1, request.full_path)|safe}}">1</a></small>
</li>
{% if ns.start_point == 3 %}
{% if start_point == 3 %}
<li class="page-item">
<small><a class="page-link" href="{{'page'|change_arg(2, request.full_path)|safe}}">2</a></small>
</li>
{% elif ns.start_point != 2 %}
{% elif start_point != 2 %}
<li class="page-item">
<small class="page-link dots">...</small>
</li>
{% set ns.start_point = ns.start_point + 1 %}
{% set start_point = start_point + 1 %}
{% endif %}
{% endif %}
{% for x in range(ns.start_point, end_point+1) %}
{% for x in range(start_point, end_point+1) %}
<li class="page-item">
<small><a class="page-link {% if x == page %}active disabled{% endif %}" href="{{'page'|change_arg(x, request.full_path)|safe}}">{{x}}</a></small>
</li>

View File

@ -272,23 +272,23 @@
{% set ns = namespace(slurtext='Enable if you would like to automatically replace slurs.', profanitytext='Enable if you would like to automatically replace profanities.') %}
{% if FEATURES['USERS_PERMANENT_WORD_FILTERS'] %}
{% if v.slurreplacer == 0 %}
{% set ns.slurtext = 'Enable if you would like to automatically replace slurs. <a hidden id="slurreplacer-perma-link" href="#" class="text-primary" data-bs-toggle="modal" data-bs-target="#modal-slurreplacer">Make filter permanent for a badge!</a>' %}
{% set slurtext = 'Enable if you would like to automatically replace slurs. <a hidden id="slurreplacer-perma-link" href="#" class="text-primary" data-bs-toggle="modal" data-bs-target="#modal-slurreplacer">Make filter permanent for a badge!</a>' %}
{% elif v.slurreplacer == 1 %}
{% set ns.slurtext = 'Enable if you would like to automatically replace slurs. <a id="slurreplacer-perma-link" href="#" class="text-primary" data-bs-toggle="modal" data-bs-target="#modal-slurreplacer">Make filter permanent for a badge!</a>' %}
{% set slurtext = 'Enable if you would like to automatically replace slurs. <a id="slurreplacer-perma-link" href="#" class="text-primary" data-bs-toggle="modal" data-bs-target="#modal-slurreplacer">Make filter permanent for a badge!</a>' %}
{% else %}
{% set ns.slurtext = "You've enabled the slur replacer permanently! ✊🏿" %}
{% set slurtext = "You've enabled the slur replacer permanently! ✊🏿" %}
{% endif %}
{% if v.profanityreplacer == 0 %}
{% set ns.profanitytext = 'Enable if you would like to automatically replace profanities. <a hidden id="profanityreplacer-perma-link" href="#" class="text-primary" data-bs-toggle="modal" data-bs-target="#modal-profanityreplacer">Make filter permanent for a badge!</a>' %}
{% set profanitytext = 'Enable if you would like to automatically replace profanities. <a hidden id="profanityreplacer-perma-link" href="#" class="text-primary" data-bs-toggle="modal" data-bs-target="#modal-profanityreplacer">Make filter permanent for a badge!</a>' %}
{% elif v.profanityreplacer == 1 %}
{% set ns.profanitytext = 'Enable if you would like to automatically replace profanities. <a id="profanityreplacer-perma-link" href="#" class="text-primary" data-bs-toggle="modal" data-bs-target="#modal-profanityreplacer">Make filter permanent for a badge!</a>' %}
{% set profanitytext = 'Enable if you would like to automatically replace profanities. <a id="profanityreplacer-perma-link" href="#" class="text-primary" data-bs-toggle="modal" data-bs-target="#modal-profanityreplacer">Make filter permanent for a badge!</a>' %}
{% else %}
{% set ns.profanitytext = "You've enabled the profanity replacer permanently! 😇" %}
{% set profanitytext = "You've enabled the profanity replacer permanently! 😇" %}
{% endif %}
{% endif %}
{{common.toggle_section("Slur Replacer", "slurreplacerswitch", 'slurreplacer', v.slurreplacer, ns.slurtext, FEATURES['USERS_PERMANENT_WORD_FILTERS'] and v.slurreplacer > 1)}}
{{common.toggle_section("Profanity Replacer", "profanityreplacerswitch", 'profanityreplacer', v .profanityreplacer, ns.profanitytext, FEATURES['USERS_PERMANENT_WORD_FILTERS'] and v.profanityreplacer > 1)}}
{{common.toggle_section("Slur Replacer", "slurreplacerswitch", 'slurreplacer', v.slurreplacer, slurtext, FEATURES['USERS_PERMANENT_WORD_FILTERS'] and v.slurreplacer > 1)}}
{{common.toggle_section("Profanity Replacer", "profanityreplacerswitch", 'profanityreplacer', v .profanityreplacer, profanitytext, FEATURES['USERS_PERMANENT_WORD_FILTERS'] and v.profanityreplacer > 1)}}
</div>
</section>
<section id="site-settings-referral-section" class="settings-section-section">