From 6ccffd5f4d4bfc807d63dc5447f0d4b5ec217aa4 Mon Sep 17 00:00:00 2001 From: Michelle <88682822+emshahh@users.noreply.github.com> Date: Fri, 24 May 2024 09:16:46 -0400 Subject: [PATCH 01/36] quick save to switch branches --- .../templates/sde_collections/candidate_urls_list.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html b/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html index 20d4a631..6c458786 100644 --- a/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html +++ b/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html @@ -77,7 +77,7 @@

Document Type
ID
- +
- +
From 410130c8cacaf79605642d43f76afe09198ee685 Mon Sep 17 00:00:00 2001 From: Michelle <88682822+emshahh@users.noreply.github.com> Date: Tue, 28 May 2024 13:30:13 -0400 Subject: [PATCH 02/36] quick save --- .../static/js/candidate_url_list.js | 34 +++++++++++++++++++ .../sde_collections/candidate_urls_list.html | 23 +++++++++---- 2 files changed, 51 insertions(+), 6 deletions(-) diff --git a/sde_indexing_helper/static/js/candidate_url_list.js b/sde_indexing_helper/static/js/candidate_url_list.js index 52fb3858..600b260e 100644 --- a/sde_indexing_helper/static/js/candidate_url_list.js +++ b/sde_indexing_helper/static/js/candidate_url_list.js @@ -125,6 +125,29 @@ function initializeDataTable() { d.is_excluded = $("#filter-checkbox").is(":checked") ? false : null; }, }, + // initComplete: function (data) { + // const addDropdownSelect = [1, 4, 5]; + // const dict = { + // 1: "Images", + // 2: "Data", + // 3: "Documentation", + // 4: "Software and Tools", + // 5: "Missions and Instruments", + // 6: "Training and Education", + // }; + // this.api() + // .columns() + // .every(function (index) { + // let column = this; + // if (addDropdownSelect.includes(index)) { + // $("thead tr td select.dropdown-" + index).on("change", function () { + // var val = $.fn.dataTable.util.escapeRegex($(this).val()); + // column.search(val ? "^" + val + "$" : "", true, false).draw(); + // }); + // } + // }); + // }, + initComplete: function (data) { const addDropdownSelect = [1, 4, 5]; const dict = { @@ -144,6 +167,17 @@ function initializeDataTable() { var val = $.fn.dataTable.util.escapeRegex($(this).val()); column.search(val ? "^" + val + "$" : "", true, false).draw(); }); + // Add list of options + column + .data() + .unique() + .sort() + .each(function (d, j) { + let val = index === 5 ? dict[d] : d; + $("thead tr td select.dropdown-" + index).append( + '" + ); + }); } }); }, diff --git a/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html b/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html index 6c458786..e3c2b4c7 100644 --- a/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html +++ b/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html @@ -77,7 +77,7 @@

Document Type
ID
-
+ + + + + + + + + + + +
@@ -122,7 +133,7 @@

Actions ID - +
@@ -164,7 +175,7 @@

ID - + From 7281a66040e4abaee0fe68ae484426e9b68e161d Mon Sep 17 00:00:00 2001 From: Michelle <88682822+emshahh@users.noreply.github.com> Date: Tue, 28 May 2024 13:48:31 -0400 Subject: [PATCH 03/36] quick save --- .../static/js/candidate_url_list.js | 156 ++++++++++++++++++ .../sde_collections/candidate_urls_list.html | 39 ++++- 2 files changed, 192 insertions(+), 3 deletions(-) diff --git a/sde_indexing_helper/static/js/candidate_url_list.js b/sde_indexing_helper/static/js/candidate_url_list.js index 600b260e..8617a722 100644 --- a/sde_indexing_helper/static/js/candidate_url_list.js +++ b/sde_indexing_helper/static/js/candidate_url_list.js @@ -239,6 +239,29 @@ function initializeDataTable() { orderCellsTop: true, pageLength: 100, ajax: `/api/exclude-patterns/?format=datatables&collection_id=${collection_id}`, + // initComplete: function (data) { + // var table = $("#exclude_patterns_table").DataTable(); + + // this.api() + // .columns() + // .every(function (index) { + // let column = this; + // if (column.data().length === 0) { + // $("#exclude-patterns-dropdown-1").prop("disabled", true); + // } else if (index === 1) { + // $("#exclude-patterns-dropdown-1").on("change", function () { + // if ($(this).val() === "") table.columns(6).search("").draw(); + // else { + // table + // .column(6) + // .search(matchPatternTypeMap[$(this).val()]) + // .draw(); + // } + // }); + // } + // }); + // }, + initComplete: function (data) { var table = $("#exclude_patterns_table").DataTable(); @@ -258,6 +281,15 @@ function initializeDataTable() { .draw(); } }); + column + .data() + .unique() + .sort() + .each(function (d, j) { + $("#exclude-patterns-dropdown-1").append( + '" + ); + }); } }); }, @@ -317,6 +349,27 @@ function initializeDataTable() { orderCellsTop: true, serverSide: true, ajax: `/api/include-patterns/?format=datatables&collection_id=${collection_id}`, + // initComplete: function (data) { + // var table = $("#include_patterns_table").DataTable(); + // this.api() + // .columns() + // .every(function (index) { + // let column = this; + // if (column.data().length === 0) { + // $("#include-patterns-dropdown-1").prop("disabled", true); + // } else { + // if (index === 1) { + // $("#include-patterns-dropdown-1").on("change", function () { + // if ($(this).val() === "") table.columns(5).search("").draw(); + // table + // .column(5) + // .search(matchPatternTypeMap[$(this).val()]) + // .draw(); + // }); + // } + // } + // }); + // }, initComplete: function (data) { var table = $("#include_patterns_table").DataTable(); this.api() @@ -335,6 +388,16 @@ function initializeDataTable() { .draw(); }); } + column + .data() + .unique() + .sort() + .each(function (d, j) { + console.log("d", d); + $("#include-patterns-dropdown-1").append( + '" + ); + }); } }); }, @@ -386,6 +449,29 @@ function initializeDataTable() { pageLength: 100, orderCellsTop: true, ajax: `/api/title-patterns/?format=datatables&collection_id=${collection_id}`, + // initComplete: function (data) { + // var table = $("#title_patterns_table").DataTable(); + + // this.api() + // .columns() + // .every(function (index) { + // let column = this; + // if (column.data().length === 0) { + // $("#title-patterns-dropdown-1").prop("disabled", true); + // } else if (index === 1) { + // $("#title-patterns-dropdown-1").on("change", function () { + // if ($(this).val() === "") table.columns(6).search("").draw(); + // else { + // table + // .column(6) + // .search(matchPatternTypeMap[$(this).val()]) + // .draw(); + // } + // }); + // } + // }); + // }, + initComplete: function (data) { var table = $("#title_patterns_table").DataTable(); @@ -405,6 +491,15 @@ function initializeDataTable() { .draw(); } }); + column + .data() + .unique() + .sort() + .each(function (d, j) { + $("#title-patterns-dropdown-1").append( + '" + ); + }); } }); }, @@ -466,6 +561,57 @@ function initializeDataTable() { orderCellsTop: true, pageLength: 100, ajax: `/api/document-type-patterns/?format=datatables&collection_id=${collection_id}`, + // initComplete: function (data) { + // this.api() + // .columns() + // .every(function (index) { + // var table = $("#document_type_patterns_table").DataTable(); + + // let addDropdownSelect = { + // 1: { + // columnToSearch: 6, + // matchPattern: { + // "Individual URL Pattern": 1, + // "Multi-URL Pattern": 2, + // }, + // }, + // 2: { + // columnToSearch: 7, + // matchPattern: { + // Images: 1, + // Data: 2, + // Documentation: 3, + // "Software and Tools": 4, + // "Missions and Instruments": 5, + // "Training and Education": 6, + // }, + // }, + // }; + + // let column = this; + // if (column.data().length === 0) { + // $(`#document-type-patterns-dropdown-${index}`).prop( + // "disabled", + // true + // ); + // } else if (index in addDropdownSelect) { + // $("#document-type-patterns-dropdown-" + index).on( + // "change", + // function () { + // let col = addDropdownSelect[index].columnToSearch; + // let searchInput = + // addDropdownSelect[index].matchPattern[$(this).val()]; + // if ($(this).val() === "" || $(this).val() === undefined) + // table.columns(col).search("").draw(); + // else { + // table.columns(col).search(searchInput).draw(); + // } + // } + // ); + // } + // }); + // }, + initComplete: function (data) { this.api() .columns() @@ -513,6 +659,16 @@ function initializeDataTable() { } } ); + // Add list of options + column + .data() + .unique() + .sort() + .each(function (d, j) { + $("#document-type-patterns-dropdown-" + index).append( + '" + ); + }); } }); }, diff --git a/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html b/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html index e3c2b4c7..0504e29d 100644 --- a/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html +++ b/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html @@ -144,6 +144,14 @@

--> + + + + + + + +
@@ -185,6 +193,13 @@

--> + + + + + + + @@ -219,7 +234,7 @@

ID - + + + + + + + + @@ -263,7 +286,7 @@

ID - + + + + + + + + + + + From d83f7908d3d47d78cba2a29464d3600e737de81a Mon Sep 17 00:00:00 2001 From: Michelle <88682822+emshahh@users.noreply.github.com> Date: Tue, 28 May 2024 13:57:14 -0400 Subject: [PATCH 04/36] quick save --- .../static/js/candidate_url_list.js | 190 ------------------ .../sde_collections/candidate_urls_list.html | 58 +----- 2 files changed, 7 insertions(+), 241 deletions(-) diff --git a/sde_indexing_helper/static/js/candidate_url_list.js b/sde_indexing_helper/static/js/candidate_url_list.js index 8617a722..52fb3858 100644 --- a/sde_indexing_helper/static/js/candidate_url_list.js +++ b/sde_indexing_helper/static/js/candidate_url_list.js @@ -125,29 +125,6 @@ function initializeDataTable() { d.is_excluded = $("#filter-checkbox").is(":checked") ? false : null; }, }, - // initComplete: function (data) { - // const addDropdownSelect = [1, 4, 5]; - // const dict = { - // 1: "Images", - // 2: "Data", - // 3: "Documentation", - // 4: "Software and Tools", - // 5: "Missions and Instruments", - // 6: "Training and Education", - // }; - // this.api() - // .columns() - // .every(function (index) { - // let column = this; - // if (addDropdownSelect.includes(index)) { - // $("thead tr td select.dropdown-" + index).on("change", function () { - // var val = $.fn.dataTable.util.escapeRegex($(this).val()); - // column.search(val ? "^" + val + "$" : "", true, false).draw(); - // }); - // } - // }); - // }, - initComplete: function (data) { const addDropdownSelect = [1, 4, 5]; const dict = { @@ -167,17 +144,6 @@ function initializeDataTable() { var val = $.fn.dataTable.util.escapeRegex($(this).val()); column.search(val ? "^" + val + "$" : "", true, false).draw(); }); - // Add list of options - column - .data() - .unique() - .sort() - .each(function (d, j) { - let val = index === 5 ? dict[d] : d; - $("thead tr td select.dropdown-" + index).append( - '" - ); - }); } }); }, @@ -239,29 +205,6 @@ function initializeDataTable() { orderCellsTop: true, pageLength: 100, ajax: `/api/exclude-patterns/?format=datatables&collection_id=${collection_id}`, - // initComplete: function (data) { - // var table = $("#exclude_patterns_table").DataTable(); - - // this.api() - // .columns() - // .every(function (index) { - // let column = this; - // if (column.data().length === 0) { - // $("#exclude-patterns-dropdown-1").prop("disabled", true); - // } else if (index === 1) { - // $("#exclude-patterns-dropdown-1").on("change", function () { - // if ($(this).val() === "") table.columns(6).search("").draw(); - // else { - // table - // .column(6) - // .search(matchPatternTypeMap[$(this).val()]) - // .draw(); - // } - // }); - // } - // }); - // }, - initComplete: function (data) { var table = $("#exclude_patterns_table").DataTable(); @@ -281,15 +224,6 @@ function initializeDataTable() { .draw(); } }); - column - .data() - .unique() - .sort() - .each(function (d, j) { - $("#exclude-patterns-dropdown-1").append( - '" - ); - }); } }); }, @@ -349,27 +283,6 @@ function initializeDataTable() { orderCellsTop: true, serverSide: true, ajax: `/api/include-patterns/?format=datatables&collection_id=${collection_id}`, - // initComplete: function (data) { - // var table = $("#include_patterns_table").DataTable(); - // this.api() - // .columns() - // .every(function (index) { - // let column = this; - // if (column.data().length === 0) { - // $("#include-patterns-dropdown-1").prop("disabled", true); - // } else { - // if (index === 1) { - // $("#include-patterns-dropdown-1").on("change", function () { - // if ($(this).val() === "") table.columns(5).search("").draw(); - // table - // .column(5) - // .search(matchPatternTypeMap[$(this).val()]) - // .draw(); - // }); - // } - // } - // }); - // }, initComplete: function (data) { var table = $("#include_patterns_table").DataTable(); this.api() @@ -388,16 +301,6 @@ function initializeDataTable() { .draw(); }); } - column - .data() - .unique() - .sort() - .each(function (d, j) { - console.log("d", d); - $("#include-patterns-dropdown-1").append( - '" - ); - }); } }); }, @@ -449,29 +352,6 @@ function initializeDataTable() { pageLength: 100, orderCellsTop: true, ajax: `/api/title-patterns/?format=datatables&collection_id=${collection_id}`, - // initComplete: function (data) { - // var table = $("#title_patterns_table").DataTable(); - - // this.api() - // .columns() - // .every(function (index) { - // let column = this; - // if (column.data().length === 0) { - // $("#title-patterns-dropdown-1").prop("disabled", true); - // } else if (index === 1) { - // $("#title-patterns-dropdown-1").on("change", function () { - // if ($(this).val() === "") table.columns(6).search("").draw(); - // else { - // table - // .column(6) - // .search(matchPatternTypeMap[$(this).val()]) - // .draw(); - // } - // }); - // } - // }); - // }, - initComplete: function (data) { var table = $("#title_patterns_table").DataTable(); @@ -491,15 +371,6 @@ function initializeDataTable() { .draw(); } }); - column - .data() - .unique() - .sort() - .each(function (d, j) { - $("#title-patterns-dropdown-1").append( - '" - ); - }); } }); }, @@ -561,57 +432,6 @@ function initializeDataTable() { orderCellsTop: true, pageLength: 100, ajax: `/api/document-type-patterns/?format=datatables&collection_id=${collection_id}`, - // initComplete: function (data) { - // this.api() - // .columns() - // .every(function (index) { - // var table = $("#document_type_patterns_table").DataTable(); - - // let addDropdownSelect = { - // 1: { - // columnToSearch: 6, - // matchPattern: { - // "Individual URL Pattern": 1, - // "Multi-URL Pattern": 2, - // }, - // }, - // 2: { - // columnToSearch: 7, - // matchPattern: { - // Images: 1, - // Data: 2, - // Documentation: 3, - // "Software and Tools": 4, - // "Missions and Instruments": 5, - // "Training and Education": 6, - // }, - // }, - // }; - - // let column = this; - // if (column.data().length === 0) { - // $(`#document-type-patterns-dropdown-${index}`).prop( - // "disabled", - // true - // ); - // } else if (index in addDropdownSelect) { - // $("#document-type-patterns-dropdown-" + index).on( - // "change", - // function () { - // let col = addDropdownSelect[index].columnToSearch; - // let searchInput = - // addDropdownSelect[index].matchPattern[$(this).val()]; - // if ($(this).val() === "" || $(this).val() === undefined) - // table.columns(col).search("").draw(); - // else { - // table.columns(col).search(searchInput).draw(); - // } - // } - // ); - // } - // }); - // }, - initComplete: function (data) { this.api() .columns() @@ -659,16 +479,6 @@ function initializeDataTable() { } } ); - // Add list of options - column - .data() - .unique() - .sort() - .each(function (d, j) { - $("#document-type-patterns-dropdown-" + index).append( - '" - ); - }); } }); }, diff --git a/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html b/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html index 0504e29d..6c458786 100644 --- a/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html +++ b/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html @@ -77,7 +77,7 @@

Document Type
ID
- - - - - - - - - - - - + @@ -133,7 +122,7 @@

Actions ID - - - - - - - - @@ -183,7 +164,7 @@

ID - - - - - - - @@ -234,7 +208,7 @@

ID - - - - - - - - @@ -286,7 +252,7 @@

ID - - - - - - - - - - - + From 3efb56e9a54d40f743953f1822d1c0e9d7db466f Mon Sep 17 00:00:00 2001 From: Michelle <88682822+emshahh@users.noreply.github.com> Date: Tue, 28 May 2024 15:32:59 -0400 Subject: [PATCH 05/36] wip --- .../templates/sde_collections/candidate_urls_list.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html b/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html index 6c458786..20d4a631 100644 --- a/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html +++ b/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html @@ -77,7 +77,7 @@

Document Type
ID
-
+ -
+ From f6d7ebe6ce6f0cf37091a59cace5d3ef4f47103b Mon Sep 17 00:00:00 2001 From: Michelle <88682822+emshahh@users.noreply.github.com> Date: Tue, 28 May 2024 20:12:36 -0400 Subject: [PATCH 06/36] ignoring columns when clicking on csv button --- sde_indexing_helper/static/js/candidate_url_list.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sde_indexing_helper/static/js/candidate_url_list.js b/sde_indexing_helper/static/js/candidate_url_list.js index 52fb3858..d9a5af94 100644 --- a/sde_indexing_helper/static/js/candidate_url_list.js +++ b/sde_indexing_helper/static/js/candidate_url_list.js @@ -93,8 +93,12 @@ function initializeDataTable() { pagingType: "input", dom: "lBritip", buttons: [ - "spacer", - "csv", + { + extend: "csv", + exportOptions: { + columns: [0, 1, 2, 3, 4, 5], + }, + }, "spacer", { text: "Customize Columns", From 4c915cd31a094cc0d3f1d2ac35acfcaa12a5362a Mon Sep 17 00:00:00 2001 From: Michelle <88682822+emshahh@users.noreply.github.com> Date: Wed, 29 May 2024 10:29:16 -0400 Subject: [PATCH 07/36] qip --- sde_indexing_helper/static/js/candidate_url_list.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sde_indexing_helper/static/js/candidate_url_list.js b/sde_indexing_helper/static/js/candidate_url_list.js index d9a5af94..afeaec63 100644 --- a/sde_indexing_helper/static/js/candidate_url_list.js +++ b/sde_indexing_helper/static/js/candidate_url_list.js @@ -98,6 +98,18 @@ function initializeDataTable() { exportOptions: { columns: [0, 1, 2, 3, 4, 5], }, + customize: function (csv) { + console.log("CSV", csv.split("\n")[1].split('","')); + console.log("CSV", csv.split("\n")[2].split('","')); + // // Customization logic for the CSV + // // e.g., Add a header row, modify content, etc. + // var csvRows = csv.split("\n"); + // // Add a custom header + // csvRows.unshift( + // "Custom Header 1, Custom Header 2, Custom Header 3, Custom Header 4, Custom Header 5, Custom Header 6" + // ); + // return csvRows.join("\n"); + }, }, "spacer", { From 83ed7ba21f1943170765c3c17301f8fbe67934fb Mon Sep 17 00:00:00 2001 From: Michelle <88682822+emshahh@users.noreply.github.com> Date: Wed, 29 May 2024 15:03:57 -0400 Subject: [PATCH 08/36] columns now populating properly in csv --- .../static/js/candidate_url_list.js | 56 ++++++++++++------- .../sde_collections/candidate_urls_list.html | 10 ++++ 2 files changed, 47 insertions(+), 19 deletions(-) diff --git a/sde_indexing_helper/static/js/candidate_url_list.js b/sde_indexing_helper/static/js/candidate_url_list.js index afeaec63..76f79ef6 100644 --- a/sde_indexing_helper/static/js/candidate_url_list.js +++ b/sde_indexing_helper/static/js/candidate_url_list.js @@ -13,6 +13,14 @@ var matchPatternTypeMap = { "Multi-URL Pattern": 2, }; var uniqueId; //used for logic related to contents on column customization modal +const dict = { + 1: "Images", + 2: "Data", + 3: "Documentation", + 4: "Software and Tools", + 5: "Missions and Instruments", + 6: "Training and Education", +}; //fix table allignment when changing around tabs $('a[data-toggle="tab"]').on("shown.bs.tab", function (e) { @@ -96,19 +104,29 @@ function initializeDataTable() { { extend: "csv", exportOptions: { - columns: [0, 1, 2, 3, 4, 5], + columns: [0, 1, 2, 3, 4, 11], }, customize: function (csv) { - console.log("CSV", csv.split("\n")[1].split('","')); - console.log("CSV", csv.split("\n")[2].split('","')); - // // Customization logic for the CSV - // // e.g., Add a header row, modify content, etc. - // var csvRows = csv.split("\n"); - // // Add a custom header - // csvRows.unshift( - // "Custom Header 1, Custom Header 2, Custom Header 3, Custom Header 4, Custom Header 5, Custom Header 6" - // ); - // return csvRows.join("\n"); + var lines = csv.split("\n"); + console.log("lines[1].split(", ")", lines[1].split(",")); + const colInfo = { + 0: $("#candidateUrlFilter").val() || "No input", + 1: $(".dropdown-1").val() || "SELECT", + 2: $("#candidateScrapedTitleFilter").val() || "No input", + 3: $("#candidateNewTitleFilter").val() || "No input", + 4: $(".dropdown-4").val() || "SELECT", + 5: dict[$(".dropdown-5").val()] || "SELECT", + }; + if (lines.length > 2) { + var secondRow = lines[1].split(","); + // Modify the second row as needed + for (let key in colInfo) { + secondRow[key] = colInfo[key]; + } + + lines[1] = secondRow.join(","); + } + return lines.join("\n"); }, }, "spacer", @@ -143,14 +161,6 @@ function initializeDataTable() { }, initComplete: function (data) { const addDropdownSelect = [1, 4, 5]; - const dict = { - 1: "Images", - 2: "Data", - 3: "Documentation", - 4: "Software and Tools", - 5: "Missions and Instruments", - 6: "Training and Education", - }; this.api() .columns() .every(function (index) { @@ -176,6 +186,14 @@ function initializeDataTable() { { data: "match_pattern_type", visible: false, searchable: false }, { data: "candidate_urls_count", visible: false, searchable: false }, { data: "excluded", visible: false, searchable: false }, + { + data: null, + render: function (data, type, row) { + if (!row.document_type) return "Select"; + return dict[row.document_type]; + }, + visible: false, + }, ], createdRow: function (row, data, dataIndex) { if (data["excluded"]) { diff --git a/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html b/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html index 20d4a631..bec3d2f2 100644 --- a/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html +++ b/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html @@ -76,6 +76,11 @@

Visited?
Document Type
ID
+ + + + +
Document Type
@@ -100,6 +105,11 @@

+ + + + + From 4ef76dbb897889d809a4e17a6f838611381ef3dc Mon Sep 17 00:00:00 2001 From: Michelle <88682822+emshahh@users.noreply.github.com> Date: Wed, 29 May 2024 16:57:34 -0400 Subject: [PATCH 09/36] quick save --- .../static/js/candidate_url_list.js | 91 ++++++++++--------- 1 file changed, 50 insertions(+), 41 deletions(-) diff --git a/sde_indexing_helper/static/js/candidate_url_list.js b/sde_indexing_helper/static/js/candidate_url_list.js index e44c31f1..68da9352 100644 --- a/sde_indexing_helper/static/js/candidate_url_list.js +++ b/sde_indexing_helper/static/js/candidate_url_list.js @@ -109,7 +109,7 @@ function initializeDataTable() { { extend: "csv", exportOptions: { - columns: [0, 1, 2, 3, 4, 11], + columns: [0, 1, 2, 3, 10], }, customize: function (csv) { var lines = csv.split("\n"); @@ -878,14 +878,16 @@ function postDocumentTypePatterns( success: function (data) { $("#candidate_urls_table").DataTable().ajax.reload(null, false); $("#document_type_patterns_table").DataTable().ajax.reload(null, false); - if(currentTab === ""){ //Only add a notification if we are on the first tab - newDocumentTypePatternsCount = newDocumentTypePatternsCount + 1; - $("#documentTypePatternsTab").html( - `Document Type Patterns ` + - newDocumentTypePatternsCount + " new" + - `` - ); - } + if (currentTab === "") { + //Only add a notification if we are on the first tab + newDocumentTypePatternsCount = newDocumentTypePatternsCount + 1; + $("#documentTypePatternsTab").html( + `Document Type Patterns ` + + newDocumentTypePatternsCount + + " new" + + `` + ); + } }, error: function (xhr, status, error) { var errorMessage = xhr.responseText; @@ -899,15 +901,16 @@ function postExcludePatterns(match_pattern, match_pattern_type = 0, force) { toastr.error("Please highlight a pattern to exclude."); return; } - if(!force){ //If the user clicked the icon in the table, we make the change regardless - // if pattern exists in table already (unless another pattern overrules it) - var table = $("#exclude_patterns_table").DataTable(); - var itemIdColumnData = table.column(0).data().toArray(); - if (itemIdColumnData.includes(match_pattern)) { - toastr.success("Pattern already exists"); - return; + if (!force) { + //If the user clicked the icon in the table, we make the change regardless + // if pattern exists in table already (unless another pattern overrules it) + var table = $("#exclude_patterns_table").DataTable(); + var itemIdColumnData = table.column(0).data().toArray(); + if (itemIdColumnData.includes(match_pattern)) { + toastr.success("Pattern already exists"); + return; + } } -} $.ajax({ url: "/api/exclude-patterns/", @@ -921,14 +924,16 @@ function postExcludePatterns(match_pattern, match_pattern_type = 0, force) { success: function (data) { $("#candidate_urls_table").DataTable().ajax.reload(null, false); $("#exclude_patterns_table").DataTable().ajax.reload(null, false); - if(currentTab === ""){ //Only add a notification if we are on the first tab - newExcludePatternsCount = newExcludePatternsCount + 1; - $("#excludePatternsTab").html( - `Exclude Patterns ` + - newExcludePatternsCount + " new" + - `` - ); - } + if (currentTab === "") { + //Only add a notification if we are on the first tab + newExcludePatternsCount = newExcludePatternsCount + 1; + $("#excludePatternsTab").html( + `Exclude Patterns ` + + newExcludePatternsCount + + " new" + + `` + ); + } }, error: function (xhr, status, error) { var errorMessage = xhr.responseText; @@ -963,14 +968,16 @@ function postIncludePatterns(match_pattern, match_pattern_type = 0) { success: function (data) { $("#candidate_urls_table").DataTable().ajax.reload(null, false); $("#include_patterns_table").DataTable().ajax.reload(null, false); - if(currentTab === ""){ //Only add a notification if we are on the first tab - newIncludePatternsCount = newIncludePatternsCount + 1; - $("#includePatternsTab").html( - `Include Patterns ` + - newIncludePatternsCount + " new" + - `` - ); - } + if (currentTab === "") { + //Only add a notification if we are on the first tab + newIncludePatternsCount = newIncludePatternsCount + 1; + $("#includePatternsTab").html( + `Include Patterns ` + + newIncludePatternsCount + + " new" + + `` + ); + } }, error: function (xhr, status, error) { var errorMessage = xhr.responseText; @@ -1002,14 +1009,16 @@ function postTitlePatterns( success: function (data) { $("#candidate_urls_table").DataTable().ajax.reload(null, false); $("#title_patterns_table").DataTable().ajax.reload(null, false); - if(currentTab === ""){ //Only add a notification if we are on the first tab - newTitlePatternsCount = newTitlePatternsCount + 1; - $("#titlePatternsTab").html( - `Title Patterns ` + - newTitlePatternsCount + " new" + - `` - ); - } + if (currentTab === "") { + //Only add a notification if we are on the first tab + newTitlePatternsCount = newTitlePatternsCount + 1; + $("#titlePatternsTab").html( + `Title Patterns ` + + newTitlePatternsCount + + " new" + + `` + ); + } }, error: function (xhr, status, error) { var errorMessage = xhr.responseText; From 33ff1bbc14dd8ce57a6817dae43eabf26512d749 Mon Sep 17 00:00:00 2001 From: Kshaw362 Date: Thu, 30 May 2024 09:34:07 -0400 Subject: [PATCH 10/36] 79: comments now have correct styling --- sde_indexing_helper/static/css/collection_detail.css | 3 +-- .../templates/sde_collections/collection_detail.html | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/sde_indexing_helper/static/css/collection_detail.css b/sde_indexing_helper/static/css/collection_detail.css index affcf945..79386ac0 100644 --- a/sde_indexing_helper/static/css/collection_detail.css +++ b/sde_indexing_helper/static/css/collection_detail.css @@ -19,7 +19,7 @@ margin-top: -3; } .comment { - background-color: #f8f9fa; + background-color: transparent; border: 1px solid #ddd; padding: 10px; margin-bottom: 10px; @@ -29,7 +29,6 @@ color: #007bff; } .comment span { - color: #6c6840; font-size: 0.9em; margin-bottom: 10px; } diff --git a/sde_indexing_helper/templates/sde_collections/collection_detail.html b/sde_indexing_helper/templates/sde_collections/collection_detail.html index 8b6d8d8f..e5d136f9 100644 --- a/sde_indexing_helper/templates/sde_collections/collection_detail.html +++ b/sde_indexing_helper/templates/sde_collections/collection_detail.html @@ -186,8 +186,8 @@

{{ colle {% for comment in comments %}
{{ comment.user.username }} - {{ comment.created_at|date:"M. d, Y, P" }} -

{{ comment.text }}

+ {{ comment.created_at|date:"M. d, Y, P" }} +

{{ comment.text }}

{% empty %}

No comments yet

From 1a7fd6b20646a617a634f623831b900782eb9614 Mon Sep 17 00:00:00 2001 From: Michelle <88682822+emshahh@users.noreply.github.com> Date: Thu, 30 May 2024 09:59:41 -0400 Subject: [PATCH 11/36] fixed error from merge and added invisible column for exclude column --- .../static/js/candidate_url_list.js | 24 ++++++++++++++----- .../sde_collections/candidate_urls_list.html | 2 ++ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/sde_indexing_helper/static/js/candidate_url_list.js b/sde_indexing_helper/static/js/candidate_url_list.js index 68da9352..a538df73 100644 --- a/sde_indexing_helper/static/js/candidate_url_list.js +++ b/sde_indexing_helper/static/js/candidate_url_list.js @@ -109,18 +109,17 @@ function initializeDataTable() { { extend: "csv", exportOptions: { - columns: [0, 1, 2, 3, 10], + columns: [0, 2, 3, 10, 11], }, customize: function (csv) { var lines = csv.split("\n"); console.log("lines[1].split(", ")", lines[1].split(",")); const colInfo = { 0: $("#candidateUrlFilter").val() || "No input", - 1: $(".dropdown-1").val() || "SELECT", - 2: $("#candidateScrapedTitleFilter").val() || "No input", - 3: $("#candidateNewTitleFilter").val() || "No input", - 4: $(".dropdown-4").val() || "SELECT", - 5: dict[$(".dropdown-5").val()] || "SELECT", + 1: $("#candidateScrapedTitleFilter").val() || "No input", + 2: $("#candidateNewTitleFilter").val() || "No input", + 3: dict[$(".dropdown-5").val()] || "No Selection", + 4: $(".dropdown-1").val() || "No Selection", }; if (lines.length > 2) { var secondRow = lines[1].split(","); @@ -199,6 +198,19 @@ function initializeDataTable() { }, visible: false, }, + { + data: null, + render: function (data, type, row) { + const excludedDict = { + true: "Yes", + false: "No", + }; + + console.log("row.excluded", row.excluded); + return excludedDict[row.excluded]; + }, + visible: false, + }, ], createdRow: function (row, data, dataIndex) { if (data["excluded"]) { diff --git a/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html b/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html index 0043d520..0f2da7cf 100644 --- a/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html +++ b/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html @@ -83,6 +83,7 @@

Document Type
+
Exclude
@@ -107,6 +108,7 @@

+ From fead64bc89eab6a07df1801b6888f5f14eb5ce50 Mon Sep 17 00:00:00 2001 From: Kshaw362 Date: Fri, 31 May 2024 08:13:44 -0400 Subject: [PATCH 12/36] 79:wip on pagination --- .../static/css/candidate_url_list.css | 24 +++++++++++++++++++ .../static/js/candidate_url_list.js | 7 ++++-- .../sde_collections/candidate_urls_list.html | 4 +++- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/sde_indexing_helper/static/css/candidate_url_list.css b/sde_indexing_helper/static/css/candidate_url_list.css index da6dabbc..96322f18 100644 --- a/sde_indexing_helper/static/css/candidate_url_list.css +++ b/sde_indexing_helper/static/css/candidate_url_list.css @@ -271,4 +271,28 @@ letter-spacing: -0.02em; div.dt-container div.dt-info { padding-top: 0; white-space: normal; +} + +.page-link{ + color:white !important; + border:0.5px solid !important; + margin-left:3px; + margin-right:3px; +} +.page-link:hover{ + background-color: #0066CA !important; + +} + +.page-item.disabled .page-link { + color:grey!important; +} +.dt-paging-input{ + color:white; +} + +.dt-paging-input input{ + background-color: #3F4A58; + color: white; + border:solid 0.5px !important; } \ No newline at end of file diff --git a/sde_indexing_helper/static/js/candidate_url_list.js b/sde_indexing_helper/static/js/candidate_url_list.js index 8d5f1e17..4064f27e 100644 --- a/sde_indexing_helper/static/js/candidate_url_list.js +++ b/sde_indexing_helper/static/js/candidate_url_list.js @@ -93,10 +93,13 @@ function initializeDataTable() { ], pageLength: 100, stateSave: true, + layout: { + bottomEnd: 'inputPaging', + topEnd: 'inputPaging', + }, serverSide: true, orderCellsTop: true, - pagingType: "input", - dom: "ilBrtip", + // dom: "ilBrtip", buttons: [ "spacer", "csv", diff --git a/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html b/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html index ef84b8b2..722c5f92 100644 --- a/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html +++ b/sde_indexing_helper/templates/sde_collections/candidate_urls_list.html @@ -7,6 +7,7 @@ {% block stylesheets %} {{ block.super }} + {% endblock stylesheets %} @@ -17,7 +18,8 @@ - + + {% endblock javascripts %} From 698f123dcdfeff7d38d5a0a22b2e31b77b442b58 Mon Sep 17 00:00:00 2001 From: Kshaw362 Date: Fri, 31 May 2024 12:25:20 -0400 Subject: [PATCH 13/36] 79: adjusting pagination styling --- .../static/css/candidate_url_list.css | 13 +++++++++++++ sde_indexing_helper/static/css/project.css | 2 +- sde_indexing_helper/static/js/candidate_url_list.js | 1 - 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/sde_indexing_helper/static/css/candidate_url_list.css b/sde_indexing_helper/static/css/candidate_url_list.css index 96322f18..f5725690 100644 --- a/sde_indexing_helper/static/css/candidate_url_list.css +++ b/sde_indexing_helper/static/css/candidate_url_list.css @@ -295,4 +295,17 @@ letter-spacing: -0.02em; background-color: #3F4A58; color: white; border:solid 0.5px !important; +} + +.dt-inputpaging{ + float:right; +} + +.mr-auto{ + float: left; + width: 50%; +} + +.ml-auto{ + width:50%; } \ No newline at end of file diff --git a/sde_indexing_helper/static/css/project.css b/sde_indexing_helper/static/css/project.css index 9864209e..885c63eb 100644 --- a/sde_indexing_helper/static/css/project.css +++ b/sde_indexing_helper/static/css/project.css @@ -50,7 +50,7 @@ #candidate_urls_table_wrapper div.dt-info:first-of-type { display: inline-block; - width: 25%; + /* width: 25%; */ } #candidate_urls_table_wrapper div.dt-length, #exclude_patterns_table_wrapper div.dt-length, #include_patterns_table_wrapper div.dt-length, #document_type_patterns_table_wrapper div.dt-length, #title_patterns_table_wrapper div.dt-length{ diff --git a/sde_indexing_helper/static/js/candidate_url_list.js b/sde_indexing_helper/static/js/candidate_url_list.js index 4064f27e..3fac0197 100644 --- a/sde_indexing_helper/static/js/candidate_url_list.js +++ b/sde_indexing_helper/static/js/candidate_url_list.js @@ -95,7 +95,6 @@ function initializeDataTable() { stateSave: true, layout: { bottomEnd: 'inputPaging', - topEnd: 'inputPaging', }, serverSide: true, orderCellsTop: true, From 378f7aea1ae6aef81bafacd9ee912df6a8d52a99 Mon Sep 17 00:00:00 2001 From: Michelle <88682822+emshahh@users.noreply.github.com> Date: Fri, 31 May 2024 12:46:53 -0400 Subject: [PATCH 14/36] applying feedbacK --- .../static/js/candidate_url_list.js | 55 +++++++++++-------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/sde_indexing_helper/static/js/candidate_url_list.js b/sde_indexing_helper/static/js/candidate_url_list.js index f957c466..34f49026 100644 --- a/sde_indexing_helper/static/js/candidate_url_list.js +++ b/sde_indexing_helper/static/js/candidate_url_list.js @@ -69,9 +69,7 @@ function modalContents(tableName) { .attr("for", "checkbox_" + columnName.replace(/\s+/g, "_")) .text(columnName); var $caption = $("

") - .text( - candidateTableHeaderDefinitons[columnName] - ) + .text(candidateTableHeaderDefinitons[columnName]) .attr({ id: "caption", }); @@ -99,6 +97,7 @@ function initializeDataTable() { ["Show 25", "Show 50", "Show 100", "Show 500"], ], pageLength: 100, + colReorder: true, stateSave: true, serverSide: true, orderCellsTop: true, @@ -108,28 +107,42 @@ function initializeDataTable() { { extend: "csv", exportOptions: { - columns: [0, 2, 3, 10, 11], + columns: [0, 11, 2, 3, 10], }, customize: function (csv) { var lines = csv.split("\n"); - console.log("lines[1].split(", ")", lines[1].split(",")); - const colInfo = { - 0: $("#candidateUrlFilter").val() || "No input", - 1: $("#candidateScrapedTitleFilter").val() || "No input", - 2: $("#candidateNewTitleFilter").val() || "No input", - 3: dict[$(".dropdown-5").val()] || "No Selection", - 4: $(".dropdown-1").val() || "No Selection", - }; + // Reorder the header columns + var headers = lines[0].split(","); + var reorderedHeaders = [ + headers[0], + headers[4], + headers[1], + headers[2], + headers[3], + ]; + lines[0] = reorderedHeaders.join(","); + + // Add filter information in the footer + const secondRowFilters = [ + "Applied filters:", + `URL: ${$("#candidateUrlFilter").val() || "No input"}`, + `Exclude: ${$(".dropdown-1").val() || "No selection"}`, + `Scraped Title: ${ + $("#candidateNewTitleFilter").val() || "No input" + }`, + `New Title: ${dict[$(".dropdown-5").val()] || "No input"}`, + `Document Type: ${ + $("#candidateScrapedTitleFilter").val() || "No selection" + }`, + ]; + var appliedFiltersInfo = secondRowFilters.join("\n"); + + // Remove the second row with the filters if (lines.length > 2) { - var secondRow = lines[1].split(","); - // Modify the second row as needed - for (let key in colInfo) { - secondRow[key] = colInfo[key]; - } - - lines[1] = secondRow.join(","); + lines.splice(1, 1); } - return lines.join("\n"); + + return lines.join("\n") + appliedFiltersInfo; }, }, "spacer", @@ -204,8 +217,6 @@ function initializeDataTable() { true: "Yes", false: "No", }; - - console.log("row.excluded", row.excluded); return excludedDict[row.excluded]; }, visible: false, From 75cfaa7ef7576627991423646ecca35ee1f2245c Mon Sep 17 00:00:00 2001 From: 635487 <635487@bah.com> Date: Fri, 31 May 2024 09:54:57 -0700 Subject: [PATCH 15/36] 97-url-link: move link to right, change color --- .../static/css/candidate_url_list.css | 12 +++++++++++- sde_indexing_helper/static/js/candidate_url_list.js | 9 +++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/sde_indexing_helper/static/css/candidate_url_list.css b/sde_indexing_helper/static/css/candidate_url_list.css index 7dc4a32f..036ad516 100644 --- a/sde_indexing_helper/static/css/candidate_url_list.css +++ b/sde_indexing_helper/static/css/candidate_url_list.css @@ -298,4 +298,14 @@ div.dt-buttons .btn.processing:after { .headerDiv{ display: flex; justify-content: space-between; -} \ No newline at end of file +} + +.url-cell { + display:flex; + align-items: center; + justify-content: space-between; + } + + .url-icon { + color: #65B1EF; + } \ No newline at end of file diff --git a/sde_indexing_helper/static/js/candidate_url_list.js b/sde_indexing_helper/static/js/candidate_url_list.js index 23e151ee..d4d2cbaa 100644 --- a/sde_indexing_helper/static/js/candidate_url_list.js +++ b/sde_indexing_helper/static/js/candidate_url_list.js @@ -608,11 +608,12 @@ function getURLColumn() { return { data: "url", render: function (data, type, row) { - return ` open_in_new ${remove_protocol( + return `

${remove_protocol( data - )}`; + )} + open_in_new
`; }, }; } From 4a9945714baf07598edfc73568ddb19bb1b8a000 Mon Sep 17 00:00:00 2001 From: Kshaw362 Date: Fri, 31 May 2024 13:47:21 -0400 Subject: [PATCH 16/36] 79: pageLength working again --- .../static/js/candidate_url_list.js | 55 +++++++++++++------ 1 file changed, 39 insertions(+), 16 deletions(-) diff --git a/sde_indexing_helper/static/js/candidate_url_list.js b/sde_indexing_helper/static/js/candidate_url_list.js index 3fac0197..8ccab9ad 100644 --- a/sde_indexing_helper/static/js/candidate_url_list.js +++ b/sde_indexing_helper/static/js/candidate_url_list.js @@ -87,30 +87,53 @@ function initializeDataTable() { var candidate_urls_table = $("#candidate_urls_table").DataTable({ // scrollY: true, - lengthMenu: [ - [25, 50, 100, 500], - ["Show 25", "Show 50", "Show 100", "Show 500"], - ], + // lengthMenu: [ + // [25, 50, 100, 500], + // ["Show 25", "Show 50", "Show 100", "Show 500"], + // ], pageLength: 100, stateSave: true, layout: { bottomEnd: 'inputPaging', + topEnd: null, + topStart: { + // lengthMenu: [ + // [25, 50, 100, 500], + // ["Show 25", "Show 50", "Show 100", "Show 500"], + // ], + pageLength: { + menu: [[25, 50, 100, 500],["Show 25", "Show 50", "Show 100", "Show 500"]] + }, + buttons: [ + // "pageLength", + "spacer", + "csv", + "spacer", + { + text: "Customize Columns", + className: "customizeColumns", + action: function () { + modalContents("#candidate_urls_table"); + }, + }, + ], + } }, serverSide: true, orderCellsTop: true, // dom: "ilBrtip", - buttons: [ - "spacer", - "csv", - "spacer", - { - text: "Customize Columns", - className: "customizeColumns", - action: function () { - modalContents("#candidate_urls_table"); - }, - }, - ], + // buttons: [ + // "spacer", + // "csv", + // "spacer", + // { + // text: "Customize Columns", + // className: "customizeColumns", + // action: function () { + // modalContents("#candidate_urls_table"); + // }, + // }, + // ], select: { style: "os", selector: "td:nth-child(5)", From 61495890d6894e039705df14aeac2b5aa0ca6c00 Mon Sep 17 00:00:00 2001 From: Kshaw362 Date: Fri, 31 May 2024 13:55:25 -0400 Subject: [PATCH 17/36] 79: wip --- sde_indexing_helper/static/css/candidate_url_list.css | 4 ++-- sde_indexing_helper/static/js/candidate_url_list.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sde_indexing_helper/static/css/candidate_url_list.css b/sde_indexing_helper/static/css/candidate_url_list.css index f5725690..7e71e0a9 100644 --- a/sde_indexing_helper/static/css/candidate_url_list.css +++ b/sde_indexing_helper/static/css/candidate_url_list.css @@ -301,10 +301,10 @@ letter-spacing: -0.02em; float:right; } -.mr-auto{ +/* .mr-auto{ float: left; width: 50%; -} +} */ .ml-auto{ width:50%; diff --git a/sde_indexing_helper/static/js/candidate_url_list.js b/sde_indexing_helper/static/js/candidate_url_list.js index 8ccab9ad..ce6d5a0f 100644 --- a/sde_indexing_helper/static/js/candidate_url_list.js +++ b/sde_indexing_helper/static/js/candidate_url_list.js @@ -97,6 +97,7 @@ function initializeDataTable() { bottomEnd: 'inputPaging', topEnd: null, topStart: { + info:true, // lengthMenu: [ // [25, 50, 100, 500], // ["Show 25", "Show 50", "Show 100", "Show 500"], @@ -105,7 +106,6 @@ function initializeDataTable() { menu: [[25, 50, 100, 500],["Show 25", "Show 50", "Show 100", "Show 500"]] }, buttons: [ - // "pageLength", "spacer", "csv", "spacer", From 61e4a69fcc5a7cbf75baa803f8138ab5b59d03c3 Mon Sep 17 00:00:00 2001 From: Kshaw362 Date: Fri, 31 May 2024 14:06:04 -0400 Subject: [PATCH 18/36] 79: styling complete --- .../static/css/candidate_url_list.css | 12 ++++++++++-- sde_indexing_helper/static/css/project.css | 4 +++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/sde_indexing_helper/static/css/candidate_url_list.css b/sde_indexing_helper/static/css/candidate_url_list.css index 7e71e0a9..2f189c64 100644 --- a/sde_indexing_helper/static/css/candidate_url_list.css +++ b/sde_indexing_helper/static/css/candidate_url_list.css @@ -298,7 +298,10 @@ letter-spacing: -0.02em; } .dt-inputpaging{ - float:right; + /* float:right; */ + position: absolute; + right: 16px; + top: -27px; } /* .mr-auto{ @@ -308,4 +311,9 @@ letter-spacing: -0.02em; .ml-auto{ width:50%; -} \ No newline at end of file +} + +.custom-select-sm{ + margin-left:5px; +} + diff --git a/sde_indexing_helper/static/css/project.css b/sde_indexing_helper/static/css/project.css index 885c63eb..9e0c26a9 100644 --- a/sde_indexing_helper/static/css/project.css +++ b/sde_indexing_helper/static/css/project.css @@ -59,7 +59,8 @@ } #candidate_urls_table_wrapper div.dt-buttons { - width: 64%; + /* width: 64%; */ + float:right; justify-content: end; } @@ -233,6 +234,7 @@ body { .dt-info{ font-weight:900; font-size:16px; + margin-top:15px; } .buttons-csv, .customizeColumns{ From d0b630fd592fe319cdcf07269ef0eb4b4fb80776 Mon Sep 17 00:00:00 2001 From: Kshaw362 Date: Fri, 31 May 2024 14:16:18 -0400 Subject: [PATCH 19/36] 79: removing commented out code --- .../static/css/candidate_url_list.css | 7 ------ .../static/js/candidate_url_list.js | 22 ------------------- 2 files changed, 29 deletions(-) diff --git a/sde_indexing_helper/static/css/candidate_url_list.css b/sde_indexing_helper/static/css/candidate_url_list.css index 2f189c64..10440ab2 100644 --- a/sde_indexing_helper/static/css/candidate_url_list.css +++ b/sde_indexing_helper/static/css/candidate_url_list.css @@ -298,17 +298,10 @@ letter-spacing: -0.02em; } .dt-inputpaging{ - /* float:right; */ position: absolute; right: 16px; top: -27px; } - -/* .mr-auto{ - float: left; - width: 50%; -} */ - .ml-auto{ width:50%; } diff --git a/sde_indexing_helper/static/js/candidate_url_list.js b/sde_indexing_helper/static/js/candidate_url_list.js index ce6d5a0f..b0e31893 100644 --- a/sde_indexing_helper/static/js/candidate_url_list.js +++ b/sde_indexing_helper/static/js/candidate_url_list.js @@ -86,11 +86,6 @@ function initializeDataTable() { var false_icon = 'close'; var candidate_urls_table = $("#candidate_urls_table").DataTable({ - // scrollY: true, - // lengthMenu: [ - // [25, 50, 100, 500], - // ["Show 25", "Show 50", "Show 100", "Show 500"], - // ], pageLength: 100, stateSave: true, layout: { @@ -98,10 +93,6 @@ function initializeDataTable() { topEnd: null, topStart: { info:true, - // lengthMenu: [ - // [25, 50, 100, 500], - // ["Show 25", "Show 50", "Show 100", "Show 500"], - // ], pageLength: { menu: [[25, 50, 100, 500],["Show 25", "Show 50", "Show 100", "Show 500"]] }, @@ -121,19 +112,6 @@ function initializeDataTable() { }, serverSide: true, orderCellsTop: true, - // dom: "ilBrtip", - // buttons: [ - // "spacer", - // "csv", - // "spacer", - // { - // text: "Customize Columns", - // className: "customizeColumns", - // action: function () { - // modalContents("#candidate_urls_table"); - // }, - // }, - // ], select: { style: "os", selector: "td:nth-child(5)", From 7143394306d8e8b2cdc10dfce7ef3911f6eafc1d Mon Sep 17 00:00:00 2001 From: Kshaw362 Date: Fri, 31 May 2024 14:18:47 -0400 Subject: [PATCH 20/36] 79: merge issue --- sde_indexing_helper/static/js/candidate_url_list.js | 1 - 1 file changed, 1 deletion(-) diff --git a/sde_indexing_helper/static/js/candidate_url_list.js b/sde_indexing_helper/static/js/candidate_url_list.js index 8bcf183d..680bfe02 100644 --- a/sde_indexing_helper/static/js/candidate_url_list.js +++ b/sde_indexing_helper/static/js/candidate_url_list.js @@ -112,7 +112,6 @@ function initializeDataTable() { serverSide: true, orderCellsTop: true, pagingType: "input", - dom: "ilBrtip", buttons: [ "spacer", "csv", From afa295c3ecc238dbac8c24250bc2390de1a0daab Mon Sep 17 00:00:00 2001 From: 635487 <635487@bah.com> Date: Fri, 31 May 2024 11:41:17 -0700 Subject: [PATCH 21/36] 102-title-default: add collection name as default --- .../templates/sde_collections/collection_detail.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sde_indexing_helper/templates/sde_collections/collection_detail.html b/sde_indexing_helper/templates/sde_collections/collection_detail.html index 0f534b10..18e2c1ae 100644 --- a/sde_indexing_helper/templates/sde_collections/collection_detail.html +++ b/sde_indexing_helper/templates/sde_collections/collection_detail.html @@ -285,7 +285,7 @@

From 0043a80d2a2942928c31cf096c80fcb90a739265 Mon Sep 17 00:00:00 2001 From: Kshaw362 Date: Tue, 4 Jun 2024 12:13:50 -0400 Subject: [PATCH 29/36] 60: fixing header mismatch --- sde_indexing_helper/static/js/candidate_url_list.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sde_indexing_helper/static/js/candidate_url_list.js b/sde_indexing_helper/static/js/candidate_url_list.js index 26947eae..bf419a39 100644 --- a/sde_indexing_helper/static/js/candidate_url_list.js +++ b/sde_indexing_helper/static/js/candidate_url_list.js @@ -115,10 +115,10 @@ function initializeDataTable() { var headers = lines[0].split(","); var reorderedHeaders = [ headers[0], + headers[3], headers[4], headers[1], - headers[2], - headers[3], + headers[2] ]; lines[0] = reorderedHeaders.join(","); From b0dc79176a013cbedeffcfad4a2bef7a14df7fd0 Mon Sep 17 00:00:00 2001 From: Kshaw362 Date: Tue, 4 Jun 2024 12:50:16 -0400 Subject: [PATCH 30/36] 118: doc-type-fix --- sde_indexing_helper/static/js/candidate_url_list.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sde_indexing_helper/static/js/candidate_url_list.js b/sde_indexing_helper/static/js/candidate_url_list.js index c1bbfa90..fe1969ae 100644 --- a/sde_indexing_helper/static/js/candidate_url_list.js +++ b/sde_indexing_helper/static/js/candidate_url_list.js @@ -668,7 +668,7 @@ function getDocumentTypeColumn() { button_text = data ? dict[data] : "Select"; button_color = data ? "btn-success" : "btn-secondary"; return ` -
- + {% csrf_token %} {{ form|crispy }} From b48fde2c9b19dcf912e520df2c434ead31197543 Mon Sep 17 00:00:00 2001 From: Kshaw362 Date: Wed, 5 Jun 2024 11:20:00 -0400 Subject: [PATCH 36/36] 97: removing the icon name --- sde_indexing_helper/static/js/candidate_url_list.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sde_indexing_helper/static/js/candidate_url_list.js b/sde_indexing_helper/static/js/candidate_url_list.js index 57bba443..8999cfde 100644 --- a/sde_indexing_helper/static/js/candidate_url_list.js +++ b/sde_indexing_helper/static/js/candidate_url_list.js @@ -141,8 +141,13 @@ function initializeDataTable() { if (lines.length > 2) { lines.splice(1, 1); } - - return lines.join("\n") + appliedFiltersInfo; + let alteredLines = []; + lines.forEach((line) => { + let newLine = ""; + newLine = line.replace("open_in_new",""); + alteredLines.push(newLine); + }) + return alteredLines.join("\n") + appliedFiltersInfo; }, }, "spacer",