diff --git a/src/static/js/main.js b/src/static/js/main.js index eea5883..bbcf965 100644 --- a/src/static/js/main.js +++ b/src/static/js/main.js @@ -1,8 +1,8 @@ // make the table a dataTable and show all entries by default const TABLE_CLASS = '.data-table'; +const TABLE_CLASS_NO_PAGING = '.data-table-npaging'; $(document).ready(function () { - // if ($(TABLE_CLASS)) { const data_table = $(TABLE_CLASS).DataTable({ "paging": true, "pageLength": 10, @@ -30,7 +30,6 @@ $(document).ready(function () { }, responsive: true, }); - // } $('#data-table-search-input').keyup(function () { data_table.search($(this).val()).draw(); }); @@ -45,5 +44,13 @@ $(document).ready(function () { $(".menu-toggle").click(function () { $(".wrapper").toggleClass("toggled"); - }) + }); + + + $('form').submit(function () { + data_table.search('').draw(); + data_table.rows().nodes().page.len(-1).draw(false); + $('#data-table-search-input input').val(''); + return true; // return false to cancel form action + }); }); \ No newline at end of file diff --git a/src/templates/group/group_add.jinja2 b/src/templates/group/group_add.jinja2 index 5b82814..be4f67d 100644 --- a/src/templates/group/group_add.jinja2 +++ b/src/templates/group/group_add.jinja2 @@ -1,5 +1,6 @@ {% extends 'realm/realm_detailed.jinja2' %} {% import 'macros/form_macros.jinja2' as mform %} +{% import 'macros/utils_macros.jinja2' as uform %} {% block detail_content %}
| @@ -297,14 +297,10 @@ + > + {% endif %} | Nutzername | @@ -333,6 +329,20 @@ + + + + + + + + + + + + + + {% if checkbox_label_classes %}{{ checkbox_label_classes }}{% else %}table-checkbox-control-label table-checkbox-control-label-add{% endif %}" for="{{ user.username }}_{{ loop.index }}"> diff --git a/src/templates/macros/utils_macros.jinja2 b/src/templates/macros/utils_macros.jinja2 index c54ddfa..ecc8a8f 100644 --- a/src/templates/macros/utils_macros.jinja2 +++ b/src/templates/macros/utils_macros.jinja2 @@ -125,3 +125,12 @@ {% endif %} {% endmacro %} +{% macro get_data_table_search_field(input_id="data-table-search-input") -%} +
|---|