diff options
Diffstat (limited to 'notes/templates')
-rw-r--r-- | notes/templates/edit.html | 31 | ||||
-rw-r--r-- | notes/templates/index.html | 27 | ||||
-rw-r--r-- | notes/templates/view.html | 15 |
3 files changed, 73 insertions, 0 deletions
diff --git a/notes/templates/edit.html b/notes/templates/edit.html new file mode 100644 index 0000000..6d2ec1e --- /dev/null +++ b/notes/templates/edit.html @@ -0,0 +1,31 @@ +{% extends request.is_ajax|yesno:"blank.html,index.html" %} + +{% block content %} +<div data-role="page"> + <div data-role="header"> + <a href="/notes/" data-icon="arrow-l">Notes</a> + <h1>New Note</h1> + <a href="/notes/" id="done">Done</a> + </div> + <div data-role="content"> + <form action="" method="post" id="noteForm" enctype="multipart/form-data"> + {% csrf_token %} + {{ form }} + <button type="submit" data-theme="b">Save</button> + {% if form.is_bound %} + <a href="delete/" data-role="button">Delete</a> + {% endif %} + </form> + </div> +</div> + +<script type="text/javascript"> + $(function(){ + $('#id_title').focus(); + }); + $('#done').click(function(e){ + e.preventDefault(); + $('#noteForm').submit(); + }); +</script> +{% endblock content %} diff --git a/notes/templates/index.html b/notes/templates/index.html new file mode 100644 index 0000000..c996511 --- /dev/null +++ b/notes/templates/index.html @@ -0,0 +1,27 @@ +{% extends request.is_ajax|yesno:"blank.html,default.html" %} + +{% block content %} +<div data-role="page"> + <div data-role="header" data-position="fixed"> + <a href="#tagPopup" data-icon="gear" data-rel="popup">Tags</a> + <h1>Notes</h1> + <a href="/notes/new/" class="ui-btn-right">New</a> + </div> + <div data-role="content"> + <ul data-role="listview" data-filter="true"> + {% for n in notes %} + <li><a href="{{ n.get_absolute_url }}">{{ n.title }}<p class="ui-li-aside ui-li-desc">{{ n.user.username }} @ {{ n.updated_at|date:"SHORT_DATE_FORMAT" }}</p></a></li> + {% endfor %} + </ul> + + <div data-role="popup" id="tagPopup"> + <ul data-role="listview" data-inset="true"> + {% for t in tags %} + <li><a href="/notes/tag/{{ t.pk }}/">{{ t.title }} <span class="ui-li-count">{{ t.note_set.count }}</span></a></li> + {% endfor %} + </ul> + </div> + </div> +</div> + +{% endblock content %} diff --git a/notes/templates/view.html b/notes/templates/view.html new file mode 100644 index 0000000..a6d3473 --- /dev/null +++ b/notes/templates/view.html @@ -0,0 +1,15 @@ +{% extends request.is_ajax|yesno:"blank.html,index.html" %} +{% load markup %} + +{% block content %} +<div data-role="page"> + <div data-role="header"> + <a href="/notes/" data-icon="arrow-l">Notes</a> + <h1>{{ note.title }}</h1> + <a href="{{ note.get_absolute_url }}edit/">Edit</a> + </div> + <div data-role="content"> + <p>{{ version.content|restructuredtext }}</p> + </div> +</div> +{% endblock content %} |