diff options
Diffstat (limited to 'design/templates/notes')
-rw-r--r-- | design/templates/notes/notebook_create.html | 46 | ||||
-rw-r--r-- | design/templates/notes/notebook_detail.html | 49 | ||||
-rw-r--r-- | design/templates/notes/notes_detail.html | 38 | ||||
-rw-r--r-- | design/templates/notes/notes_list.html | 34 | ||||
-rw-r--r-- | design/templates/notes/notes_listold.html | 9 |
5 files changed, 166 insertions, 10 deletions
diff --git a/design/templates/notes/notebook_create.html b/design/templates/notes/notebook_create.html new file mode 100644 index 0000000..8ffc94a --- /dev/null +++ b/design/templates/notes/notebook_create.html @@ -0,0 +1,46 @@ +{% extends 'base.html' %} + +{% block extrastyles %} +<link rel="stylesheet" href="/media/quill.snow.css" /> +{% endblock %} +{% block content %} +<main> + <article class="note-container"> + <form id="new-notebook-form" action="{% url 'notebook-api-list' %}" method="post"> +{% csrf_token %} +{{ form.non_field_errors }} +{% for field in form %} +<fieldset class="{% if field.errors %}error {%endif%}{% if field.name == 'body_qjson' or field.name == 'body_html' %}hide {%endif%}" id="fs-{{field.name}}" > +{{field.label_tag}} +{{field}} +{% if field.errors %}{{field.errors}}{% endif %} +</fieldset> +{% endfor %} +<p><input class="btn btn-inline" value="create" type="submit" /></p> +</form> + <ul>{% for object in notebook_list %} + <li> + <a href="{% url 'notes:notebook-detail' user.username object.slug %}"><i class="icon-notebook"> </i>{{object.name}}</a> + </li> + {%endfor%}</ul> + </article> + <aside class="note-list-container"> + <div class="svg-wrapper"><svg class="svg-icon-arrow"> + <svg viewBox="0 0 16 13" id="shape-double-arrow" width="100%" height="100%"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="square"><g id="Showing-post-info" transform="translate(-297.000000, -105.000000)" stroke="currentColor"><g transform="translate(305.000000, 111.500000) scale(-1, 1) rotate(-180.000000) translate(-305.000000, -111.500000) translate(297.000000, 105.000000)"><path d="M2.20710678,6.5 L6.85355339,1.85355339 L7.20710678,1.5 L6.5,0.792893219 L6.14644661,1.14644661 L1.14644661,6.14644661 L1.05805826,6.23483496 L0.792893219,6.5 L1.14644661,6.85355339 L6.14644661,11.8535534 L6.5,12.2071068 L7.20710678,11.5 L6.85355339,11.1464466 L2.20710678,6.5 Z" id="Combined-Shape"></path><path d="M10.2071068,6.5 L14.8535534,1.85355339 L15.2071068,1.5 L14.5,0.792893219 L14.1464466,1.14644661 L9.14644661,6.14644661 L9.05805826,6.23483496 L8.79289322,6.5 L9.14644661,6.85355339 L14.1464466,11.8535534 L14.5,12.2071068 L15.2071068,11.5 L14.8535534,11.1464466 L10.2071068,6.5 Z" id="Combined-Shape"></path></g></g></g></svg> + </svg></div> + <div class=""> + <ul class="list-note-preview">{% for obj in notes_list %} + <li> + <a href="{% url 'notes:note-detail' user.username obj.slug %}"> + <h4>{{obj.title}}</h4> + <div class="note-preview">{{obj.body_text|truncatewords:12}}</div> + </a> + </li> + {% endfor %}</ul> + </div> + </aside> + <div class="balance-container"> + </div> +</main> +{% endblock %} + diff --git a/design/templates/notes/notebook_detail.html b/design/templates/notes/notebook_detail.html new file mode 100644 index 0000000..36873e1 --- /dev/null +++ b/design/templates/notes/notebook_detail.html @@ -0,0 +1,49 @@ +{% extends 'base.html' %} + +{% block content %} +<main> + <article class="note-container"> + {%comment%} + <form id="new-note-form" action="{% url 'notebook-api-list' %}" method="post"> + <label>Create a new notebook</label> + {% csrf_token %} + {{ form.non_field_errors }} + {% for field in form %} + <fieldset class="{% if field.errors %}error {%endif%}{% if field.name == 'body_qjson' or field.name == 'body_html' %}hide {%endif%}" id="fs-{{field.name}}" > + {{field.label_tag}} + {{field}} + {% if field.errors %}{{field.errors}}{% endif %} + </fieldset> + {% endfor %} + <p><input class="btn btn-inline" value="create" type="submit" /></p> + </form> + {%endcomment%} +{{object}} + <ul class="list-note-preview">{% for obj in object.note_set.all %} + <li> + <a href="{% url 'notes:note-detail' user.username obj.slug %}"> + <h4>{{obj.title}}</h4> + <div class="note-preview">{{obj.body_text|truncatewords:36}}</div> + </a> + </li> + {% endfor %}</ul> + </article> + <aside class="note-list-container"> + <div class="svg-wrapper"><svg class="svg-icon-arrow"> + <svg viewBox="0 0 16 13" id="shape-double-arrow" width="100%" height="100%"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="square"><g id="Showing-post-info" transform="translate(-297.000000, -105.000000)" stroke="currentColor"><g transform="translate(305.000000, 111.500000) scale(-1, 1) rotate(-180.000000) translate(-305.000000, -111.500000) translate(297.000000, 105.000000)"><path d="M2.20710678,6.5 L6.85355339,1.85355339 L7.20710678,1.5 L6.5,0.792893219 L6.14644661,1.14644661 L1.14644661,6.14644661 L1.05805826,6.23483496 L0.792893219,6.5 L1.14644661,6.85355339 L6.14644661,11.8535534 L6.5,12.2071068 L7.20710678,11.5 L6.85355339,11.1464466 L2.20710678,6.5 Z" id="Combined-Shape"></path><path d="M10.2071068,6.5 L14.8535534,1.85355339 L15.2071068,1.5 L14.5,0.792893219 L14.1464466,1.14644661 L9.14644661,6.14644661 L9.05805826,6.23483496 L8.79289322,6.5 L9.14644661,6.85355339 L14.1464466,11.8535534 L14.5,12.2071068 L15.2071068,11.5 L14.8535534,11.1464466 L10.2071068,6.5 Z" id="Combined-Shape"></path></g></g></g></svg> + </svg></div> + <div class=""> + <ul class="list-note-preview">{% for obj in notes_list %} + <li> + <a href="{% url 'notes:note-detail' user.username obj.slug %}"> + <h4>{{obj.title}}</h4> + <div class="note-preview">{{obj.body_text|truncatewords:12}}</div> + </a> + </li> + {% endfor %}</ul> + </div> + </aside> + <div class="balance-container"> + </div> +</main> +{% endblock %} diff --git a/design/templates/notes/notes_detail.html b/design/templates/notes/notes_detail.html index bf46ab8..95583bd 100644 --- a/design/templates/notes/notes_detail.html +++ b/design/templates/notes/notes_detail.html @@ -10,12 +10,24 @@ <main> <article class="note-container"> <header class="note-header"> - <button class="hide btn btn-accent" id="edit-toggle-btn">Edit</button> - <div class="note-header-float"> + <div class="note-header-left"> + <span class="label">tags:</span> + <ul>{% for tag in object.tags.all %} + <li> + <a href="{% url 'notes:note-tag' user.username tag.slug %}">{{tag}}</a> + </li> + {%endfor%}</ul> + <div class="notebook"> + <span class="label">notebook:</span> + <a href="">{{object.notebook.name}}</a> + </div> + </div> + <div class="note-header-right"> <h2 class="note-time">{{object.date_created|date:"M d, Y"}}</h2> - {% if object.url %}<h3 class="note-url"><a class="btn btn-small btn-subtle" href="{{object.url}}">Source</a><a class="btn btn-small btn-subtle left-margin-2" href="object.cache">Archive</a></h3>{% endif %} + {% if object.url %}<h3 class="note-url"><a class="btn btn-small btn-subtle" href="{{object.url}}">Source</a><a class="btn btn-small btn-subtle right-padding-0 left-margin-2" href="object.cache">Archive</a></h3>{% endif %} </div> </header> + <div class="edit-btn-wrapper"><button class="hide btn btn-hollow" id="edit-toggle-btn">Edit</button></div> <h1 id="note-title" class="note-title">{{object.title}}</h1> <div id="q-container" class="inactive"><div id="note-body">{% if object.body_html %}{{object.body_html|safe}}{%else%}{{object.body_text}}{%endif%}</div></div> <form action="" method="post" id="note-edit-form">{% csrf_token %} @@ -26,8 +38,11 @@ </form> </article> <aside class="note-list-container"> + <div class="svg-wrapper"><svg class="svg-icon-arrow"> + <svg viewBox="0 0 16 13" id="shape-double-arrow" width="100%" height="100%"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="square"><g id="Showing-post-info" transform="translate(-297.000000, -105.000000)" stroke="currentColor"><g transform="translate(305.000000, 111.500000) scale(-1, 1) rotate(-180.000000) translate(-305.000000, -111.500000) translate(297.000000, 105.000000)"><path d="M2.20710678,6.5 L6.85355339,1.85355339 L7.20710678,1.5 L6.5,0.792893219 L6.14644661,1.14644661 L1.14644661,6.14644661 L1.05805826,6.23483496 L0.792893219,6.5 L1.14644661,6.85355339 L6.14644661,11.8535534 L6.5,12.2071068 L7.20710678,11.5 L6.85355339,11.1464466 L2.20710678,6.5 Z" id="Combined-Shape"></path><path d="M10.2071068,6.5 L14.8535534,1.85355339 L15.2071068,1.5 L14.5,0.792893219 L14.1464466,1.14644661 L9.14644661,6.14644661 L9.05805826,6.23483496 L8.79289322,6.5 L9.14644661,6.85355339 L14.1464466,11.8535534 L14.5,12.2071068 L15.2071068,11.5 L14.8535534,11.1464466 L10.2071068,6.5 Z" id="Combined-Shape"></path></g></g></g></svg> + </svg></div> <div class=""> - <ul>{% for obj in notes_list %} + <ul class="list-note-preview">{% for obj in notes_list %} <li> <a href="{% url 'notes:note-detail' user.username obj.slug %}"> <h4>{{obj.title}}</h4> @@ -37,12 +52,24 @@ {% endfor %}</ul> </div> </aside> + <div class="balance-container"> + </div> </main> {% endblock %} {% block jsinclude %} <script src="/media/js/highlight.pack.js"></script> <script src="/media/js/quill.min.js"></script> +<script> +document.addEventListener('readystatechange', event => { + if (event.target.readyState === "interactive") { + //initLoader(); + } + else if (event.target.readyState === "complete") { + initQuill("#note-body"); + } +}); +</script> {% endblock %} <script> {% block jsdomready %} @@ -56,8 +83,8 @@ window.editing = false; window.quillchange = false; + hljs.initHighlightingOnLoad(); btn.classList.remove('hide'); - initQuill("#note-body"); note_html.setAttribute('name', 'body_html'); note_html.setAttribute('class', 'hide'); note_html.setAttribute('id', 'id_body_html'); @@ -68,7 +95,6 @@ form.appendChild(note_qjson); document.getElementById("btn-js-hide").classList.add("hide"); btn.addEventListener('click', function(){edit_note(this, title, qcontainer, window.quill, "{% url 'notes-api-detail' object.pk %}" )}, false) - {%endblock%} </script> diff --git a/design/templates/notes/notes_list.html b/design/templates/notes/notes_list.html index 8066369..b1c1700 100644 --- a/design/templates/notes/notes_list.html +++ b/design/templates/notes/notes_list.html @@ -1,9 +1,35 @@ {% extends 'base.html' %} + {% block content %} <main> - <h1> Notes</h1> - <ul>{% for obj in object_list %} - <li><a href="{% url 'notes:note-detail' user.username obj.slug %}">{{obj}}</a></li> - {% endfor %}</ul> + <article class="note-container"> + <h1>Notes {% if tags|length == 1%} tagged {% for tag in tags%}{{tag}}{%endfor%}{%endif%}</h1> + <div>Tagged with: {% for tag in tags%}<a href="{{tag|slugify}}">{{tag}}</a>{%endfor%}</div> + <ul class="list-note-preview">{% for obj in object_list %} + <li> + <a href="{% url 'notes:note-detail' user.username obj.slug %}"> + <h4>{{obj.title}}</h4> + <div class="note-preview">{{obj.body_text|truncatewords:36}}</div> + </a> + </li> + {% endfor %}</ul> + </article> + <aside class="note-list-container"> + <div class="svg-wrapper"><svg class="svg-icon-arrow"> + <svg viewBox="0 0 16 13" id="shape-double-arrow" width="100%" height="100%"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="square"><g id="Showing-post-info" transform="translate(-297.000000, -105.000000)" stroke="currentColor"><g transform="translate(305.000000, 111.500000) scale(-1, 1) rotate(-180.000000) translate(-305.000000, -111.500000) translate(297.000000, 105.000000)"><path d="M2.20710678,6.5 L6.85355339,1.85355339 L7.20710678,1.5 L6.5,0.792893219 L6.14644661,1.14644661 L1.14644661,6.14644661 L1.05805826,6.23483496 L0.792893219,6.5 L1.14644661,6.85355339 L6.14644661,11.8535534 L6.5,12.2071068 L7.20710678,11.5 L6.85355339,11.1464466 L2.20710678,6.5 Z" id="Combined-Shape"></path><path d="M10.2071068,6.5 L14.8535534,1.85355339 L15.2071068,1.5 L14.5,0.792893219 L14.1464466,1.14644661 L9.14644661,6.14644661 L9.05805826,6.23483496 L8.79289322,6.5 L9.14644661,6.85355339 L14.1464466,11.8535534 L14.5,12.2071068 L15.2071068,11.5 L14.8535534,11.1464466 L10.2071068,6.5 Z" id="Combined-Shape"></path></g></g></g></svg> + </svg></div> + <div class=""> + <ul class="list-note-preview">{% for obj in notes_list %} + <li> + <a href="{% url 'notes:note-detail' user.username obj.slug %}"> + <h4>{{obj.title}}</h4> + <div class="note-preview">{{obj.body_text|truncatewords:12}}</div> + </a> + </li> + {% endfor %}</ul> + </div> + </aside> + <div class="balance-container"> + </div> </main> {% endblock %} diff --git a/design/templates/notes/notes_listold.html b/design/templates/notes/notes_listold.html new file mode 100644 index 0000000..8066369 --- /dev/null +++ b/design/templates/notes/notes_listold.html @@ -0,0 +1,9 @@ +{% extends 'base.html' %} +{% block content %} +<main> + <h1> Notes</h1> + <ul>{% for obj in object_list %} + <li><a href="{% url 'notes:note-detail' user.username obj.slug %}">{{obj}}</a></li> + {% endfor %}</ul> +</main> +{% endblock %} |