From 5f143ff66888fd73a29b03e2c8ab7ca4977ae89a Mon Sep 17 00:00:00 2001 From: Chris Fulljames Date: Sat, 19 Apr 2025 06:56:34 -0400 Subject: [PATCH] Jam event tweaks and date fixes --- src/littlesongplace/static/nav.js | 6 +++++ src/littlesongplace/static/styles.css | 19 +++++++++++--- .../templates/jam-event-list.html | 11 ++++---- src/littlesongplace/templates/jam-event.html | 25 +++++++++++-------- 4 files changed, 43 insertions(+), 18 deletions(-) diff --git a/src/littlesongplace/static/nav.js b/src/littlesongplace/static/nav.js index 1e1af84..cd695aa 100644 --- a/src/littlesongplace/static/nav.js +++ b/src/littlesongplace/static/nav.js @@ -33,6 +33,12 @@ document.addEventListener("DOMContentLoaded", (e) => { // Update activity indicator status checkForNewActivity(); + + // Convert UTC to local date/time + document.querySelectorAll(".date").forEach((e) => { + let date = new Date(e.dataset.date); + e.textContent = date.toLocaleString(); + }); }); function onLinkClick(event) { diff --git a/src/littlesongplace/static/styles.css b/src/littlesongplace/static/styles.css index 74c3b10..8a143ea 100644 --- a/src/littlesongplace/static/styles.css +++ b/src/littlesongplace/static/styles.css @@ -27,6 +27,10 @@ h2 { font-size: 20px; } +h3 { + font-size: 16px; +} + textarea { font-family: sans-serif; font-size: 16px; @@ -35,14 +39,14 @@ textarea { border-radius: 10px; padding: 10px; background: var(--yellow); - height: 100px; + height: 200px; width: calc(100% - 20px); box-sizing: border-box; resize: vertical; margin: 10px; } -input[type=text], input[type=password], input[type=url] { +input[type=text], input[type=password], input[type=url], input[type=datetime-local] { background: var(--yellow); margin: 10px; font-family: sans-serif; @@ -51,7 +55,8 @@ input[type=text], input[type=password], input[type=url] { border: 3px solid var(--purple); border-radius: 10px; padding: 5px; - width: 200px; + width: 300px; + max-width: calc(100% - 40px); } .button, input[type=submit] { @@ -145,6 +150,14 @@ div.page-header { color: var(--purple); } +.info { + line-height: 2; +} + +.actions { + margin: 10px 0px; +} + /* Sliders (e.g. volume) */ input[type=range] { diff --git a/src/littlesongplace/templates/jam-event-list.html b/src/littlesongplace/templates/jam-event-list.html index 4340d7b..148c5e5 100644 --- a/src/littlesongplace/templates/jam-event-list.html +++ b/src/littlesongplace/templates/jam-event-list.html @@ -1,9 +1,9 @@ {% macro jam_event_list(list_title, events, date_label, which_date) %} {% if events %}

{{ list_title }}

-
+
+ {% endif %} {% endmacro %} diff --git a/src/littlesongplace/templates/jam-event.html b/src/littlesongplace/templates/jam-event.html index cd3da92..e36b87c 100644 --- a/src/littlesongplace/templates/jam-event.html +++ b/src/littlesongplace/templates/jam-event.html @@ -7,38 +7,43 @@

{% if event.hidden -%}[Upcoming Event]{%- else -%}{{ event.title }}{%- endif %} - {{ jam.title }}

-
+
Host: {{ jam.ownername }}
{% if event.startdate %} Start Date: - {{ event.startdate.strftime("%Y-%m-%d %I:%M%p") }} (UTC) +
{% endif %} {% if event.enddate %} End Date: - {{ event.enddate.strftime("%Y-%m-%d %I:%M%p") }} (UTC) + {% endif %}
{% if session["userid"] == jam.ownerid -%} -
+
{%- endif %}
+

Event Details

{% if event.hidden -%} - Event description is hidden until the event starts. + Event details are hidden until the event starts. {%- else -%} - {{ event.description }} + {{ (event.description.replace("\n", "
"))|safe }} {%- endif %}

About the Jam

-
+ +
+
{{ jam.description }}
@@ -62,7 +67,7 @@

@@ -76,8 +81,8 @@ (UTC)
- - Cancel +
+    Cancel
-- 2.39.5