From 6e0fd23ba3f6b6416371554f676cda9f799fefc4 Mon Sep 17 00:00:00 2001 From: justcool393 Date: Sun, 6 Nov 2022 01:35:49 -0500 Subject: [PATCH] settings: rework settings frontend --- files/assets/css/main.css | 1 + files/routes/static.py | 3 +- files/templates/settings.html | 92 +---- files/templates/settings_advanced.html | 159 ++++++++ files/templates/settings_apps.html | 38 +- files/templates/settings_blocks.html | 116 ------ files/templates/settings_common.html | 16 + files/templates/settings_css.html | 69 ++-- files/templates/settings_filters.html | 366 ------------------ files/templates/settings_personal.html | 304 +++++++++++++++ files/templates/settings_profilecss.html | 31 -- files/templates/settings_security.html | 473 ++++++++++------------- 12 files changed, 759 insertions(+), 909 deletions(-) create mode 100644 files/templates/settings_advanced.html delete mode 100644 files/templates/settings_blocks.html create mode 100644 files/templates/settings_common.html delete mode 100644 files/templates/settings_filters.html create mode 100644 files/templates/settings_personal.html delete mode 100644 files/templates/settings_profilecss.html diff --git a/files/assets/css/main.css b/files/assets/css/main.css index 9d2ee2dec..33fefa82f 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -1086,6 +1086,7 @@ input[type=submit].btn-follow, input[type=reset].btn-follow, input[type=button]. margin-bottom: 0; list-style: none; } + nav { diff --git a/files/routes/static.py b/files/routes/static.py index 2b1a8b32d..cff4f6f1f 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -365,7 +365,8 @@ def serviceworker(): def settings_security(v): return render_template("settings_security.html", v=v, - mfa_secret=pyotp.random_base32() if not v.mfa_secret else None + mfa_secret=pyotp.random_base32() if not v.mfa_secret else None, + now=int(time.time()) ) diff --git a/files/templates/settings.html b/files/templates/settings.html index bb3035d50..0ef7e0198 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -8,12 +8,9 @@ {{html_head.html_head(true, false, true, none, "Settings", "", "", false)}} - {% include "header.html" %}
-
-
{% if error %} @@ -40,72 +37,31 @@ {% endif %}
-

Settings

- -

Settings

- +

Settings

- - -
- - - +
- -
- - - +
- {% block content %} {% endblock %}
@@ -180,8 +136,6 @@
{% endif %} - - {% block clipboard %} {% endblock %} - - - - - {% block onload %}{% endblock %} - - - diff --git a/files/templates/settings_advanced.html b/files/templates/settings_advanced.html new file mode 100644 index 000000000..233080efc --- /dev/null +++ b/files/templates/settings_advanced.html @@ -0,0 +1,159 @@ +{% extends "settings.html" %} +{% block pagetitle %}Advanced Settings - {{SITE_NAME}}{% endblock %} +{% block content %} +{% import 'settings_common.html' as common with context %} +
+
+
+ {# toggle_section(title, id, name, flag, below_text) #} +
{# note: not using the thing from common just because of how much stuff there is in here #} +
Poor Mode
+
+
+
+ +
+
+
+ + +
+ Makes the site faster for low-end devices: +
    +
  • Disables the effects of cosmetic awards.
  • +
  • Hides signatures.
  • +
  • Makes emoji search only start when you press Enter.
  • +
  • Disables UI animations.
  • +
+
+
+
+
+
+
Frontpage Size
+
+
+
+ +
+ +
+

Change how many posts appear on every page.

+
+ +
+ +
+ +
+
+
+
+
Default Sorting and Time Filter
+
+
+
+ +
+
+

Change the default sorting for comments.

+
+ +
+
+
+
+
+ +
+
+

Change the default sorting for posts.

+
+ +
+
+
+
+
+ +
+
+

Change the default time filter for posts.

+
+ +
+
+
+
+
+
+
Tab Behavior
+
+ {{common.toggle_section("Open Internal Links In New Tabs", "newtab", "newtab", v.newtab, "Enable if you would like to automatically open links to other pages on the site in new tabs.")}} + {{common.toggle_section("Open External Links In New Tabs", "newtabexternal", "newtabexternal", v.newtabexternal, "Enable if you would like to automatically open links to other sites in new tabs.")}} +
+
+
+
External Services
+
+ {{common.toggle_section("Use Nitter for Twitter Links", "nitter", "nitter", v.nitter, "Enable if you would like to automatically convert twitter.com links to nitter.lacontrevoie.fr links.")}} + {{common.toggle_section("Use Imginn for Instagram Links", "imginn", "imginn", v.imginn, "Enable if you would like to automatically convert instagram.com links to imginn.com links.")}} +
+
+ +
+
+

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

+
+ +
+
+
+ {{common.toggle_section("Sort Redit Links by Controversial", "controversial", "controversial", v.controversial, "Enable if you would like to automatically sort reddit.com links by controversial.")}} +
+
+
+
Content Filters
+
+ {{common.toggle_section('Disable Signatures', 'sigs_disabled', 'sigs_disabled', v.sigs_disabled, 'Hide user signatures.')}} + {{common.toggle_section('Disable +18 Warnings', 'over18', 'over18', v.over18, "Enable if you would like to not get a warning before viewing +18 content.")}} + {{common.toggle_section('Hide Posts Voted On', 'hidevotedon', 'hidevotedon', v.hidevotedon), 'Enable if you would like to automatically hide posts you have voted on from your frontpage.'}} +
+
+ + Hides matching posts from the frontpage and collapses matching comments. + +
+ Use a new line for each filter entry. Limit of 1000 characters. + +
+
+
+
+
+
+
+
+{% endblock %} diff --git a/files/templates/settings_apps.html b/files/templates/settings_apps.html index b0bc61896..0d4c9c7f6 100644 --- a/files/templates/settings_apps.html +++ b/files/templates/settings_apps.html @@ -1,10 +1,5 @@ {% extends "settings.html" %} - -{% block title %} -{{SITE_NAME}} - FAQ - -{% endblock %} - +{% block pagetitle %}Apps/Bots - {{SITE_NAME}}{% endblock %} {% block content %}
@@ -12,18 +7,15 @@
API Guide
- -
Your API Applications
- +
Your API Applications
{% for app in v.applications if app.client_id %} -
- -
-
+ +
+
@@ -46,23 +38,20 @@
-
{% else %}

None

{% endfor %}
API Applications Awaiting Approval
- {% for app in v.applications if not app.client_id %} -
- -
-
+ +
+
@@ -84,22 +73,19 @@
-
{% else %}

None

{% endfor %}
Your Authorized Applications
- {% for auth in v.authorizations %} -
- -
-
+ +
+
@@ -143,8 +129,6 @@
{% endblock %} - - {% block clipboard %}