diff --git a/sde_indexing_helper/static/css/candidate_url_list.css b/sde_indexing_helper/static/css/candidate_url_list.css index 9568b431..3b45355e 100644 --- a/sde_indexing_helper/static/css/candidate_url_list.css +++ b/sde_indexing_helper/static/css/candidate_url_list.css @@ -322,6 +322,43 @@ letter-spacing: -0.02em; 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; +} + +.dt-inputpaging{ + position: absolute; + right: 16px; + top: -27px; +} +.ml-auto{ + width:50%; +} + +.custom-select-sm{ + margin-left:5px; +} + .selected{ background-color: inherit !important; } @@ -352,6 +389,15 @@ div.dt-buttons .btn.processing:after { justify-content: space-between; } +.url-cell { + display:flex; + align-items: center; + justify-content: space-between; + } + + .url-icon { + color: #65B1EF; + } #match_pattern_input, #title_pattern_input { background: #3F4A58; border-radius: 4px; @@ -399,5 +445,4 @@ div.dt-buttons .btn.processing:after { .dropdown-item:hover{ background-color: #0066CA !important; - - } \ No newline at end of file + } diff --git a/sde_indexing_helper/static/css/collection_detail.css b/sde_indexing_helper/static/css/collection_detail.css index 244c9465..4eb5caec 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/static/css/project.css b/sde_indexing_helper/static/css/project.css index 8150b59a..7beb44c1 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{ @@ -59,7 +59,8 @@ } #candidate_urls_table_wrapper div.dt-buttons { - width: 64%; + /* width: 64%; */ + float:right; justify-content: end; } @@ -234,6 +235,7 @@ body { .dt-info{ font-weight:900; font-size:16px; + margin-top:15px; } .buttons-csv, .customizeColumns{ @@ -357,3 +359,209 @@ body { box-shadow: 0px 8px 16px 0px #0037FA4D; } + +/* base_auth.html layout css */ + +.auth-wrapper { + height: 100vh; +} +.auth-col-1, .auth-col-2 { + width: 50%; +} + +.auth-col-1 { + background-image: url("../images/Content.png") !important; + height: 100vh; + background: no-repeat; +} +.auth-col-2-wrapper { + position: relative; +} + +.auth-sde-idx-helper { + justify-content: center; + display: flex; +} + +.auth-col-2 { + padding: 0; + background-color: rgba(5, 14, 25, 1); + margin: auto; +} + +.auth-content { + height: calc(100vh - 6rem); + display: flex; +} + +/* LOGIN PAGE CSS */ + +.signin { + padding-right: 30px; +} + +.login-links { + padding-top: 25px; + display: flex; + justify-content: center; + color: var(--NASA-DM-Link, rgba(101, 177, 239, 1)); + font-size: 13px; + cursor: pointer; +} + +.login-links a { + color: var(--NASA-DM-Link, rgba(101, 177, 239, 1)); +} + +#signup_form .form-label { + display: none; +} + +#id_password_helptext { + display: none; +} + +.login-card-wrapper { + width: 66%; +} + +.login-card { + margin-top: 70px; + background: rgba(21, 35, 46, 1); + padding: 32px 32px 40px 32px; + border: 1px solid var(--NASA-Secondary-Blue, rgba(167, 186, 205, 1)) +} + +.login { + justify-content: center; + align-items: center; + height: 100%; + margin-left: 0 !important; +} + +.login-title { +font-size: 32px; +font-weight: 600; +line-height: 48px; +letter-spacing: -0.03em; +text-align: center; +color: rgba(255, 255, 255, 1); +padding-bottom: 30px; +} + +.login-button { + background-color: rgba(0, 102, 202, 1) !important; + color: rgba(255, 255, 255, 1); + border: none !important; + width: 100%; +font-size: 15px; +font-weight: 500; +line-height: 17.58px; +border-radius: 5px; +padding: 11px 0; +cursor: pointer; +box-shadow: 0px 8px 16px 0px #0037FA4D; + +} + +#div_id_login .form-label, #div_id_password .form-label, #div_id_email .form-label{ + display: none; +} + +#placeholder { + color: rgba(255, 255, 255, 1); +} + +.title-wrapper h4 { + padding-bottom: 0; +} + +.title-wrapper{ + padding-bottom: 30px; +} + +.title-wrapper p { + margin-bottom: 0; + text-align: center; + color: rgba(255, 255, 255, 1); +} + +#id_password1_helptext ul { + font-size: 12px; + color: rgba(255, 255, 255, 1); +} + +.auth-col-2-wrapper input { + background: var(--NASA-Table, rgba(63, 74, 88, 1)); + border-radius: 5px; + color: rgba(255, 255, 255, 1); + padding: 9px 14px; + background-image: none !important; +} + +.auth-col-2-wrapper .form-control:focus { + background: var(--NASA-Table, rgba(63, 74, 88, 1)); + color: rgba(255, 255, 255, 1); +} + +.signup-errors { + margin: 0; +} + +/* FOOTER CSS */ + +.footer-wrapper { + position: absolute; + bottom: 0; + background: transparent; + width: 100%; + color: rgba(255, 255, 255, 1); + display: flex; + justify-content: center; +} + +.footer { + width: 93%; + height: 6rem; +} + +.footer-container { + border-top: 1px solid rgba(255, 255, 255, 1); + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + padding: 0; +} + +.footer-right-side-links { + display: flex; + align-items: center; +} + +.footer-nasa-link, .footer-nasa-link:hover, .footer-nasa-link:focus, .footer-copyright-link { + padding-right: 20px; + color: rgba(255, 255, 255, 1) !important; +} + +.footer-copyright-link a, .footer-contact-us-link:hover, .footer-contact-us-link:focus, .footer-contact-us-link { + color: rgba(255, 255, 255, 1); +} + +.footer-left-side-link{ + background-image: url("../images/NASA\ Logo.svg"); + width: 47px; +height: 38px; +} + +.footer-contact-us-link, .footer-left-side-link, .footer-nasa-link, .footer-copyright-link { + cursor: pointer; +} + +.base-html-footer-wrapper { + display: flex; + justify-content: center; +} + + + diff --git a/sde_indexing_helper/static/images/Content.png b/sde_indexing_helper/static/images/Content.png new file mode 100644 index 00000000..6d23288c Binary files /dev/null and b/sde_indexing_helper/static/images/Content.png differ diff --git a/sde_indexing_helper/static/images/NASA Logo.svg b/sde_indexing_helper/static/images/NASA Logo.svg new file mode 100644 index 00000000..748978f5 --- /dev/null +++ b/sde_indexing_helper/static/images/NASA Logo.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sde_indexing_helper/static/js/candidate_url_list.js b/sde_indexing_helper/static/js/candidate_url_list.js index c1bbfa90..c283f55d 100644 --- a/sde_indexing_helper/static/js/candidate_url_list.js +++ b/sde_indexing_helper/static/js/candidate_url_list.js @@ -14,6 +14,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) { @@ -35,11 +43,17 @@ function modalContents(tableName) { var checkboxCount = $("#modalBody input[type='checkbox']").length; if (checkboxCount > 0 && tableName === uniqueId) { - $modal = $("#hideShowColumnsModal").modal(); + $modal = $("#hideShowColumnsModal").modal({ + backdrop: 'static', + keyboard: true, + }); return; } - $modal = $("#hideShowColumnsModal").modal(); + $modal = $("#hideShowColumnsModal").modal({ + backdrop: 'static', + keyboard: true, + }); var table = $(tableName).DataTable(); if (tableName !== uniqueId) { $("#modalBody").html(""); @@ -61,9 +75,7 @@ function modalContents(tableName) { .attr("for", "checkbox_" + columnName.replace(/\s+/g, "_")) .text(columnName); var $caption = $("

") - .text( - candidateTableHeaderDefinitons[columnName] - ) + .text(candidateTableHeaderDefinitons[columnName]) .attr({ id: "caption", }); @@ -85,20 +97,81 @@ 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, + colReorder: true, stateSave: true, + layout: { + bottomEnd: 'inputPaging', + topEnd: null, + topStart: { + info:true, + pageLength: { + menu: [[25, 50, 100, 500],["Show 25", "Show 50", "Show 100", "Show 500"]] + }, + buttons: [ + "spacer", + "csv", + "spacer", + { + text: "Customize Columns", + className: "customizeColumns", + action: function () { + modalContents("#candidate_urls_table"); + }, + }, + ], + } + }, serverSide: true, orderCellsTop: true, pagingType: "input", - dom: "ilBrtip", buttons: [ - "spacer", - "csv", + { + extend: "csv", + exportOptions: { + columns: [0, 11, 2, 12, 10], + }, + customize: function (csv) { + var lines = csv.split("\n"); + // Reorder the header columns + var headers = lines[0].split(","); + var reorderedHeaders = [ + headers[0], + headers[3], + headers[4], + headers[1], + headers[2], + ]; + 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) { + lines.splice(1, 1); + } + let alteredLines = []; + lines.forEach((line) => { + let newLine = ""; + newLine = line.replace("open_in_new",""); + alteredLines.push(newLine); + }) + return alteredLines.join("\n") + appliedFiltersInfo; + }, + }, "spacer", { text: "Customize Columns", @@ -128,14 +201,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) { @@ -160,10 +225,36 @@ 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, + }, + { + data: null, + render: function (data, type, row) { + const excludedDict = { + true: "Yes", + false: "No", + }; + return excludedDict[row.excluded]; + }, + visible: false, + }, + { + data: null, + render: function (data, type, row) { + return row.generated_title; + }, + visible: false, + }, ], createdRow: function (row, data, dataIndex) { if (data["excluded"]) { - $(row).attr("style", "background-color: #ab387d !important"); + $(row).attr("style", "background-color: rgba(255, 61, 87, 0.36) !important"); } }, }); @@ -191,7 +282,6 @@ function initializeDataTable() { var exclude_patterns_table = $("#exclude_patterns_table").DataTable({ // scrollY: true, - serverSide: true, dom: "lBrtip", buttons: [ { @@ -249,8 +339,8 @@ function initializeDataTable() { { data: "candidate_urls_count", class: "text-center whiteText", - sortable: false, - }, + sortable: true, + }, { data: null, sortable: false, @@ -303,7 +393,6 @@ function initializeDataTable() { ], pageLength: 100, orderCellsTop: true, - serverSide: true, ajax: `/api/include-patterns/?format=datatables&collection_id=${collection_id}`, initComplete: function (data) { var table = $("#include_patterns_table").DataTable(); @@ -336,7 +425,7 @@ function initializeDataTable() { { data: "candidate_urls_count", class: "text-center whiteText", - sortable: false, + sortable: true, }, { data: null, @@ -360,7 +449,6 @@ function initializeDataTable() { var title_patterns_table = $("#title_patterns_table").DataTable({ // scrollY: true, - serverSide: true, dom: "lBrtip", buttons: [ { @@ -418,7 +506,7 @@ function initializeDataTable() { { data: "candidate_urls_count", class: "text-center whiteText", - sortable: false, + sortable: true, }, { data: null, @@ -468,7 +556,6 @@ function initializeDataTable() { }, }, ], - serverSide: true, lengthMenu: [ [25, 50, 100, 500], ["Show 25", "Show 50", "Show 100", "Show 500"], @@ -538,7 +625,7 @@ function initializeDataTable() { { data: "candidate_urls_count", class: "text-center whiteText", - sortable: false, + sortable: true, }, { data: null, @@ -583,6 +670,7 @@ function handleTabsClick() { function setupClickHandlers() { handleHideorShowSubmitButton(); + handleHideorShowKeypress(); handleAddNewPatternClick(); handleDeleteDocumentTypeButtonClick(); @@ -604,11 +692,12 @@ function getURLColumn() { return { data: "url", render: function (data, type, row) { - return ` open_in_new ${remove_protocol( + return `

${remove_protocol( data - )}`; + )} + open_in_new
`; }, }; } @@ -668,7 +757,7 @@ function getDocumentTypeColumn() { button_text = data ? dict[data] : "Select"; button_color = data ? "btn-success" : "btn-secondary"; return ` - diff --git a/sde_indexing_helper/templates/account/password_reset.html b/sde_indexing_helper/templates/account/password_reset.html index 8a2b7a5f..cb80ab4a 100644 --- a/sde_indexing_helper/templates/account/password_reset.html +++ b/sde_indexing_helper/templates/account/password_reset.html @@ -1,4 +1,4 @@ -{% extends "account/base.html" %} +{% extends "layouts/base_auth.html" %} {% load i18n %} {% load account %} @@ -6,20 +6,28 @@ {% block head_title %}{% translate "Password Reset" %}{% endblock %} -{% block inner %} +{% block content %} -

{% translate "Password Reset" %}

- {% if user.is_authenticated %} - {% include "account/snippets/already_logged_in.html" %} - {% endif %} - -

{% translate "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %}

- -
+
+ +
-

{% blocktranslate %}Please contact us if you have any trouble resetting your password.{% endblocktranslate %}

{% endblock %} diff --git a/sde_indexing_helper/templates/account/signup.html b/sde_indexing_helper/templates/account/signup.html index 189ab9e7..5a74a52e 100644 --- a/sde_indexing_helper/templates/account/signup.html +++ b/sde_indexing_helper/templates/account/signup.html @@ -1,22 +1,47 @@ -{% extends "account/base.html" %} +{% extends "layouts/base_auth.html" %} {% load i18n %} {% load crispy_forms_tags %} {% block head_title %}{% translate "Signup" %}{% endblock %} -{% block inner %} -

{% translate "Sign Up" %}

- -

{% blocktranslate %}Already have an account? Then please sign in.{% endblocktranslate %}

- -
- {% csrf_token %} - {{ form|crispy }} - {% if redirect_field_value %} - - {% endif %} - -
+{% block content %} +
+
+ +
+
{% endblock %} + diff --git a/sde_indexing_helper/templates/includes/footer.html b/sde_indexing_helper/templates/includes/footer.html index aa013344..780df48f 100644 --- a/sde_indexing_helper/templates/includes/footer.html +++ b/sde_indexing_helper/templates/includes/footer.html @@ -1,16 +1,21 @@ diff --git a/sde_indexing_helper/templates/layouts/base.html b/sde_indexing_helper/templates/layouts/base.html index 05c438d0..dd592429 100644 --- a/sde_indexing_helper/templates/layouts/base.html +++ b/sde_indexing_helper/templates/layouts/base.html @@ -46,7 +46,9 @@ {% endblock content %} - {% include 'includes/footer.html' %} + {% include 'includes/scripts.html' %} diff --git a/sde_indexing_helper/templates/layouts/base_auth.html b/sde_indexing_helper/templates/layouts/base_auth.html new file mode 100644 index 00000000..fa79311a --- /dev/null +++ b/sde_indexing_helper/templates/layouts/base_auth.html @@ -0,0 +1,70 @@ +{% load static %} + + + + + + + + {% block title %} + {% endblock title %} + | SDE Indexing Helper + + + + + + + + + + + + {% block stylesheets %} + {% endblock stylesheets %} + + +
+
+
+
+
+
+ + + + + + + + + +
+ {% block content %} + {% endblock content %} +
+
+ +
+
+ {% include 'includes/scripts.html' %} + {% include 'includes/scripts-sidebar.html' %} + + {% block javascripts %} + {% endblock javascripts %} + + \ No newline at end of file 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 c64778c3..cef56211 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 @@ - + + @@ -80,6 +82,14 @@

New Title
Document Type
ID
+ + + + +
Document Type
+
Exclude
+
generated_title
+ @@ -99,6 +109,13 @@

+ + + + + + + diff --git a/sde_indexing_helper/templates/sde_collections/collection_detail.html b/sde_indexing_helper/templates/sde_collections/collection_detail.html index 0f534b10..c119e6f6 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

@@ -285,7 +285,7 @@