forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2021-10-09 09:21:22 +02:00
parent abd473e3a9
commit f074335f64
6 changed files with 5 additions and 23 deletions

View File

@ -1,7 +0,0 @@
for theme in ['transparent', 'win98', 'midnight', 'dark', 'light', 'coffee', 'tron', '4chan']:
with open(f"./files/assets/css/{theme}_ff66ac.css", encoding='utf-8') as t:
text = t.read()
for color in ['ff66ac','805ad5','62ca56','38a169','80ffff','2a96f3','62ca56','eb4963','ff0000','f39731','30409f','3e98a7','e4432d','7b9ae4','ec72de','7f8fa6', 'f8db58']:
newtext = text.replace("ff66ac", color).replace("ff4097", color).replace("ff1a83", color).replace("ff3390", color).replace("rgba(255, 102, 172, 0.25)", color)
with open(f"./files/assets/css/{theme}_{color}.css", encoding='utf-8', mode='w') as nt:
nt.write(newtext)

View File

@ -18,7 +18,7 @@ import random
site = environ.get("DOMAIN").strip()
site_name = environ.get("SITE_NAME").strip()
defaulttheme = environ.get("DEFAULT_THEME", "light").strip()
defaulttheme = environ.get("DEFAULT_THEME", "midnight").strip()
defaultcolor = environ.get("DEFAULT_COLOR", "fff").strip()
defaulttimefilter = environ.get("DEFAULT_TIME_FILTER", "all").strip()
cardview = bool(int(environ.get("CARD_VIEW", 1)))

View File

@ -1,8 +1,6 @@
from sqlalchemy import *
from sqlalchemy.orm import relationship
from files.__main__ import Base
from files.helpers.lazy import lazy
import time
class UserBlock(Base):
@ -15,10 +13,4 @@ class UserBlock(Base):
target = relationship("User", primaryjoin="User.id==UserBlock.target_id", viewonly=True)
def __repr__(self):
return f"<UserBlock(user={user.username}, target={target.username})>"
@property
@lazy
def created_date(self):
return time.strftime("%d %b %Y", time.gmtime(self.created_utc))
return f"<UserBlock(user={self.user_id}, target={self.target_id})>"

View File

@ -199,9 +199,6 @@ def settings_profile_post(v):
theme = request.values.get("theme")
if theme:
v.theme = theme
if theme == "coffee" or theme == "4chan": v.themecolor = "38a169"
elif theme == "tron": v.themecolor = "80ffff"
elif theme == "win98": v.themecolor = "30409f"
updated = True
quadrant = request.values.get("quadrant")

View File

@ -97,9 +97,9 @@
<div class="input-group mb2">
<select id='theme' class="form-control" form="profile-settings" name="theme" onchange="post_toast('/settings/profile?theme='+document.getElementById('theme').value, '1')">
{% if v.background %}
{% set entries = ["transparent", "win98", "dark", "light", "coffee", "tron", "4chan", "midnight"] %}
{% set entries = ["transparent", "win98", "dark", "coffee", "tron", "4chan", "midnight"] %}
{% else %}
{% set entries = ["dark", "win98", "light", "coffee", "tron", "4chan", "midnight"] %}
{% set entries = ["dark", "win98", "coffee", "tron", "4chan", "midnight"] %}
{% endif %}
{% for entry in entries %}
<option value="{{entry}}" {% if v.theme==entry %} selected {% endif %}>

View File

@ -386,7 +386,7 @@
</div>
{% if p.embed_url %}
{% if p.domain == "twitter.com" and (v and v.theme.split("_")[0] in ["light", "coffee", "4chan"]) %}
{% if p.domain == "twitter.com" and (v and v.theme.split("_")[0] in ["coffee", "4chan"]) %}
{% include "embeds/twitterlight.html" %}
{% elif "twitter.com" in p.domain %}
{% include "embeds/twitter.html" %}