aboutsummaryrefslogtreecommitdiff
path: root/design/templates/notes/partials
diff options
context:
space:
mode:
Diffstat (limited to 'design/templates/notes/partials')
-rw-r--r--design/templates/notes/partials/note_list.html6
-rw-r--r--design/templates/notes/partials/notebook_form.html19
2 files changed, 22 insertions, 3 deletions
diff --git a/design/templates/notes/partials/note_list.html b/design/templates/notes/partials/note_list.html
index 0c91b34..9ba4689 100644
--- a/design/templates/notes/partials/note_list.html
+++ b/design/templates/notes/partials/note_list.html
@@ -1,11 +1,11 @@
-<li {% if object.notebook and not hidecolor %}class="notebook-colored" style="border-left-color: {{object.notebook.color_rgb}};" {% endif %} >
- <a href="{% url 'notes:detail' object.slug object.pk %}">
+<li {% if object.notebook and not hidecolor %}class="notebook-colored" style="border-left-color: {{object.notebook.color_rgba}};" {% endif %} >
+ <a href="{{object.get_absolute_url}}">
<h4>{{object.title}}</h4>
<div class="note-preview">{{object.body_text|truncatewords:36}}</div>
</a>
<div class="flex-wrapper">{% if object.notebook and not hidenotebook %}
<div class="notebook">
- <a href="{% url 'notebooks:detail' object.slug %}"><span class="color-box" style="background-color: {{object.notebook.color_rgb}}"></span>{{object.notebook}}</a>
+ <a href="{{object.notebook.get_absolute_url}}"><span class="color-box" style="background-color: {{object.notebook.color_rgb}}"></span>{{object.notebook}}</a>
</div>{% endif %}
<div class="tags">tags: {% for tag in object.tags.all %}
<a href="{% url 'notes:tags' tag.slug %}">
diff --git a/design/templates/notes/partials/notebook_form.html b/design/templates/notes/partials/notebook_form.html
new file mode 100644
index 0000000..fae6c40
--- /dev/null
+++ b/design/templates/notes/partials/notebook_form.html
@@ -0,0 +1,19 @@
+<form id="nb-create-form" action="{% url 'notebook-api-list' %}" method="POST">{% csrf_token %}
+ <div class="alert" id="non-field-errors">{{ form.non_field_errors }}</div>
+ <div class="flex-wrapper flex-inner">
+ {% for field in form %}{% if field.name == 'color_rgb' %}
+ <fieldset class="fe-color-picker color-picker-fieldset block" id="color-picker" {% if form.instance.color_rgb %}style="background-color: {{form.instance.color_rgb}}; border: none;"{%endif%}>
+ {{field.label_tag}}
+ <input type="text" name="color_rgb" value="{{form.instance.color_rgb}}" maxlength="20" id="id_color_rgb">
+ {% if field.errors %}{{field.errors}}{% endif %}
+ </fieldset>{% else %}
+ {%if field.name != 'owner' %}<fieldset class="nb-{{field.name}}">
+ {{field.label_tag}}
+ {{field}}
+ {% if field.errors %}{{field.errors}}{% endif %}
+ </fieldset>{%else%}{{field}}{% endif %}{%endif%}
+ {% endfor %}
+ <h1 class="notebook-title" id="nb-title">{{object.name}}</h1>
+ </div>
+ <input id="notebook-form-submit" type="submit" class="btn sm" value="Save" >
+ </form>