From a0eb8999a653c257d7320b3cc790371439363a48 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Fri, 20 Jun 2014 12:12:52 -0400 Subject: [PATCH] Update Cruise Schedule app Update for styles to use foundation to help align things better. --- Toolkit/Schedule/EditSchedule.php | 6 + Toolkit/Schedule/ListSchedules.php | 16 ++- Toolkit/Schedule/application.ini | 2 +- Toolkit/Schedule/js/editSchedule.js | 25 ++-- Toolkit/Schedule/templates/departureRow.html | 55 +++++-- Toolkit/Schedule/templates/editSchedule.html | 136 +++++++++++------- Toolkit/Schedule/templates/listSchedules.html | 15 +- .../Schedule/templates/scheduleCalendar.html | 4 +- templates/template.html | 1 - 9 files changed, 160 insertions(+), 100 deletions(-) diff --git a/Toolkit/Schedule/EditSchedule.php b/Toolkit/Schedule/EditSchedule.php index 3a35135..96d7454 100644 --- a/Toolkit/Schedule/EditSchedule.php +++ b/Toolkit/Schedule/EditSchedule.php @@ -469,6 +469,12 @@ class Toolkit_Schedule_EditSchedule */ public function toHtml($registry) { + $GLOBALS['topScripts'][] + = MEDIA_BASE_URL . 'libjs/vendor/modernizr.js'; + $GLOBALS['styleSheets'][] + = MEDIA_BASE_URL . 'css/foundation.css'; + $GLOBALS['bottomScripts'][] + = MEDIA_BASE_URL . 'libjs/foundation.min.js'; $GLOBALS['styleSheets'][] = GLM_APP_BASE_URL . 'libjs/jqueryui/1.8.13/development-bundle/themes/cupertino/jquery.ui.all.css'; diff --git a/Toolkit/Schedule/ListSchedules.php b/Toolkit/Schedule/ListSchedules.php index f9bd659..4dfceff 100644 --- a/Toolkit/Schedule/ListSchedules.php +++ b/Toolkit/Schedule/ListSchedules.php @@ -4,21 +4,27 @@ class Toolkit_Schedule_ListSchedules { /** * toHtml - * + * * output the html for listing schedules - * + * * @param type $registry - * @return type + * @return type */ public function toHtml($registry) { $GLOBALS['bottomScripts'][] - = BASE_URL . 'Toolkit/Schedule/js/listSchedule.js'; + = MEDIA_BASE_URL . 'Toolkit/Schedule/js/listSchedule.js'; + $GLOBALS['topScripts'][] + = MEDIA_BASE_URL . 'libjs/vendor/modernizr.js'; + $GLOBALS['styleSheets'][] + = MEDIA_BASE_URL . 'css/foundation.css'; + $GLOBALS['bottomScripts'][] + = MEDIA_BASE_URL . 'libjs/foundation.min.js'; $tpl = new HTML_Template_Flexy($registry->flexyOptions); $page = new stdClass(); $page->baseUrl = BASE_URL; $page->editLinkUrlBase - = BASE_URL . 'admin/schedules.php?rt=Edit&id='; + = MEDIA_BASE_URL . 'admin/schedules.php?rt=Edit&id='; $whichActiveSql = " SELECT id FROM schedules diff --git a/Toolkit/Schedule/application.ini b/Toolkit/Schedule/application.ini index a18c7f2..2db38a8 100644 --- a/Toolkit/Schedule/application.ini +++ b/Toolkit/Schedule/application.ini @@ -13,7 +13,7 @@ months.start = 4 ; the ending month to use in the multiple date picker months.end = 12 ; controls the width of the dialog box for the multiple date picker -months.width = 500 +months.width = 540 ; controls the height of the dialog box for the multiple date picker months.height = 580 diff --git a/Toolkit/Schedule/js/editSchedule.js b/Toolkit/Schedule/js/editSchedule.js index 6d73926..9417b8a 100644 --- a/Toolkit/Schedule/js/editSchedule.js +++ b/Toolkit/Schedule/js/editSchedule.js @@ -81,12 +81,13 @@ var EditSchedule = EditSchedule.setupDepartureById(departureId); } }); + return false; }); // set up removedepartureSet click event $('.removeDepartureSet').live('click', function(){ var go = confirm('This will delete the entire Set!\nAre you sure?'); if (go) { - $(this).parent().remove(); + $(this).parent().parent().parent().parent().parent().remove(); $.ajax({ cache: false, url: glm_baseUrl + "schedules/Edit/removeDepartureSet/", @@ -121,7 +122,7 @@ var EditSchedule = $('.commentSave').live('click', function(){ var departureId = $(this).attr('rel'); var comments = $('#comments' + departureId).val(); - + $.ajax({ cache: false, url: glm_baseUrl + "schedules/Edit/updateComment/", @@ -141,7 +142,7 @@ var EditSchedule = $('.nameSave').live('click', function(){ var scheduleId = $(this).attr('rel'); var name = $('#scheduleNameText').val(); - + $.ajax({ cache: false, url: glm_baseUrl + "schedules/Edit/updateName/", @@ -247,9 +248,9 @@ var EditSchedule = "Edit Time": function() { var bValid = true; allFields.removeClass( "ui-state-error" ); - + bValid = bValid && checkLength( depart_time, "Time", 4); - + if (depart_time.val()) { bValid = bValid && checkRegexp( depart_time, /([0-9]{1,2}:[0-9]{2} [APMapm]{2})$/i, "time in HH:MM AM or PM" ); } @@ -286,14 +287,14 @@ var EditSchedule = $('.chxTime.addTime[rel="'+data.departure_id+'"]').before( '' ); } else if (data.dock == 2) { $('.bviTime.addTime[rel="'+data.departure_id+'"]').before( '' ); } @@ -305,7 +306,7 @@ var EditSchedule = } }); } - + $( this ).dialog( "close" ); } }, @@ -317,7 +318,7 @@ var EditSchedule = allFields.val( "" ).removeClass( "ui-state-error" ); } }); - + }, // setup the departures by id setupDepartureById: function(id){ @@ -336,13 +337,13 @@ var EditSchedule = } }); }); - + $('#departureCal' + id).click(function(){ var ajaxUrl = glm_baseUrl + "schedules/Edit/getCalendarYear/"; var departureId = $(this).attr('rel'); var timeDate = new Date(); - ajaxUrl += "?id=" + glm_scheduleId - + "&departId=" + id + ajaxUrl += "?id=" + glm_scheduleId + + "&departId=" + id + "&year=" + glm_scheduleYear + "&_=" + timeDate.getTime(); $('#departure' + departureId).load(ajaxUrl).dialog({ diff --git a/Toolkit/Schedule/templates/departureRow.html b/Toolkit/Schedule/templates/departureRow.html index 5ddda04..d878ab7 100644 --- a/Toolkit/Schedule/templates/departureRow.html +++ b/Toolkit/Schedule/templates/departureRow.html @@ -1,17 +1,42 @@ -
-
- +
+
+
+
+
+
+ +
+
+ Calendar Dates + + +
+
+ +
+ +
+ +
+
-
- Calendar Dates - - -
-
- - -
- + +
\ No newline at end of file diff --git a/Toolkit/Schedule/templates/editSchedule.html b/Toolkit/Schedule/templates/editSchedule.html index 4d5394f..0d7cd4e 100644 --- a/Toolkit/Schedule/templates/editSchedule.html +++ b/Toolkit/Schedule/templates/editSchedule.html @@ -1,6 +1,6 @@ - -
- - -
-
- {pageSelect:h} - -
- - - - -
-

Must enter in date format. hh:mm AM or PM

-
-
- - - - - -
-
+ flexy:prefix="glm_" + appBase="appBase" + baseUrl="baseUrl" + scheduleYear="year" + scheduleId="scheduleId" + departures="colors" + timesChx="timesChx" + timesBvi="timesBvi" + dates="dates" + monthsWidth="monthsWidth" + monthsHeight="monthsHeight" + /> +
+
+ +
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ + + + +
+

Must enter in date format. hh:mm AM or PM

+ +
+ + + + + +
+ +
+
\ No newline at end of file diff --git a/Toolkit/Schedule/templates/listSchedules.html b/Toolkit/Schedule/templates/listSchedules.html index 153ece7..821c7e1 100644 --- a/Toolkit/Schedule/templates/listSchedules.html +++ b/Toolkit/Schedule/templates/listSchedules.html @@ -6,17 +6,10 @@
Boat Schedules -
+
+
-
- - Edit -
-
\ No newline at end of file + diff --git a/Toolkit/Schedule/templates/scheduleCalendar.html b/Toolkit/Schedule/templates/scheduleCalendar.html index a0c30d9..d17afcb 100644 --- a/Toolkit/Schedule/templates/scheduleCalendar.html +++ b/Toolkit/Schedule/templates/scheduleCalendar.html @@ -13,7 +13,7 @@ $(document).ready(function(){ $.ajax({ cache: false, url: glm_baseUrl + "schedules/Edit/updateDates/", - data: "id=" + scheduleId + data: "id=" + scheduleId + "&departId=" + departureId + "&date=" + dateSelected, success: function(className){ @@ -33,4 +33,6 @@ table.cals td {border:solid 1px black;width:5px;height:5px;text-align:center;} .selected {position:relative;top:0;left:0;padding:0;margin:0;background-color:lightgreen;width:10px;height:10px;} {style:h} +
    {calendarsHtml:h} +
diff --git a/templates/template.html b/templates/template.html index da9b6ae..d3426e8 100644 --- a/templates/template.html +++ b/templates/template.html @@ -156,7 +156,6 @@
- -- 2.17.1