From e1746bda9c6b9d4aee25ff2e3834951581320e40 Mon Sep 17 00:00:00 2001 From: "Karen A. Salamy" Date: Wed, 19 Jun 2024 18:32:37 +0000 Subject: [PATCH 1/2] Issue #263 - Request the removal of Geoman (Leaflet Plugin For Creating And Editing Geometry Layers) from Home Map. --- smdb/smdb/static/js/map.js | 46 ----------------------------- smdb/smdb/static/js/project.js | 11 ------- smdb/smdb/templates/base.html | 1 - smdb/smdb/templates/pages/home.html | 3 -- 4 files changed, 61 deletions(-) diff --git a/smdb/smdb/static/js/map.js b/smdb/smdb/static/js/map.js index 66bbe1e1..9796434d 100644 --- a/smdb/smdb/static/js/map.js +++ b/smdb/smdb/static/js/map.js @@ -466,49 +466,3 @@ L.Control.Layers.include({ return layers; }, }); - -//////// ADD GEOMAN for LEAFLET ///////// -var toggle = L.easyButton({ - position: "topright", - id: "geoMan", - states: [ - { - stateName: "add-geoman", - icon: "fas fa-draw-polygon fa-xl", - title: "Show Geometry Toolbar", - onClick: function (control) { - map.pm.addControls({ - position: "topright", - drawControls: true, - editControls: true, - editMode: false, - optionsControls: true, - customControls: true, - oneBlock: true, - enableGlobalRotateMode: true, - }); - control.state("remove-geoman"); - // Check Geoman Geometry Tool Status - if (control.state("remove-geoman")) { - console.log("Geoman menu open!"); - // toggle.onClick = updateMap(); - } - }, - }, - { - stateName: "remove-geoman", - icon: "fa-undo", - title: "Hide Geometry Toolbar", - onClick: function (control) { - map.pm.removeControls(); - control.state("add-geoman"); - // Check Geoman Geometry Tool Status - if (control.state("add-geoman")) { - console.log("Geoman menu closed!"); - } - // toggle.onClick = updateMap(); - }, - }, - ], -}); -toggle.addTo(map); diff --git a/smdb/smdb/static/js/project.js b/smdb/smdb/static/js/project.js index 68b44654..87f16521 100644 --- a/smdb/smdb/static/js/project.js +++ b/smdb/smdb/static/js/project.js @@ -28,17 +28,6 @@ function updateMap() { // Catch degenerate case when checkboxes aren't on the page and continue console.log(err.message); } - // Try and incorporate with updateMap() - Easy Button - if ((toggle = "remove-geoman")) { - console.log("This works."); - } - if ((toggle.stateName = "add-geoman")) { - console.log("Geoman is currently closed."); - toggle.stateName = "remove-geoman"; - } else if ((toggle.stateName = "remove-geoman")) { - console.log("Geoman is currently open."); - toggle.stateName = "add-geoman"; - } if (document.getElementById("searchbar") != null) { //if (document.getElementById("searchbar").value) { diff --git a/smdb/smdb/templates/base.html b/smdb/smdb/templates/base.html index 73751638..6948b86e 100644 --- a/smdb/smdb/templates/base.html +++ b/smdb/smdb/templates/base.html @@ -27,7 +27,6 @@ {# Add leaflet CSS #} - {# Your stuff: Third-party CSS libraries go here #} diff --git a/smdb/smdb/templates/pages/home.html b/smdb/smdb/templates/pages/home.html index c4368218..803f7b1f 100644 --- a/smdb/smdb/templates/pages/home.html +++ b/smdb/smdb/templates/pages/home.html @@ -68,9 +68,6 @@ integrity="sha512-pYExthzLUD0etGnsvN2vg1LOEBd0nAfIwgZWlxavdBPNc2JT+f9hDQrXJrIhHK5WmuHVAuAb8jDekD36P/pXhg==" crossorigin=""> -{# Load Leaflet Geometry Tool from CDN #} - - {# Load Leaflet Grouped Layers Control#} {##} From 3a750c5eb78e3fcaa532aaa4886463ba142f99a7 Mon Sep 17 00:00:00 2001 From: "Karen A. Salamy" Date: Wed, 23 Oct 2024 21:06:01 +0000 Subject: [PATCH 2/2] Added updates to filters.css, expedition_detail.html, mission_detail.html and forms.py to fix Issue #261 - Content of detail views hidden behind page header #261. --- smdb/smdb/forms.py | 19 ++--- smdb/smdb/static/css/filters.css | 70 ++++++++++++++++++- .../templates/smdb/expedition_detail.html | 4 +- smdb/smdb/templates/smdb/mission_detail.html | 7 +- 4 files changed, 84 insertions(+), 16 deletions(-) diff --git a/smdb/smdb/forms.py b/smdb/smdb/forms.py index d1043099..60d9d683 100644 --- a/smdb/smdb/forms.py +++ b/smdb/smdb/forms.py @@ -1,5 +1,5 @@ from crispy_forms.helper import FormHelper -from crispy_forms.layout import Layout, Submit, Row, Column, Reset +from crispy_forms.layout import Layout, Submit, Div, Row, Column, Reset class MissionFilterFormHelper(FormHelper): @@ -13,11 +13,12 @@ class MissionFilterFormHelper(FormHelper): Column("repeat_survey", css_class="form-group col-md mb-0"), Column("mgds_compilation", css_class="form-group col-md mb-0"), Column("expedition__name", css_class="form-group col-md mb-0"), - Column(Submit("submit", "Filter", css_class="col-md mb-0 btn-primary")), + Column(Submit("submit", "Filter", css_id="missionFilterSubmit", css_class="col-md mb-0 btn-primary")), Column( Reset( "clear", "Clear", + css_id="missionFilterCancel", css_class="col-md mb-0 btn-secondary", onclick="this.form.reset()", type="button", @@ -31,13 +32,14 @@ class ExpeditionFilterFormHelper(FormHelper): form_method = "GET" layout = Layout( Row( - Column("name", css_class="form-group col-md mb-0"), - Column(Submit("submit", "Filter", css_class="col-md mb-0 btn-primary")), + Column("name", css_id="expeditionFilterName", css_class="form-group col-md-3 mb-0"), + Column(Submit("submit", "Filter", css_id="expeditionFilterSubmit", css_class="col-sm-2 mb-0 btn-primary")), Column( Reset( "clear", "Clear", - css_class="col-md mb-0 btn-secondary", + css_id="expeditionFilterCancel", + css_class="col-sm-2 mb-0 btn-secondary", onclick="this.form.reset()", type="button", ) @@ -50,13 +52,14 @@ class CompilationFilterFormHelper(FormHelper): form_method = "GET" layout = Layout( Row( - Column("name", css_class="form-group col-md mb-0"), - Column(Submit("submit", "Filter", css_class="col-md mb-0 btn-primary")), + Column("name", css_id="compilationFilterName", css_class="form-group col-md-3 mb-0"), + Column(Submit("submit", "Filter", css_id="compilationFilterSubmit", css_class="col-md-2 mb-0 btn-primary")), Column( Reset( "clear", "Clear", - css_class="col-md mb-0 btn-secondary", + css_id="compilationFilterCancel", + css_class="col-md-2 mb-0 btn-secondary", onclick="this.form.reset()", type="button", ) diff --git a/smdb/smdb/static/css/filters.css b/smdb/smdb/static/css/filters.css index 666fa246..4f59dca8 100644 --- a/smdb/smdb/static/css/filters.css +++ b/smdb/smdb/static/css/filters.css @@ -102,6 +102,14 @@ div.col-md { margin-top: 10px; } +/* Buttons */ +div.form-group.col-md-2, +div.col-md-2 { + width: 30%; + margin-bottom: 10px; + margin-top: 10px; +} + form.leaflet-control-layers-list { top: 0px; margin-right: 0px; @@ -114,9 +122,9 @@ div.row { height: 55px; } -#div_id_name { +/* #div_id_name { align-content: center; -} +} */ #submit_id_submit, .btn, .btn-primary { border: 1.75px solid; @@ -142,6 +150,13 @@ div#tableContainers4.table-container { width: 95%; } +div#div_id_name.mb-3 { + width: 100%; + margin-top: 0.5rem !important; + margin-bottom: 0.5rem !important; +} + + #slider-row { margin-left: 0.5rem; margin-right: 0.5rem; @@ -163,6 +178,57 @@ div#tableContainers4.table-container { width: 80% } +.mb-0 +#missionFilterSubmit { + margin-bottom: 0.5rem !important; + margin-top: 0.5rem !important; +} + +#mission_detail_row { + position: relative; + padding-top: 100px; + padding-bottom: 25px; +} + +#mission_detail_notes_row, h3 { + position: relative; + padding-right: 25px; + top: 10px; +} + +.mb-0 +#expeditionFilterSubmit { + margin-bottom: 0.5rem !important; + margin-top: 0.5rem !important; +} + +.col-md +#expeditionFilterSubmit { + width: 30% +} + +#expedition_detail_row { + width: 30%; +} + +#expedition_detail_row { + position: relative; + padding-top: 100px; + padding-bottom: 25px; +} + +.mb-0 +#compilationFilterSubmit { + margin-bottom: 0.5rem !important; + margin-top: 0.5rem !important; +} + +#compilation_detail_row { + position: relative; + padding-top: 100px; + padding-bottom: 25px; +} + form#searchBarForm { top: 0px; position: relative; diff --git a/smdb/smdb/templates/smdb/expedition_detail.html b/smdb/smdb/templates/smdb/expedition_detail.html index f07570ca..8c21f6cc 100644 --- a/smdb/smdb/templates/smdb/expedition_detail.html +++ b/smdb/smdb/templates/smdb/expedition_detail.html @@ -14,8 +14,8 @@ {% block content %} -
-
+
+

{{ expedition.name }}

Missions:

diff --git a/smdb/smdb/templates/smdb/mission_detail.html b/smdb/smdb/templates/smdb/mission_detail.html index 3fdbdf2c..fafe94ca 100644 --- a/smdb/smdb/templates/smdb/mission_detail.html +++ b/smdb/smdb/templates/smdb/mission_detail.html @@ -15,8 +15,8 @@ {% block content %} -
-
+
+

Mission {{ mission.name }}

@@ -66,8 +66,7 @@

Used in Compilations:

-

-
+

Notes:

{{ mission.notes_text }}