diff options
Diffstat (limited to 'app/notes/templates/note_form.html')
-rw-r--r-- | app/notes/templates/note_form.html | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/app/notes/templates/note_form.html b/app/notes/templates/note_form.html new file mode 100644 index 0000000..3924d48 --- /dev/null +++ b/app/notes/templates/note_form.html @@ -0,0 +1,37 @@ +{% extends 'base_notes.html' %} +{% block extrahead %} +<style> +form .selector label { + position: inherit; +} +</style> +<script src="/media/js/nice-select2.js"></script> +<link rel="stylesheet" href="/media/nice-select2.css"> +{% endblock %} +{% block primary %} +<main role="main" class="archive-wrapper"> + <div class="post-body"> + <form action="" method="post" class="comment-form">{% csrf_token %} + {% for field in form %} + <fieldset> + {%if field.name == "project" or field.name == "status" or field.name == 'note_type'%}<span class="selector">{{field.label_tag}}</span>{%else%}{{field.label_tag}}{%endif%} + {%if field.name == "body_markdown" or field.name == "description" %}<div class="textarea-rounded">{{ field }}</div>{%else%}{{field}}{%endif%} + </fieldset> + <small class="alert">{% if field.errors %}{{field.errors}}{% endif %}</small> + {%endfor%} + <input class="btn" type="submit" name="add_new" value="Save and add another" /> + <input type="submit" name="save" class="btn" value="Save" /> + </form> + </div> +</main> +{% endblock %} + {% block js %} +<script type="text/javascript"> +{% if is_update %}{%else%} +let params = new URL(document.location).searchParams; +document.getElementById('id_title').value = params.get("title"); +document.getElementById('id_url').value = params.get("url"); +document.getElementById('id_description').value = params.get("description"); +{% endif %} +</script> + {% endblock%} |