diff --git a/app/static/css/createEvent.css b/app/static/css/createEvent.css new file mode 100644 index 000000000..cc181adc9 --- /dev/null +++ b/app/static/css/createEvent.css @@ -0,0 +1,14 @@ +.toggleHeader{ + padding-bottom: 10px; + font-weight: bold; + text-align: center; + margin-left: 50%; /* Position the header at 50% of the viewport width */ + transform: translateX(-50%); + width: 200px +} +.columnDivide{ + flex: 1; + border-left: 2px solid grey; + margin-left: 10px; + margin-right: -30px; +} \ No newline at end of file diff --git a/app/static/js/createEvents.js b/app/static/js/createEvents.js index ffaf80d4a..291e12f47 100644 --- a/app/static/js/createEvents.js +++ b/app/static/js/createEvents.js @@ -59,6 +59,12 @@ function calculateRecurringEventFrequency(){ } $(document).ready(function () { + //makes sure bonners toggle will stay on between event pages + if (window.location.pathname == '/event/' + $('#newEventID').val() + '/edit') { + if ($("#checkBonners")) { + $("#checkBonners").prop('checked', true); + } + } // Initialize datepicker with proper options $.datepicker.setDefaults({ dateFormat: 'yy/mm/dd', // Ensures compatibility across browsers @@ -98,10 +104,24 @@ $(document).ready(function () { $("#limitGroup").hide(); } }); + // Determine which checkbox was clicked and its current checked status, uncheck others + $("#checkIsTraining, #checkServiceHours, #checkBonners").on('click', function (event) { + $("#checkIsTraining, #checkServiceHours, #checkBonners").not($(event.target)).prop('checked', false); + }); - // Disable button when we are ready to submit $("#saveEvent").on('submit', function (event) { - $(this).find("input[type=submit]").prop("disabled", true); + let trainingStatus = $("#checkIsTraining").is(":checked") + let serviceHourStatus = $("#checkServiceHours").is(":checked") + let bonnersStatus = $("#checkBonners").is(":checked") + //check if user has selected a toggle, cancel form submission if not + if(trainingStatus || serviceHourStatus || bonnersStatus){ + // Disable button when we are ready to submit + $(this).find("input[type=submit]").prop("disabled", true); + } + else { + msgFlash("You must toggle event is a training, event earns service hours, or is a Bonners Scholars event!", "danger"); + event.preventDefault(); + } }); $("#checkIsRecurring").click(function () { diff --git a/app/templates/admin/createEvent.html b/app/templates/admin/createEvent.html index 9c4baedef..94947fccd 100644 --- a/app/templates/admin/createEvent.html +++ b/app/templates/admin/createEvent.html @@ -37,6 +37,7 @@ {% block styles %} {{super()}} + {% endblock %} {% block app_content %} @@ -59,10 +60,7 @@

{{page_title}}

- - {% if eventData.location %} - value="{{eventData.location}}" - {% endif %} +
@@ -134,7 +132,7 @@

{{page_title}}

{% if eventData.id %} - + {% endif %}
@@ -233,35 +231,42 @@

{{page_title}}

{% if page_title != 'Create All Volunteer Training' %}
-
-
+
+
+
-
-
-
- - -
-
-
-
- {% set hide = "" if eventData.isRsvpRequired else "display: none" %} -
- - +
+
+ {% set hide = "" if eventData.isRsvpRequired else "display: none" %} +
+ + +
+ +
- -
-
+
+
+ +
+ + +
+ {% if eventData['program'].isBonnerScholars %} +
+ + +
+ {% endif %}