From afad2ae40f32ea677b77b28176ac07268f6fa594 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 18 Feb 2025 16:26:45 -0600 Subject: Add missing scripts. --- uploader/static/js/populations.js | 40 +++++++++++++++++++++++++++++++++++++++ uploader/static/js/species.js | 39 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 uploader/static/js/populations.js create mode 100644 uploader/static/js/species.js (limited to 'uploader') diff --git a/uploader/static/js/populations.js b/uploader/static/js/populations.js new file mode 100644 index 0000000..ded9b10 --- /dev/null +++ b/uploader/static/js/populations.js @@ -0,0 +1,40 @@ +var populationDataTable = (populationdata) => { + var lengthMenu = [10, 25, 50, 100, 1000]; + if(populationdata.length > 1000) { + lengthMenu.push(populationdata.length) + } + $("#tbl-select-population").DataTable({ + responsive: true, + lengthMenu: lengthMenu, + language: { + processing: "Processing… Please wait.", + loadingRecords: "Loading population — Please wait.", + lengthMenu: "Show _MENU_ populations", + info: "Showing _START_ to _END_ of _TOTAL_ populations" + }, + data: populationdata, + columns: [ + { + data: (apopulation) => { + return ``; + } + }, + { + data: (apopulation) => { + return ``; + } + } + ] + }); +}; + + +$(() => { + populationDataTable(JSON.parse( + $("#tbl-select-population").attr("data-populations-list"))); +}); diff --git a/uploader/static/js/species.js b/uploader/static/js/species.js new file mode 100644 index 0000000..b070725 --- /dev/null +++ b/uploader/static/js/species.js @@ -0,0 +1,39 @@ +var speciesDataTable = (speciesdata) => { + var lengthMenu = [10, 25, 50, 100, 1000]; + if(speciesdata.length > 1000) { + lengthMenu.push(speciesdata.length) + } + $("#tbl-select-species").DataTable({ + responsive: true, + lengthMenu: lengthMenu, + language: { + processing: "Processing… Please wait.", + loadingRecords: "Loading species — Please wait.", + lengthMenu: "Show _MENU_ species", + info: "Showing _START_ to _END_ of _TOTAL_ species" + }, + data: speciesdata, + columns: [ + { + data: (aspecies) => { + return ``; + } + }, + { + data: (aspecies) => { + return ``; + } + } + ] + }); +}; + +$(() => { + speciesDataTable(JSON.parse( + $("#tbl-select-species").attr("data-species-list"))); +}); -- cgit v1.2.3