From 715c0527abd9def236a4f7f5783b2edd4c19c410 Mon Sep 17 00:00:00 2001 From: Anaïs Amato Date: Tue, 11 May 2021 14:39:45 +0200 Subject: [PATCH] Make tables sortables and searchables --- app/main/static/js/style_tables.js | 6 ++++++ app/main/templates/agent.html | 6 +++++- app/main/templates/project.html | 3 +++ app/static/css/style.css | 19 +++++++++++++++++++ app/static/lib/datatables-1.10.24/css/datatables.min.css | 15 +++++++++++++++ app/static/lib/datatables-1.10.24/img/sort_asc.png | Bin 0 -> 160 bytes app/static/lib/datatables-1.10.24/img/sort_asc_disabled.png | Bin 0 -> 146 bytes app/static/lib/datatables-1.10.24/img/sort_both.png | Bin 0 -> 201 bytes app/static/lib/datatables-1.10.24/img/sort_desc.png | Bin 0 -> 158 bytes app/static/lib/datatables-1.10.24/img/sort_desc_disabled.png | Bin 0 -> 148 bytes app/static/lib/datatables-1.10.24/js/datatables.min.js | 205 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/templates/base_page.html | 4 ++-- app/templates/datatables-includes.html | 2 ++ 13 files changed, 257 insertions(+), 3 deletions(-) create mode 100644 app/main/static/js/style_tables.js create mode 100644 app/static/lib/datatables-1.10.24/css/datatables.min.css create mode 100644 app/static/lib/datatables-1.10.24/img/sort_asc.png create mode 100644 app/static/lib/datatables-1.10.24/img/sort_asc_disabled.png create mode 100644 app/static/lib/datatables-1.10.24/img/sort_both.png create mode 100644 app/static/lib/datatables-1.10.24/img/sort_desc.png create mode 100644 app/static/lib/datatables-1.10.24/img/sort_desc_disabled.png create mode 100644 app/static/lib/datatables-1.10.24/js/datatables.min.js create mode 100644 app/templates/datatables-includes.html diff --git a/app/main/static/js/style_tables.js b/app/main/static/js/style_tables.js new file mode 100644 index 0000000..edddc7d --- /dev/null +++ b/app/main/static/js/style_tables.js @@ -0,0 +1,6 @@ +$('#charge_table').DataTable({ + "paginate": false, + "searching": true, + "ordering": true, + "info": false +}); diff --git a/app/main/templates/agent.html b/app/main/templates/agent.html index 4277796..76ec6bd 100644 --- a/app/main/templates/agent.html +++ b/app/main/templates/agent.html @@ -1,7 +1,8 @@ {% extends "base_page.html" %} {% block more_heads %} - + {% endblock %} @@ -100,10 +101,13 @@ {% block more_scripts %} {% include 'd3js-includes.html' %} {% include 'charges-includes.html' %} +{% include 'datatables-includes.html' %} + + {% endblock %} diff --git a/app/main/templates/project.html b/app/main/templates/project.html index b99c875..f17bd53 100644 --- a/app/main/templates/project.html +++ b/app/main/templates/project.html @@ -1,6 +1,7 @@ {% extends "base_page.html" %} {% block more_heads %} + {% endblock %} @@ -63,6 +64,8 @@ {% block more_scripts %} {% include 'd3js-includes.html' %} {% include 'charges-includes.html' %} +{% include 'datatables-includes.html' %} + + -- libgit2 0.21.2