From: Chuck Scott Date: Tue, 9 Jul 2019 21:02:29 +0000 (-0400) Subject: Fixed displaying selectable date cells when there was no inventory. X-Git-Tag: v3.0.1~1^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=a549895305a0be5663f2da813a994b2ab37978be;p=web%2FEventManagement-V3.git Fixed displaying selectable date cells when there was no inventory. Added quantity tooltips to date cells. --- diff --git a/views/front/PointerBoat/Shop/start.html b/views/front/PointerBoat/Shop/start.html index 112e49f..c8e77c2 100755 --- a/views/front/PointerBoat/Shop/start.html +++ b/views/front/PointerBoat/Shop/start.html @@ -36,12 +36,12 @@ {end:} - {foreach:membersList,m} + {foreach:membersList,m}
{end:} - - + + {foreach:p.sections,s}

 

-
+
{if:!p.oneSectionOnly} {s.sectionDetail.name}
@@ -106,22 +106,22 @@
- + {foreach:s.ticketsData,x} - {if:!x.tooLateToBuy} + {if:!x.tooLateToBuy}
{if:option.ticket_selection.include_options_in_ticket_list}
Price: 
-
+
{x.price}
Select date: 
-
+
@@ -129,14 +129,14 @@
-
Quant: 
-
+
Select from available tickets: 
+
(select date)
{end:} -
+
{if:option.ticket_selection.include_options_in_ticket_list}
{x.title}
{else:} @@ -171,18 +171,18 @@
-
+
{end:}
{end:} {end:}
- + {end:} - - - -
+ + + +
{end:}
@@ -198,25 +198,25 @@ {startScript:h} var addButtonPushed = false; - + // Dates for inventory data var tickets = {ticketsJSON:h}; - + var ticketQuantSelection = '\ \ '; - + var ticketTooLate = '\

\ Sorry, too late to select these {term.ticket.plur} on-line.\

\ - '; - + '; + + - $(document).ready(function(){ - - // Code to kick off the geolocation-display feature + + // Code to kick off the geolocation-display feature function doLocationMap(id) { $("#locationMap_" + id).geolocate({ lat: "#lat_" + id, @@ -236,26 +236,7 @@ {foreach:membersList,m} doLocationMap({m.id}); {end:} - - // DatePicker action - function avail(date) { - m = (date.getMonth()+1); - if (m < 10) { - m = '0' + m; - } - d = date.getDate(); - if (d < 10) { - d = '0' + d; - } - y = date.getFullYear(); - mdy = m + '/' + d + '/' + y; - if (dates[mdy]) { - return [true,"","Available"]; - } else { - return [false,"","Not Available"]; - } - } - + // for each ticket $.each(tickets, function(index, ticket) { @@ -268,28 +249,39 @@ // Count the number of dates dateCount++; - + // If this is the first one, store it in case it's the only one dateData = date; - + }); // each date // if there's no date specific tickets if (!ticket.dateSpecific) { - // Populate date input field + // Populate date input field $('#GLMeventDateSelect_' + ticket.id).html(''); doQuantSelection(ticket.id, dateData.id, dateData.available, dateData.tooLate); // if there's only one date, then display that and move on. } else if (!ticket.dateSpecific || dateCount == 1) { - + // populate date input field $('#GLMeventDate_' + ticket.id).html('
Date:
' + dateData['date'] + '
'); doQuantSelection(ticket.id, dateData.id, dateData.available, dateData.tooLate); - + } else { - + + function appendToMonth() { + if($('#mouseOverMsg').length == 0) { + $('.ui-datepicker-header').append('
Hover mouse over date to see availability.
'); + } + $('#mouseOverMsg').fadeOut('slow').fadeIn('slow').fadeOut('slow').fadeIn('slow').fadeOut('slow').fadeIn('slow'); + } + + $('#GLMeventDateInput_' + ticket.id).on('click', function(){ + setTimeout(appendToMonth, 100); + }) + // DatePicker action function avail(date) { m = (date.getMonth()+1); @@ -303,17 +295,21 @@ y = date.getFullYear(); mdy = m + '/' + d + '/' + y; if (inventory[mdy]) { - return [true,"","Available"]; + if (inventory[mdy]["available"] != "0") { + return [true,"",inventory[mdy]["available"] + " Available"]; + } else { + return [false,"","Not Available"]; + } } else { return [false,"","Not Available"]; } + setTimeout(sayit(), 2000); } - + // Use the date picker to select a date $('#GLMeventDateInput_' + ticket.id).datepicker({ beforeShowDay: avail, dateFormat: "mm/dd/yy", -// *** NEED TO FIX REFERENCE TO "performanceDetail" since that's not available on this page minDate: "{performanceDetail.start_date.date}", maxDate: "{performanceDetail.end_date.date}", onSelect: function(selectedDate, inst) { @@ -322,14 +318,12 @@ $('#GLMeventInvID_' + ticket.id).val(dateData.id); doQuantSelection(ticket.id, dateData.id, dateData.available, dateData.tooLate); } // Date Selection - }); // Date Picker - - + } - + }); // each ticket - + function doQuantSelection(id, invId, available, tooLate) { // Build the ticket quant options @@ -342,10 +336,10 @@ if (tooLate) { $('#GLMticketQuantContainer_' + id).html(ticketTooLate); } else { - + // note that the braced lte below is needed to inject a less-than-or-equal-to operator without having flexy chew on it. for (var i = 1; i {lte:h} (selectMax*1); i++) { - ticketQuants = ticketQuants.concat(''); + ticketQuants = ticketQuants.concat(''); } // Populate the ticket quantity container @@ -371,16 +365,16 @@ setBlocker(); $('#GLMselectForm').submit(); } else { - alert('Please select a {term.ticket.norm} quantity.') + alert('Please select a {term.ticket.norm} quantity.') return false; } - + }); - + function setBlocker() { $('#glmReloadBlocker').show(); } - + });