titlecolor -> flaircolor

master
Aevann 2023-10-17 21:54:02 +03:00
parent 9df3fceef4
commit ebcc561c03
9 changed files with 16 additions and 16 deletions

View File

@ -58,7 +58,7 @@ class User(Base):
profile_background = Column(String) profile_background = Column(String)
flair = deferred(Column(String)) flair = deferred(Column(String))
flair_html = Column(String) flair_html = Column(String)
titlecolor = Column(String, default=DEFAULT_COLOR) flaircolor = Column(String, default=DEFAULT_COLOR)
theme = Column(String, default=DEFAULT_THEME) theme = Column(String, default=DEFAULT_THEME)
themecolor = Column(String, default=DEFAULT_COLOR) themecolor = Column(String, default=DEFAULT_COLOR)
song = Column(String) song = Column(String)

View File

@ -426,14 +426,14 @@ def namecolor(v):
def themecolor(v): def themecolor(v):
return set_color(v, "themecolor") return set_color(v, "themecolor")
@app.post("/settings/titlecolor") @app.post("/settings/flaircolor")
@limiter.limit('1/second', scope=rpath) @limiter.limit('1/second', scope=rpath)
@limiter.limit('1/second', scope=rpath, key_func=get_ID) @limiter.limit('1/second', scope=rpath, key_func=get_ID)
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400) @limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400)
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID) @limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID)
@auth_required @auth_required
def titlecolor(v): def flaircolor(v):
return set_color(v, "titlecolor") return set_color(v, "flaircolor")
@app.post("/settings/verifiedcolor") @app.post("/settings/verifiedcolor")
@limiter.limit('1/second', scope=rpath) @limiter.limit('1/second', scope=rpath)

View File

@ -176,10 +176,10 @@
<span {% if c.author.patron and not c.distinguish_level %}class="patron" style="background-color:#{{c.author.name_color}}"{% elif c.distinguish_level %}class="mod {% if SITE_NAME == 'rDrama' %}mod-rdrama{% endif %}"{% endif %} {% if c.author.pride_username(v) %}pride_username{% endif %}>{{c.author_name}}</span> <span {% if c.author.patron and not c.distinguish_level %}class="patron" style="background-color:#{{c.author.name_color}}"{% elif c.distinguish_level %}class="mod {% if SITE_NAME == 'rDrama' %}mod-rdrama{% endif %}"{% endif %} {% if c.author.pride_username(v) %}pride_username{% endif %}>{{c.author_name}}</span>
</a> </a>
{% if FEATURES['PRONOUNS'] %} {% if FEATURES['PRONOUNS'] %}
<span class="pronouns" style="color:#{{c.author.titlecolor}} !important;border-color:#{{c.author.titlecolor}} !important">{{c.author.pronouns_display}}</span> <span class="pronouns" style="color:#{{c.author.flaircolor}} !important;border-color:#{{c.author.flaircolor}} !important">{{c.author.pronouns_display}}</span>
{% endif %} {% endif %}
{% if c.author.flair_html %} {% if c.author.flair_html %}
&nbsp;<bdi class="text-break" style="color: #{{c.author.titlecolor}}">&nbsp;{{c.author.flair_html | safe}}</bdi> &nbsp;<bdi class="text-break" style="color: #{{c.author.flaircolor}}">&nbsp;{{c.author.flair_html | safe}}</bdi>
{% endif %} {% endif %}
{% endif %} {% endif %}

View File

@ -209,7 +209,7 @@
{{common.line_text_section('flair', '/settings/change_flair', 'flair', 'Flair', v.flair, 'Limit of 100 characters', 'Enter a flair here', 'Change Flair', true, 0, 100, '.*', v.flairchanged)}} {{common.line_text_section('flair', '/settings/change_flair', 'flair', 'Flair', v.flair, '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)}} {{common.color_section('flaircolor', '/settings/flaircolor', 'flaircolor', 'Flair Color', v.flaircolor)}}
{% if FEATURES['USERS_PROFILE_SONG'] -%} {% if FEATURES['USERS_PROFILE_SONG'] -%}
<div class="d-lg-flex border-bottom"> <div class="d-lg-flex border-bottom">

View File

@ -64,11 +64,11 @@
</div> </div>
{% if FEATURES['PRONOUNS'] and can_see(v, u) %} {% if FEATURES['PRONOUNS'] and can_see(v, u) %}
<p class="font-weight-bolder" id="profile--pronouns" style="color: #{{u.titlecolor}}">{{u.pronouns_display}}</p> <p class="font-weight-bolder" id="profile--pronouns" style="color: #{{u.flaircolor}}">{{u.pronouns_display}}</p>
{% endif %} {% endif %}
{% if u.flair_html and can_see(v, u) %} {% if u.flair_html and can_see(v, u) %}
<p class="font-weight-bolder" id="profile--flair" style="color: #{{u.titlecolor}}">{{u.flair_html | safe}}</p> <p class="font-weight-bolder" id="profile--flair" style="color: #{{u.flaircolor}}">{{u.flair_html | safe}}</p>
{% endif %} {% endif %}
<div class="font-weight-bolder mb-2" id="profile--simphate"> <div class="font-weight-bolder mb-2" id="profile--simphate">
@ -359,11 +359,11 @@
{% endif %} {% endif %}
{% if FEATURES['PRONOUNS'] and can_see(v, u) %} {% if FEATURES['PRONOUNS'] and can_see(v, u) %}
<p style="color: #{{u.titlecolor}}" id="profile-mobile--pronouns">{{u.pronouns_display}}</p> <p style="color: #{{u.flaircolor}}" id="profile-mobile--pronouns">{{u.pronouns_display}}</p>
{% endif %} {% endif %}
{% if u.flair_html and can_see(v, u) %} {% if u.flair_html and can_see(v, u) %}
<p style="color: #{{u.titlecolor}}" id="profile-mobile--flair">{{u.flair_html | safe}}</p> <p style="color: #{{u.flaircolor}}" id="profile-mobile--flair">{{u.flair_html | safe}}</p>
{% endif %} {% endif %}
<div class="font-weight-bolder mb-2" id="profile-mobile--simphate"> <div class="font-weight-bolder mb-2" id="profile-mobile--simphate">

View File

@ -88,10 +88,10 @@
<span {% if p.author.patron and not p.distinguish_level %}class="patron" style="background-color:#{{p.author.name_color}}"{% elif p.distinguish_level %}class="mod {% if SITE_NAME == 'rDrama' %}mod-rdrama{% endif %}"{% endif %} {% if p.author.pride_username(v) %}pride_username{% endif %}>{{p.author_name}}</span> <span {% if p.author.patron and not p.distinguish_level %}class="patron" style="background-color:#{{p.author.name_color}}"{% elif p.distinguish_level %}class="mod {% if SITE_NAME == 'rDrama' %}mod-rdrama{% endif %}"{% endif %} {% if p.author.pride_username(v) %}pride_username{% endif %}>{{p.author_name}}</span>
</a> </a>
{% if FEATURES['PRONOUNS'] %} {% if FEATURES['PRONOUNS'] %}
<span class="pronouns" style="color:#{{p.author.titlecolor}} !important;border-color:#{{p.author.titlecolor}} !important">{{p.author.pronouns_display}}</span> <span class="pronouns" style="color:#{{p.author.flaircolor}} !important;border-color:#{{p.author.flaircolor}} !important">{{p.author.pronouns_display}}</span>
{% endif %} {% endif %}
{% if p.author.flair_html %} {% if p.author.flair_html %}
<bdi class="text-break ml-2" style="color: #{{p.author.titlecolor}}">{{p.author.flair_html | safe}}</bdi> <bdi class="text-break ml-2" style="color: #{{p.author.flaircolor}}">{{p.author.flair_html | safe}}</bdi>
{% endif %} {% endif %}
{% endif %} {% endif %}
<span class="ml-2 d-inline-block" data-bs-toggle="tooltip" data-bs-placement="bottom" data-nonce="{{g.nonce}}" data-onmouseover="timestamp(this, '{{p.created_utc}}')" id="timestamp-{{p.id}}">&nbsp;{{p.age_string}}</span> <span class="ml-2 d-inline-block" data-bs-toggle="tooltip" data-bs-placement="bottom" data-nonce="{{g.nonce}}" data-onmouseover="timestamp(this, '{{p.created_utc}}')" id="timestamp-{{p.id}}">&nbsp;{{p.age_string}}</span>

View File

@ -0,0 +1 @@
alter table users rename column titlecolor to flaircolor;

View File

@ -98,7 +98,7 @@ CREATE TABLE public.users (
defaultsorting character varying(15) NOT NULL, defaultsorting character varying(15) NOT NULL,
defaulttime character varying(5) NOT NULL, defaulttime character varying(5) NOT NULL,
namecolor character varying(6) NOT NULL, namecolor character varying(6) NOT NULL,
titlecolor character varying(6) NOT NULL, flaircolor character varying(6) NOT NULL,
profileurl character varying(65), profileurl character varying(65),
bannerurl character varying(65), bannerurl character varying(65),
newtab boolean DEFAULT false NOT NULL, newtab boolean DEFAULT false NOT NULL,
@ -3047,4 +3047,3 @@ ALTER TABLE ONLY public.comments
-- --
-- PostgreSQL database dump complete -- PostgreSQL database dump complete
-- --

View File

@ -1,6 +1,6 @@
INSERT INTO public.users ( INSERT INTO public.users (
username, passhash, created_utc, admin_level, email_verified, username, passhash, created_utc, admin_level, email_verified,
original_username, defaultsorting, defaultsortingcomments, defaulttime, namecolor, titlecolor, theme, themecolor, original_username, defaultsorting, defaultsortingcomments, defaulttime, namecolor, flaircolor, theme, themecolor,
reddit, pronouns, verified, profileurl, highres, reddit, pronouns, verified, profileurl, highres,
marsify, last_viewed_post_notifs, last_viewed_log_notifs, last_viewed_reddit_notifs, lifetimedonated, lifetimedonated_visible, show_sigs marsify, last_viewed_post_notifs, last_viewed_log_notifs, last_viewed_reddit_notifs, lifetimedonated, lifetimedonated_visible, show_sigs
) VALUES ) VALUES