diff --git a/files/classes/user.py b/files/classes/user.py index ab3981851..8fd51f34d 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -27,6 +27,7 @@ class User(Base, Stndrd, Age_times): background = Column(String) customtitle = Column(String) customtitleplain = Column(String) + quadrant = Column(String) titlecolor = Column(String, default=defaultcolor) theme = Column(String, default=defaulttheme) themecolor = Column(String, default=defaultcolor) diff --git a/files/routes/settings.py b/files/routes/settings.py index da9cfbb2b..0a617f189 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -168,6 +168,37 @@ def settings_profile_post(v): g.db.add(v) return "", 204 + quadrant = request.values.get("quadrant") + if quadrant and "pcm" in request.host.lower(): + v.quadrant = quadrant + v.customtitle = quadrant + if quadrant=="LibLeft": + v.namecolor = "62ca56" + v.titlecolor = "62ca56" + elif quadrant=="LibRight": + v.namecolor = "f8db58" + v.titlecolor = "f8db58" + elif quadrant=="AuthLeft": + v.namecolor = "ff0000" + v.titlecolor = "ff0000" + elif quadrant=="AuthRight": + v.namecolor = "2a96f3" + v.titlecolor = "2a96f3" + elif quadrant=="LibCenter": + v.namecolor = "add357" + v.titlecolor = "add357" + elif quadrant=="AuthCenter": + v.namecolor = "954b7a" + v.titlecolor = "954b7a" + elif quadrant=="Left": + v.namecolor = "b1652b" + v.titlecolor = "b1652b" + elif quadrant=="Right": + v.namecolor = "91b9A6" + v.titlecolor = "91b9A6" + g.db.add(v) + return "", 204 + if updated: g.db.add(v) diff --git a/files/templates/comments.html b/files/templates/comments.html index 06aff5b6a..ba58d923d 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -138,7 +138,7 @@ {% if c.author.verified %} {% endif %} - {{c.author.username}}{% if c.author.customtitle %}  {{c.author.customtitle | safe}}{% endif %} + {{c.author.username}}{% if c.author.customtitle %}  {% if c.author.quadrant %}{{c.author.customtitle | safe}}{% endif %}  {{c.age_string}} {% if c.edited_utc %} diff --git a/files/templates/submission.html b/files/templates/submission.html index 956a7329d..ee32ab68e 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -260,7 +260,7 @@ {% if p.active_flags %}{{p.active_flags}} Reports{% endif %} {% if p.author.verified %} {% endif %} - {{p.author.username}}{% if p.author.customtitle %}  {{p.author.customtitle | safe}}{% endif %} + {{p.author.username}}{% if p.author.customtitle %}  {% if p.author.quadrant %}{{p.author.customtitle | safe}}{% endif %}  {{p.age_string}} ({% if p.realurl(v) %}{{p.domain}}{% else %}text post{% endif %}) diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index 0b4181be1..ef57267e3 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -108,7 +108,7 @@ {% if p.active_flags %}{{p.active_flags}} Reports{% endif %} {% if p.author.verified %} {% endif %} - {{p.author.username}}{% if p.author.customtitle %}  {{p.author.customtitle | safe}}{% endif %} + {{p.author.username}}{% if p.author.customtitle %}  {% if p.author.quadrant %}{{p.author.customtitle | safe}}{% endif %}  {{p.age_string}}   ({% if p.realurl(v) %}{{p.domain}}{% else %}text post{% endif %}) diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 623e5d8a5..b6a791fcb 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -152,7 +152,7 @@ - {% if u.customtitle %}

{{u.customtitle | safe}}

{% endif %} + {% if u.customtitle %}

{% if u.quadrant %}{{u.customtitle | safe}}

{% endif %}
{{u.coins}} {{"COINS_NAME" | app_config}}   {% if u.stored_subscriber_count >=1 and not u.is_nofollow %}{{u.stored_subscriber_count}} follower{{'s' if u.stored_subscriber_count != 1 else ''}}   {% endif %}joined {{u.created_date}} @@ -370,7 +370,7 @@ {% if v and v.has_follower(u) and not v.is_nofollow %} Follows you {% endif %} - {% if u.customtitle %}

{{u.customtitle | safe}}

{% endif %} + {% if u.customtitle %}

{% if u.quadrant %}{{u.customtitle | safe}}

{% endif %}
{{u.coins}} {{"COINS_NAME" | app_config}}  {% if u.stored_subscriber_count >=1 and not u.is_nofollow %}{{u.stored_subscriber_count}} follower{{'s' if u.stored_subscriber_count != 1 else ''}}   {% endif %}
joined {{u.created_date}}