From d45fa99aa9d587b5674484f68955b43f39e8f6fd Mon Sep 17 00:00:00 2001 From: luxagraf Date: Thu, 6 Dec 2018 06:57:52 -0600 Subject: redid tags to use through model, cleaned up note and notebook detail views --- design/templates/notes/notebook_create.html | 20 ++------ design/templates/notes/notebook_detail.html | 64 ++++++++++++++---------- design/templates/notes/notes_create.html | 21 +++++++- design/templates/notes/notes_detail.html | 76 +++++++++++------------------ design/templates/notes/notes_list.html | 19 ++++---- 5 files changed, 99 insertions(+), 101 deletions(-) (limited to 'design') diff --git a/design/templates/notes/notebook_create.html b/design/templates/notes/notebook_create.html index 8ffc94a..1386946 100644 --- a/design/templates/notes/notebook_create.html +++ b/design/templates/notes/notebook_create.html @@ -2,6 +2,7 @@ {% block extrastyles %} + {% endblock %} {% block content %}
@@ -10,34 +11,23 @@ {% csrf_token %} {{ form.non_field_errors }} {% for field in form %} -
+
{{field.label_tag}} {{field}} {% if field.errors %}{{field.errors}}{% endif %}
{% endfor %} +

Pick color

diff --git a/design/templates/notes/notebook_detail.html b/design/templates/notes/notebook_detail.html index 36873e1..a0b06a3 100644 --- a/design/templates/notes/notebook_detail.html +++ b/design/templates/notes/notebook_detail.html @@ -1,49 +1,59 @@ {% extends 'base.html' %} +{% block extrastyles %} + +{% endblock %} + {% block content %}
-
- {%comment%} -
+
+
+ {% csrf_token %} + {{ form.non_field_errors }} + +
+ {% for field in form %}{% if field.name == 'color_rgb' %} +
+ + {% if field.errors %}{{field.errors}}{% endif %} +
{% else %} +
+ {{field.label_tag}} + {{field}} + {% if field.errors %}{{field.errors}}{% endif %} +
{% endif %} + {% endfor %} +

{{object.name}}

+
+ + + +
+ +
{% csrf_token %} {{ form.non_field_errors }} {% for field in form %} -
+
{{field.label_tag}} {{field}} {% if field.errors %}{{field.errors}}{% endif %}
{% endfor %} -

+

- {%endcomment%} -{{object}} -
{% endblock %} +{% block jsdomready %} +window.url = "{% url 'notebook-api-detail' object.pk %}"; +{%endblock%} diff --git a/design/templates/notes/notes_create.html b/design/templates/notes/notes_create.html index 9bbdb26..9ca4111 100644 --- a/design/templates/notes/notes_create.html +++ b/design/templates/notes/notes_create.html @@ -5,8 +5,9 @@ {% endblock %} {% block content %}
+

Create a new note

-
+ {% csrf_token %} {{ form.non_field_errors }} {% for field in form %} @@ -23,6 +24,24 @@ {% endfor %}

+
+ +
+
{% endblock %} diff --git a/design/templates/notes/notes_detail.html b/design/templates/notes/notes_detail.html index 95583bd..b2ddbc3 100644 --- a/design/templates/notes/notes_detail.html +++ b/design/templates/notes/notes_detail.html @@ -2,26 +2,38 @@ {% block extrastyles %} {% endblock %} -{% block breadcrumbs %} -
  • Notes
  • -{% endblock %} - {% block content %}
    +
    {% csrf_token %}
    - tags: -
      {% for tag in object.tags.all %} -
    • - {{tag}} -
    • - {%endfor%}
    -
    - notebook: - {{object.notebook.name}} -
    + +
    +
    + {{object.notebook}} +
    + {{ form.notebook.errors }} + {{form.notebook}} +
    +
    +
    + tags: +
    {% for tag in object.tags.all %} + + {{tag}} + {%endfor%} +
    +
    + {{ form.notebook.errors }} + {{form.tags}} +
    +
    +
    +
    +
    {{form.body_text}}
    +
    {{form.title}}

    {{object.date_created|date:"M d, Y"}}

    {% if object.url %}

    SourceArchive

    {% endif %} @@ -30,10 +42,6 @@

    {{object.title}}

    {% if object.body_html %}{{object.body_html|safe}}{%else%}{{object.body_text}}{%endif%}
    - {% csrf_token %} - {% for field in form %}{% if field.name in "title body_text" %} -
    {{field}}
    - {% endif%}{% endfor %}
    @@ -44,7 +52,7 @@
      {% for obj in notes_list %}
    • - +

      {{obj.title}}

      {{obj.body_text|truncatewords:12}}
      @@ -71,34 +79,6 @@ document.addEventListener('readystatechange', event => { }); {% endblock %} - - -'indent -'align -'direction -'code-block diff --git a/design/templates/notes/notes_list.html b/design/templates/notes/notes_list.html index b1c1700..393cf89 100644 --- a/design/templates/notes/notes_list.html +++ b/design/templates/notes/notes_list.html @@ -4,16 +4,11 @@

      Notes {% if tags|length == 1%} tagged {% for tag in tags%}{{tag}}{%endfor%}{%endif%}

      -
      Tagged with: {% for tag in tags%}{{tag}}{%endfor%}
      -
      + {% if tags|length >= 1%} + {%else%} +
      +
      + {%endif%}
      -- cgit v1.2.3-70-g09d2