adding the month dropdown for the events calendar view
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 13 Jul 2017 18:09:36 +0000 (14:09 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 13 Jul 2017 18:09:36 +0000 (14:09 -0400)
replacing the events month switcher dropdown for the calendar view in the agenda view
theme file

glm-member-db-events/views/front/events/agenda.html

index 7e6a6f1..d8eedf4 100644 (file)
     <a class="prev-month bottom-prev-month" href="{$currentUrl}?glm_event_from={$query_prev_from}&glm_event_to={$query_prev_to}">Previous Month</a>
 
     <a class="next-month bottom-next-month" href="{$currentUrl}?glm_event_from={$query_next_from}&glm_event_to={$query_next_to}">Next Month</a>
+    {assign var="current_year" value=$smarty.now|date_format:"%Y"}
+    {assign var="current_month" value=$smarty.now|date_format:"%m"}
+
+    <div id="event-date-toggle-container">
+        <label class="date-toggle-label" for="#event-date-toggle"> Select a Date <label>
+        <select id="event-date-toggle">
+            {foreach $months as $year=>$month}{
+                {foreach $month as $m=>$value}
+                    {if $current_month == $value.date && $current_year == $year}
+                        <option value="{$year}-{$value.date}-01" selected> {$value.name} - {$year}</option>
+                    {else}
+                        <option value="{$year}-{$value.date}-01"> {$value.name} - {$year}</option>
+                    {/if}
+                {/foreach}
+            {/foreach}
+        </select>
+    </div>
         <!-- Calendar -->
     <div id="eventCalendar" style='position: relative;'>
         <div class='event-overlay'>