Merge branch 'themes'
This commit is contained in:
commit
02a01bdacf
4 changed files with 26 additions and 5 deletions
|
@ -5,16 +5,20 @@ client = MongoClient()
|
|||
accounts_db = client.tweeder.accounts
|
||||
|
||||
|
||||
def get_theme(username):
|
||||
username = username.lower()
|
||||
return accounts_db.find_one({"username": username})['theme']
|
||||
|
||||
|
||||
def set_theme(username, value):
|
||||
username = username.lower()
|
||||
accounts_db.update_one({'username': username}, {"$set": {"theme": value}})
|
||||
|
||||
|
||||
def get_theme(username):
|
||||
username = username.lower()
|
||||
if "themes" in accounts_db.find_one({"username": username}).keys():
|
||||
return accounts_db.find_one({"username": username})['theme']
|
||||
else:
|
||||
set_theme(username, "default")
|
||||
return "default"
|
||||
|
||||
|
||||
def get_display_name(username):
|
||||
return accounts_db.find_one({'username': username})['displayname']
|
||||
|
||||
|
|
12
static/materia.css
Normal file
12
static/materia.css
Normal file
File diff suppressed because one or more lines are too long
|
@ -8,6 +8,7 @@
|
|||
<script src="{{ url_for('static', filename ='fontawesome-all.js') }}"></script>
|
||||
{% if theme=="darkly" %}<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename = 'darkly.css') }}" />{% endif %}
|
||||
{% if theme=="cyborg" %}<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename = 'cyborg.css') }}" />{% endif %}
|
||||
{% if theme=="materia" %}<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename = 'materia.css') }}" />{% endif %}
|
||||
<title>{{ title }} - Tweeder</title>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -43,6 +43,10 @@
|
|||
<input type="radio" id="customRadioInline3" name="theme" value="cyborg" class="custom-control-input" {% if theme=="cyborg" %}checked{% endif %}>
|
||||
<label class="custom-control-label" for="customRadioInline3">Cyborg</label>
|
||||
</div>
|
||||
<div class="custom-control custom-radio custom-control-inline">
|
||||
<input type="radio" id="customRadioInline4" name="theme" value="materia" class="custom-control-input" {% if theme=="materia" %}checked{% endif %}>
|
||||
<label class="custom-control-label" for="customRadioInline4">Materia</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">Save</button>
|
||||
|
|
Loading…
Add table
Reference in a new issue