Coverage for ivatar/ivataraccount/templates/preferences.html: 93%
56 statements
« prev ^ index » next coverage.py v7.6.9, created at 2024-12-26 00:11 +0000
« prev ^ index » next coverage.py v7.6.9, created at 2024-12-26 00:11 +0000
1{% extends 'base.html' %}
2{% load i18n %}
3{% load static %}
5{% block title %}{% trans 'Your Preferences' %}{% endblock title %}
7{% block content %}
8<h1>{% trans 'Account settings' %}</h1>
10<label for="id_username">{% trans 'Username' %}:</label>
11<input type="text" name="username" class="form-control" id="id_username" disabled value="{{ user.username }}" style="max-width:600px;">
12<form action="{% url 'user_preference' %}" method="post">{% csrf_token %}
13 <div class="form-group">
14 <label for="id_first_name">{% trans 'Firstname' %}:</label>
15 <input type="text" name="first_name" class="form-control" id="id_first_name" value="{{ user.first_name }}" style="max-width:600px;">
16 <label for="id_last_name">{% trans 'Lastname' %}:</label>
17 <input type="text" name="last_name" class="form-control" id="id_last_name" value="{{ user.last_name }}" style="max-width:600px;">
19 <label for="id_email">{% trans 'E-mail address' %}:</label>
20 <select name="email" class="form-control" id="id_email" style="max-width:600px;">
21 <option value="{{ user.email }}" selected>{{ user.email }}</option>
22 {% for confirmed_email in user.confirmedemail_set.all %}
23 {% if user.email != confirmed_email.email %}
24 <option value="{{ confirmed_email.email }}">{{ confirmed_email.email }}</option>
25 {% endif %}
26 {% endfor %}
27 </select>
28 </div>
29 <input type="hidden" name="theme" value="{{ user.userpreference.theme }}"/>
30 <button type="submit" class="button">{% trans 'Save' %}</button>
31</form>
33<!-- TODO: Language stuff not yet fully implemented; Esp. translations are only half-way there
35<h2>{% trans 'Language' %}</h2>
36<form action="{% url 'set_language' %}" method="post">{% csrf_token %}
37 <div class="form-group">
38 {% get_current_language as LANGUAGE_CODE %}
39 {% get_available_languages as LANGUAGES %}
40 {% get_language_info_list for LANGUAGES as languages %}
41 {% for language in languages %}
42 <div class="radio">
43 <input type="radio" name="language" value="{{ language.code }}" id="language-{{ language.code }}"
44 {% if language.code == LANGUAGE_CODE %}checked{% endif %}>
45 <label for="language-{{ language.code }}">{{ language.name_local }}</label>
46 </div>
47 {% endfor %}
48 </div>
49 <br/>
50 <button type="submit" class="button">{% trans 'Save' %}</button>
51</form>
53-->
55<div style="height:100px"></div>
57<!-- <p><a href="{% url 'export' %}" class="button">{% trans 'Export your data' %}</a></p> -->
59<!-- TODO: Better coloring of the button -->
60<p><a href="{% url 'delete' %}" class="button" style="background:red; color:white;">{% trans 'Permanently delete your account' %}</a></p>
61<div style="height:2rem"></div>
62{% endblock content %}