diff --git a/files/routes/settings.py b/files/routes/settings.py index 88219b8ce..3be1eee84 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -423,7 +423,7 @@ def titlecolor(v): @limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID) @auth_required def verifiedcolor(v): - if not v.verified: abort(403, "You don't have a checkmark") + if not v.verified: abort(403, "You don't have a checkmark to edit its color!") return set_color(v, "verifiedcolor", request.values.get("verifiedcolor")) @app.post("/settings/security") @@ -963,7 +963,8 @@ def settings_pronouns_change(v): @limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID) @auth_required def settings_checkmark_text(v): - if not v.verified: abort(403) + if not v.verified: + abort(403, "You don't have a checkmark to edit its hover text!") processed = process_settings_plaintext("checkmark-text", v.verified, 100) if isinstance(processed, tuple): diff --git a/files/templates/settings/common.html b/files/templates/settings/common.html index 5209d50a1..4d1ac0f07 100644 --- a/files/templates/settings/common.html +++ b/files/templates/settings/common.html @@ -52,8 +52,7 @@ {% endmacro %} -{% macro line_text_section(id, form_action, form_name, section_title, contents, below_text, placeholder_text, button_text, show_marseys, minlength, maxlength, pattern, show_if, disabled) %} -{% if show_if -%} +{% macro line_text_section(id, form_action, form_name, section_title, contents, below_text, placeholder_text, button_text, show_marseys, minlength, maxlength, pattern, disabled) %}
@@ -70,11 +69,9 @@
-{%- endif %} {% endmacro %} -{% macro text_area_section(id, form_action, form_name, section_title, contents, below_text, placeholder_text, show_extras, show_file_upload, maxlength, show_if) %} -{% if show_if -%} +{% macro text_area_section(id, form_action, form_name, section_title, contents, below_text, placeholder_text, show_extras, show_file_upload, maxlength) %}
@@ -99,5 +96,4 @@
-{%- endif %} {% endmacro %} diff --git a/files/templates/settings/personal.html b/files/templates/settings/personal.html index 93859f07b..90adf6557 100644 --- a/files/templates/settings/personal.html +++ b/files/templates/settings/personal.html @@ -197,14 +197,15 @@ {{common.color_section('namecolor', '/settings/namecolor', 'namecolor', 'Name Color', v.name_color)}} - {{common.line_text_section('pronouns', '/settings/pronouns_change', 'pronouns', 'Pronouns', v.pronouns, 'Limit of 15 characters', 'Enter pronouns here', 'Change Pronouns', false, 3, 15, '([a-zA-Z]{1,7})/[a-zA-Z]{1,7}(/[a-zA-Z]{1,7})?', FEATURES['PRONOUNS'], false)}} - {# common.line_text_section(id, form_action, form_name, section_title, contents, below_text, placeholder_text, button_text, show_marseys, minlength, maxlength, pattern, show_if, disabled) #} - {{common.line_text_section('flair', '/settings/title_change', 'title', 'Flair', v.customtitleplain, 'Limit of 100 characters', 'Enter a flair here', 'Change Flair', true, 0, 100, '.*', true, v.flairchanged)}} - {{common.color_section('flaircolor', '/settings/titlecolor', 'titlecolor', 'Flair Color', v.titlecolor)}} - {% if v.verified %} - {{common.color_section('verifiedcolor', '/settings/verifiedcolor', 'verifiedcolor', 'Checkmark Color', v.verifiedcolor)}} - {{common.line_text_section('checkmark_text', '/settings/checkmark_text', 'checkmark-text', 'Checkmark Text', v.verified, 'Limit of 100 characters', 'Enter checkmark hover text here', 'Change Text', false, 0, 100, '.*', v.verified, false)}} + + {% if FEATURES['PRONOUNS'] %} + {{common.line_text_section('pronouns', '/settings/pronouns_change', 'pronouns', 'Pronouns', v.pronouns, 'Limit of 15 characters', 'Enter pronouns here', 'Change Pronouns', false, 3, 15, '([a-zA-Z]{1,7})/[a-zA-Z]{1,7}(/[a-zA-Z]{1,7})?', false)}} {% endif %} + + {{common.line_text_section('flair', '/settings/title_change', 'title', 'Flair', v.customtitleplain, 'Limit of 100 characters', 'Enter a flair here', 'Change Flair', true, 0, 100, '.*', v.flairchanged)}} + + {{common.color_section('flaircolor', '/settings/titlecolor', 'titlecolor', 'Flair Color', v.titlecolor)}} + {% if FEATURES['USERS_PROFILE_SONG'] -%}
@@ -234,17 +235,32 @@
{%- endif %} - {# common.text_area_section(id, form_action, form_name, section_title, contents, below_text, placeholder_text, show_extras, show_file_upload, maxlength, show_if) #} - {{common.text_area_section('profile-bio', '/settings/personal', 'bio', 'Bio', v.bio, 'Limit of ' ~ BIO_FRIENDS_ENEMIES_LENGTH_LIMIT ~ ' characters', 'Tell the community a bit about yourself.', true, true, BIO_FRIENDS_ENEMIES_LENGTH_LIMIT, FEATURES['USERS_PROFILE_BODYTEXT'])}} - {{common.text_area_section('profile-friends', '/settings/personal', 'friends', 'Friends', v.friends, 'Limit of ' ~ BIO_FRIENDS_ENEMIES_LENGTH_LIMIT ~ ' characters', 'Enter your friends on the site...', false, false, BIO_FRIENDS_ENEMIES_LENGTH_LIMIT, true)}} - {{common.text_area_section('profile-enemies', '/settings/personal', 'enemies', 'Enemies', v.enemies, 'Limit of ' ~ BIO_FRIENDS_ENEMIES_LENGTH_LIMIT ~ ' characters', 'Enter your enemies on the site...', false, false, BIO_FRIENDS_ENEMIES_LENGTH_LIMIT, true)}} - {{common.text_area_section('profile-signature', '/settings/personal', 'sig', 'Signature', v.sig, 'Limit of 200 characters', 'Enter a signature...', true, false, 200, true)}} - {# toggle_section(title, id, name, flag, below_text, disabled) #} + + {% if FEATURES['USERS_PROFILE_BODYTEXT'] %} + {{common.text_area_section('profile-bio', '/settings/personal', 'bio', 'Bio', v.bio, 'Limit of ' ~ BIO_FRIENDS_ENEMIES_LENGTH_LIMIT ~ ' characters', 'Tell the community a bit about yourself.', true, true, BIO_FRIENDS_ENEMIES_LENGTH_LIMIT)}} + {% endif %} + + {{common.text_area_section('profile-friends', '/settings/personal', 'friends', 'Friends', v.friends, 'Limit of ' ~ BIO_FRIENDS_ENEMIES_LENGTH_LIMIT ~ ' characters', 'Enter your friends on the site...', false, false, BIO_FRIENDS_ENEMIES_LENGTH_LIMIT)}} + + {{common.text_area_section('profile-enemies', '/settings/personal', 'enemies', 'Enemies', v.enemies, 'Limit of ' ~ BIO_FRIENDS_ENEMIES_LENGTH_LIMIT ~ ' characters', 'Enter your enemies on the site...', false, false, BIO_FRIENDS_ENEMIES_LENGTH_LIMIT)}} + + {{common.text_area_section('profile-signature', '/settings/personal', 'sig', 'Signature', v.sig, 'Limit of 200 characters', 'Enter a signature...', true, false, 200)}} + {{common.toggle_section('Private Mode', 'privateswitch', 'private', v.is_private, 'This will hide your profile page from others.', false)}} {{common.toggle_section('Spider', 'spiderswitch', 'spider', v.spider, 'Have a spider friend accompany you during your journey on the site.', v.spider > 1)}} {{common.toggle_section('Marsify', 'marsify', 'marsify', v.marsify, 'Automatically insert relevant marseys into your future comments.', v.marsify > 1)}} + +
+
Checkmark Customization
+
+ {{common.color_section('verifiedcolor', '/settings/verifiedcolor', 'verifiedcolor', 'Checkmark Color', v.verifiedcolor)}} + + {{common.line_text_section('checkmark_text', '/settings/checkmark_text', 'checkmark-text', 'Checkmark Hover Text', v.verified, 'Limit of 100 characters', 'Enter checkmark hover text here', 'Change Text', false, 0, 100, '.*', false)}} +
+
+
Filters