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

@@ -13,14 +13,33 @@
</head>
<body onload="startup();">
<!-- Header -->
<div class="settings"><a href="/public_notes">Public notes</a> {% if authenticated %}<a href="/user/edit">Settings</a> <a href="/disconnect">Disconnect</a><br/>
<div class="settings"><a href="/public_notes">Public notes</a> {% if authenticated %}<a href="/templates">Templates</a> <a href="/user/edit">Settings</a> <a href="/disconnect">Disconnect</a><br/>
{% endif %}
<form action="/search" method="post">{% csrf_token %}<input name="text"/><input type="submit" value="Search"/></form></div>
<!-- Left panel -->
<div id="left_panel">
<a id="home_icon" href="/" alt="Home"><img src="{{ STATIC_URL }}images/home.png"/></a><br/><br/>
{% if authenticated %}
<a href="/note/add">Add a note</a>
<form id="form_note_add" action="/note/add" method="POST">
{% csrf_token %}
<a href="#" onclick="document.getElementById('form_note_add').submit();">Add a note</a>
{% if templates_by_name|length != 0 %}
<br/>
<select name="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>
<br/>
{% else %}
<input type="hidden" name="template" value="-1"/>
{% endif %}
</form>
{% endif %}
{% block left %} {% endblock %}
</div>