Add templates management

This commit is contained in:
Gregory Soutade
2016-06-30 20:13:15 +02:00
parent d3327f13a2
commit b983d6d3f1
9 changed files with 280 additions and 18 deletions

View File

@@ -8,6 +8,20 @@
<form action="/user/edit" method="post">
{% csrf_token %}
{{ form.as_p }}
<p>
<label for="id_default_template">Default template:</label>
<select id="id_default_template" name="default_template">
<option value="-1">None</option>
{% for template in templates_by_name %}
{% if template.id == user.default_template.id %}
<option value="{{ template.id }}" selected="1">{{ template.name }}</option>
{% else %}
<option value="{{ template.id }}">{{ template.name }}</option>
{% endif %}
{% endfor %}
</select>
</p>
<input type="submit" name="edit" value="Edit" /><input type="submit" name="cancel" value="Cancel" /><input type="submit" name="delete" value="Delete" onclick="return confirm('Do you really want to delete your account ?')"/>
</form>
{% endblock %}