Merge branch 'master' into 'master'

Improved theme select in preferences.html

See merge request oliver/ivatar!90
This commit is contained in:
Oliver Falk
2018-12-05 09:10:33 +01:00

View File

@@ -5,16 +5,34 @@
{% block title %}{% trans 'Your Preferences' %}{% endblock title %} {% block title %}{% trans 'Your Preferences' %}{% endblock title %}
{% block content %} {% block content %}
<style>
input[type=radio] {display:none}
input[type=radio] + label {
padding-left:0;
}
input[type=radio] + label:before {
font-family: FontAwesome;
display: inline-block;
letter-spacing:5px;
font-size:20px;
color:#36b7d7;
vertical-align:middle;
}
input[type=radio] + label:before {content: "\f10c"}
input[type=radio]:checked + label:before {content: "\f192"}
</style>
<h1>{% trans 'Account settings' %}</h1> <h1>{% trans 'Account settings' %}</h1>
<p> <p>
<form method="post" action="{% url 'user_preference' %}">{% csrf_token %} <form method="post" action="{% url 'user_preference' %}">{% csrf_token %}
<div class="form-group"> <div class="form-group">
<select name='theme' class="form-control" style="width:200px;">
{% for theme in THEMES %} {% for theme in THEMES %}
<option {% if user.userpreference.theme == theme.0 %}selected{% endif %} value="{{ theme.0 }}">{{ theme.1 }}</option> <div class="radio">
<input type="radio" name="theme" value="{{ theme.0 }}" id="theme-{{ theme.0 }}" {% if user.userpreference.theme == theme.0 %}checked{% endif %}>
<label for="theme-{{ theme.0 }}">{{ theme.1 }}</label>
</div>
{% endfor %} {% endfor %}
</select>
<br/> <br/>
<button type="submit" class="btn btn-default">{% trans 'Save' %}</button> <button type="submit" class="btn btn-default">{% trans 'Save' %}</button>
</div> </div>