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 @@
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 @@")
- .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 `Rename Collection
{{ comment.text }}
+ {{ comment.created_at|date:"M. d, Y, P" }} +{{ comment.text }}