diff options
author | luxagraf <sng@luxagraf.net> | 2023-12-05 10:30:37 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2023-12-05 10:30:37 -0500 |
commit | 800008d24cecec37594b089936af2f9b2a03aecc (patch) | |
tree | bfd88614818d872d2486c401781c79bc875fec52 | |
parent | e899544a20bc53cf0abbcc301e841e620ab02988 (diff) |
gtd: added search to drop down menus
-rw-r--r-- | app/gtd/templates/gtd/note_form.html | 11 | ||||
-rw-r--r-- | app/gtd/templates/gtd/wirednote_form.html | 10 | ||||
-rw-r--r-- | app/gtd/templates/gtd/wiredpost_form.html | 12 |
3 files changed, 27 insertions, 6 deletions
diff --git a/app/gtd/templates/gtd/note_form.html b/app/gtd/templates/gtd/note_form.html index 006312b..a5b72a9 100644 --- a/app/gtd/templates/gtd/note_form.html +++ b/app/gtd/templates/gtd/note_form.html @@ -1,11 +1,12 @@ {% extends 'base_gtd.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"> @@ -25,12 +26,14 @@ form .selector label { </main> {% endblock %} {% block js %} - {% if is_update %}{%else%} <script type="text/javascript"> +var options = {searchable: true}; +NiceSelect.bind(document.getElementById("id_project"), options); + {% if is_update %}{%else%} let params = new URL(document.location).searchParams; document.getElementById('id_title').value = params.get("title"); -document.getElementById('id_body_markdown').value = params.get("description"); document.getElementById('id_url').value = params.get("url"); -</script> +document.getElementById('id_body_markdown').value = params.get("description"); {% endif %} +</script> {% endblock%} diff --git a/app/gtd/templates/gtd/wirednote_form.html b/app/gtd/templates/gtd/wirednote_form.html index 92b8230..e264310 100644 --- a/app/gtd/templates/gtd/wirednote_form.html +++ b/app/gtd/templates/gtd/wirednote_form.html @@ -1,4 +1,8 @@ {% extends 'base_gtd.html' %} +{% block extrahead %} +<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"> <form action="" method="post" class="comment-form">{% csrf_token %} @@ -15,12 +19,14 @@ </main> {% endblock %} {% block js %} - {% if is_update %}{%else%} <script type="text/javascript"> +var options = {searchable: true}; +NiceSelect.bind(document.getElementById("id_post"), options); + {% 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_body_markdown').value = params.get("description"); -</script> {% endif %} +</script> {% endblock%} diff --git a/app/gtd/templates/gtd/wiredpost_form.html b/app/gtd/templates/gtd/wiredpost_form.html index a9880cf..1f0e4a4 100644 --- a/app/gtd/templates/gtd/wiredpost_form.html +++ b/app/gtd/templates/gtd/wiredpost_form.html @@ -1,4 +1,8 @@ {% extends 'base_gtd.html' %} +{% block extrahead %} +<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"> <form action="" method="post" class="comment-form">{% csrf_token %} @@ -13,4 +17,12 @@ <input type="submit" name="save" class="btn" value="Save" /> </form> </main> + +{% endblock %} +{% block js %} +<script type="text/javascript"> + console.log("hello world"); + var options = {searchable: true}; + NiceSelect.bind(document.getElementById("id_post"), options); +</script> {% endblock %} |