From 47ed8c4d89f3b5645328ee6978f7cc65e774fccd Mon Sep 17 00:00:00 2001 From: ionous Date: Sat, 25 Oct 2025 15:45:53 -0700 Subject: [PATCH 1/2] editing: simplify delete text, improve page title - change document title bar and banner text based on add or edit event - move all delete text to the delete popup and put delete button inline with other buttons - move safety alert and help text directly under the save, etc. buttons - code tweak: add class for "published-button" to show/hide preview/published save/delete buttons all at once --- .../assets/css/cal/addevent.css | 5 ++ .../s2b_hugo_theme/assets/css/theme.css | 6 +++ .../s2b_hugo_theme/assets/js/cal/addevent.js | 14 +++-- .../layouts/caledit/single.html | 38 ++++++-------- .../layouts/partials/breadcrumbs.html | 2 +- .../layouts/partials/cal/edit.html | 52 ++++++------------- 6 files changed, 54 insertions(+), 63 deletions(-) diff --git a/site/themes/s2b_hugo_theme/assets/css/cal/addevent.css b/site/themes/s2b_hugo_theme/assets/css/cal/addevent.css index 6e166085..9ca77876 100644 --- a/site/themes/s2b_hugo_theme/assets/css/cal/addevent.css +++ b/site/themes/s2b_hugo_theme/assets/css/cal/addevent.css @@ -26,6 +26,10 @@ width:100%; background:white; padding: 8px 16px; + text-align: center; +} +.caledit-content { + text-align: center; } .unpublished-event { @@ -185,6 +189,7 @@ form#event-entry .date-select-container-style { .modal-dialog.modal-sm .modal-body { text-align:center; + padding: 15px; } .control-label { diff --git a/site/themes/s2b_hugo_theme/assets/css/theme.css b/site/themes/s2b_hugo_theme/assets/css/theme.css index be85f913..2130668c 100644 --- a/site/themes/s2b_hugo_theme/assets/css/theme.css +++ b/site/themes/s2b_hugo_theme/assets/css/theme.css @@ -511,6 +511,12 @@ body.boxed .navbar-affixed-top.affix { #login-modal { overflow: hidden; } +.modal-header { + text-align: center; +} +.modal-body { + padding: 5px 15px; +} #login-modal .modal-header h4 { text-transform: uppercase; } diff --git a/site/themes/s2b_hugo_theme/assets/js/cal/addevent.js b/site/themes/s2b_hugo_theme/assets/js/cal/addevent.js index 6223b082..6e9286c2 100644 --- a/site/themes/s2b_hugo_theme/assets/js/cal/addevent.js +++ b/site/themes/s2b_hugo_theme/assets/js/cal/addevent.js @@ -10,7 +10,13 @@ $.fn.getAddEventForm = function(id, secret, callback) { // TODO: loading spinner - if (id && secret) { + const editing = id && secret; + + // why do we have one page for editing and creating events? + $('.page-title').text(editing ? 'Edit Event' : 'Add Event'); + document.title = (editing ? 'Edit Event - Shift' : 'Add Event - Shift'); + + if (editing) { let url = new URL(API_RETRIEVE_URL); url.searchParams.set('id', id); url.searchParams.set('secret', secret); @@ -151,8 +157,7 @@ } if (shiftEvent.published) { - $('.published-save-button').show(); - $('.duplicate-button').show(); + $('.published-button').show(); // show the user's selected image after they select it: // first, attach to the input button. @@ -203,8 +208,7 @@ success: function(returnVal) { if (returnVal.published) { $('.unpublished-event').remove(); - $('.published-save-button').show(); - $('.duplicate-button').show(); + $('.published-button').show(); _isFormDirty = false; } if (!isNew) { diff --git a/site/themes/s2b_hugo_theme/layouts/caledit/single.html b/site/themes/s2b_hugo_theme/layouts/caledit/single.html index 50697b31..5c3282dc 100644 --- a/site/themes/s2b_hugo_theme/layouts/caledit/single.html +++ b/site/themes/s2b_hugo_theme/layouts/caledit/single.html @@ -1,26 +1,22 @@ {{ define "page_body" }} -
- - {{ partial "alert_banner.html" . }} - -
- {{ .Content }} - - {{ if isset .Params "pp" }} - {{ partial "cal/pp-header.html" . }} - {{ end }} -
- - -
- -
+
+
+ {{ if isset .Params "pp" }} + {{ partial "cal/pp-header.html" . }} + {{ end }} +
+
+
+ {{ .Content }} +
+ {{ partial "alert_banner.html" . }} +
{{ end }} {{ define "postscript" }} - {{ partial "cal/scripts.html" . }} - {{ partial "cal/edit.html" . }} +{{ partial "cal/scripts.html" . }} +{{ partial "cal/edit.html" . }} - + {{ end }} \ No newline at end of file diff --git a/site/themes/s2b_hugo_theme/layouts/partials/breadcrumbs.html b/site/themes/s2b_hugo_theme/layouts/partials/breadcrumbs.html index 6630f318..1df35f5a 100644 --- a/site/themes/s2b_hugo_theme/layouts/partials/breadcrumbs.html +++ b/site/themes/s2b_hugo_theme/layouts/partials/breadcrumbs.html @@ -7,7 +7,7 @@
-

{{ .Title }}

+

{{ .Title }}

diff --git a/site/themes/s2b_hugo_theme/layouts/partials/cal/edit.html b/site/themes/s2b_hugo_theme/layouts/partials/cal/edit.html index 9fb6e7b6..9362f89c 100644 --- a/site/themes/s2b_hugo_theme/layouts/partials/cal/edit.html +++ b/site/themes/s2b_hugo_theme/layouts/partials/cal/edit.html @@ -23,9 +23,16 @@

Are you sure you want to cancel?