Adding event detail view and model
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 26 Feb 2016 21:58:15 +0000 (16:58 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 26 Feb 2016 21:58:15 +0000 (16:58 -0500)
Add model for the detail shortcode.
Add view for the event detail.
Create two php files for the event data to use for the data for each
model and view file.

js/dashboard.js [new file with mode: 0644]
models/front/events/detail.php [new file with mode: 0644]
models/front/events/list.php
models/front/events/testCategoryData.php [new file with mode: 0644]
models/front/events/testEventsData.php [new file with mode: 0644]
views/front/events/dashboard.html
views/front/events/detail.html [new file with mode: 0644]
views/front/events/list.html
views/front/events/searchForm.html

diff --git a/js/dashboard.js b/js/dashboard.js
new file mode 100644 (file)
index 0000000..88b36f5
--- /dev/null
@@ -0,0 +1,5 @@
+(function(){
+    console.info('Running GLM Event plugin js');
+    $('#glm-event-from').datepicker();
+    $('#glm-event-to').datepicker();
+}).call(this);
diff --git a/models/front/events/detail.php b/models/front/events/detail.php
new file mode 100644 (file)
index 0000000..f37ba79
--- /dev/null
@@ -0,0 +1,129 @@
+<?php
+/**
+ * detail.php
+ *
+ * This is the Member Event Plugin model for the front detail shortcode.
+ * Handles the view of the detail pages.
+ */
+
+require_once GLM_MEMBERS_EVENTS_PLUGIN_CLASS_PATH . '/data/dataEvents.php';
+
+/**
+ * GLmMembersFront_event_detail
+ *
+ * @uses      GlmDataEvents
+ * @package   GlmMemberEvents
+ * @version   0.0.1
+ * @copyright Copyright (c) 2010 All rights reserved.
+ * @author    Steve Sutton <steve@gaslightmedia.com>
+ * @license PHP Version 3.0 {@link http://www.php.net/license/3_0.txt}
+ */
+class GLmMembersFront_events_detail extends GlmDataEvents
+{
+    public $wpdb;
+    public $config;
+
+    /**
+     * __construct
+     *
+     * @param mixed $wpdb   The main Word Press DB Object
+     * @param mixed $config The main Config
+     *
+     * @access public
+     * @return void
+     */
+    public function __construct($wpdb, $config)
+    {
+        $this->wpdb = $wpdb;
+        $this->config = $config;
+
+        parent::__construct(false, false);
+    }
+
+    private function getModelEventData($eventId)
+    {
+        $events = $this->getModelEventsData();
+        return array_filter($events, function($data) use($eventId) {
+            return $data['id'] == $eventId;
+        });
+    }
+    private function getCategories()
+    {
+        include GLM_MEMBERS_EVENTS_PLUGIN_PATH. '/models/front/events/testCategoryData.php';
+        return $categories;
+    }
+    private function getModelEventsData($categoryId = null)
+    {
+        include GLM_MEMBERS_EVENTS_PLUGIN_PATH. '/models/front/events/testEventsData.php';
+        if ($categoryId) {
+            return array_filter($events, function($data) use($categoryId) {
+                return ($data['category'] == $categoryId) ? 1 : 0;
+            });
+        }
+        return $events;
+    }
+    /**
+     * modelAction
+     *
+     * @param bool $actionData Action Data passed to the modelAction
+     *
+     * @access public
+     * @return void
+     */
+    public function modelAction($actionData = false)
+    {
+        $action = '';
+        $settings = $event = array();
+
+        if ($eventId = filter_var($_REQUEST['eventId'], FILTER_VALIDATE_INT)) {
+            $search = true;
+            $action = 'event-detail';
+        }
+
+        $categories = $this->getCategories();
+
+        switch ($action) {
+        case 'event-detail':
+            $events = $this->getModelEventData($eventId);
+            $events = array_values($events);
+            $event = $events[0];
+            $view = 'detail.html';
+            break;
+        default:
+            // for the dashboard need to get list of event categories and
+            // filter out the events
+            $events = $this->getModelEventsData();
+            $view = 'dashboard.html';
+            $categoryEvents = array();
+            foreach ( $categories as $cat ) {
+                $catEvents = array_filter( $events, function($data) use($cat) {
+                    return ($data['category'] == $cat['id']) ? 1 : 0;
+                } );
+                if ( !empty($catEvents) ) {
+                    $categoryEvents[$cat['id']] = $catEvents;
+                }
+            }
+            break;
+        }
+
+
+
+        // Compile template data
+        $templateData = array(
+            'siteBaseUrl' => GLM_MEMBERS_EVENTS_SITE_BASE_URL,
+            'categoryId'  => $categoryId,
+            'categories'  => $categories,
+            'event'       => $event,
+            'catEvents'   => $categoryEvents
+        );
+
+        return array(
+            'status'           => $status,
+            'menuItemRedirect' => false,
+            'modelRedirect'    => false,
+            'view'             => 'front/events/' . $view,
+            'data'             => $templateData,
+            'settings'         => $settings
+        );
+    }
+}
index 9c10e7f..60278ac 100644 (file)
@@ -14,7 +14,7 @@ require_once GLM_MEMBERS_EVENTS_PLUGIN_CLASS_PATH . '/data/dataEvents.php';
  *
  * @uses      GlmDataEvents
  * @package   GlmMemberEvents
- * @version   //autogen//
+ * @version   0.0.1
  * @copyright Copyright (c) 2010 All rights reserved.
  * @author    Steve Sutton <steve@gaslightmedia.com>
  * @license   PHP Version 3.0 {@link http://www.php.net/license/3_0.txt}
@@ -43,162 +43,13 @@ class GlmMembersFront_events_list extends GlmDataEvents
 
     private function getCategories()
     {
-        return array(
-            1 => array(
-                'id'   => 1,
-                'name' => 'Arts & Crafts'
-            ),
-            2 => array(
-                'id'   => 2,
-                'name' => 'Arts/Cultural/Live Theatre'
-            ),
-            3 => array(
-                'id'   => 3,
-                'name' => 'Beer/Wine Focus'
-            ),
-            4 => array(
-                'id'   => 4,
-                'name' => 'Concerts/Live Music'
-            ),
-            5 => array(
-                'id'   => 5,
-                'name' => 'Educational'
-            ),
-            6 => array(
-                'id'   => 6,
-                'name' => 'Festivals/Fairs/Parades'
-            ),
-            7 => array(
-                'id'   => 7,
-                'name' => 'Outdoor/Nature'
-            ),
-            8 => array(
-                'id'   => 8,
-                'name' => 'Special Event'
-            ),
-            9 => array(
-                'id'   => 9,
-                'name' => 'Sports'
-            ),
-        );
+        include GLM_MEMBERS_EVENTS_PLUGIN_PATH. '/models/front/events/testCategoryData.php';
+        return $categories;
     }
 
     private function getModelEventsData($categoryId = null)
     {
-        $events = array(
-            array(
-                'id'          => 1,
-                'title'       => '20th Annual Garage Sale Art fair',
-                'starting'    => '02/27/2016',
-                'ending'      => '02/27/2016',
-                'description' => '<p>Test event description text here!</p>',
-                'category'    => 1
-            ),
-            array(
-                'id'          => 2,
-                'title'       => 'ARTbreak: Talk: The Art of Collaboration with artists Vicki VanAmeyden and Ginger Owen',
-                'starting'    => '03/01/2016',
-                'ending'      => '03/01/2016',
-                'description' => '<p>Test event description text here!</p>',
-                'category'    => 1
-            ),
-            array(
-                'id'          => 3,
-                'title'       => 'Easter Craft & Vendor Show',
-                'starting'    => '03/26/2016',
-                'ending'      => '03/26/2016',
-                'description' => '<p>Test event description text here!</p>',
-                'category'    => 1
-            ),
-            array(
-                'id'          => 4,
-                'title'       => 'Henderson Castle Tours',
-                'starting'    => '05/11/2016',
-                'ending'      => '05/11/2016',
-                'description' => '<p>Test event description text here!</p>',
-                'category'    => 2
-            ),
-            array(
-                'id'          => 5,
-                'title'       => 'Colour Correction: British and American Screenprints, 1967-75',
-                'starting'    => '06/11/2015',
-                'ending'      => '06/10/2016',
-                'description' => '<p>Test event description text here!</p>',
-                'category'    => 2
-            ),
-            array(
-                'id'          => 6,
-                'title'       => 'Suspended! Sculpture from ArtPrize 2015',
-                'starting'    => '12/12/2016',
-                'ending'      => '12/13/2016',
-                'description' => '<p>Test event description text here!</p>',
-                'category'    => 2
-            ),
-            array(
-                'id'          => 7,
-                'title'       => '"Tasting on the Town"',
-                'starting'    => '04/21/2016',
-                'ending'      => '04/21/2016',
-                'description' => '<p>Test event description text here!</p>',
-                'category'    => 3
-            ),
-            array(
-                'id'          => 8,
-                'title'       => 'Patrick Henry Beer Collectibles Show',
-                'starting'    => '05/14/2016',
-                'ending'      => '05/14/2016',
-                'description' => '<p>Test event description text here!</p>',
-                'category'    => 3
-            ),
-            array(
-                'id'          => 9,
-                'title'       => '"Tasting on the Town"',
-                'starting'    => '05/20/2016',
-                'ending'      => '05/20/2016',
-                'description' => '<p>Test event description text here!</p>',
-                'category'    => 3
-            ),
-            array(
-                'id'          => 10,
-                'title'       => 'Owl Prowl: Barred Owls',
-                'starting'    => '02/25/2016',
-                'ending'      => '02/25/2016',
-                'description' => '<p>Test event description text here!</p>',
-                'category'    => 7
-            ),
-            array(
-                'id'          => 11,
-                'title'       => 'Owls of Michigan',
-                'starting'    => '02/28/2016',
-                'ending'      => '02/28/2016',
-                'description' => '<p>Test event description text here!</p>',
-                'category'    => 7
-            ),
-            array(
-                'id'          => 12,
-                'title'       => 'Bird Sanctuary Resource Center Re-Opening',
-                'starting'    => '02/29/2016',
-                'ending'      => '02/29/2016',
-                'description' => '<p>Test event description text here!</p>',
-                'category'    => 7
-            ),
-            array(
-                'id'          => 13,
-                'title'       => 'Lead Day Hike',
-                'starting'    => '02/29/2016',
-                'ending'      => '02/29/2016',
-                'description' => '<p>Test event description text here!</p>',
-                'category'    => 7
-            ),
-            array(
-                'id'          => 14,
-                'title'       => 'Project Snowstorm: Snowy Owls in Michigan',
-                'starting'    => '03/01/2016',
-                'ending'      => '03/01/2016',
-                'description' => '<p>Test event description text here!</p>',
-                'category'    => 7
-            )
-        );
+        include GLM_MEMBERS_EVENTS_PLUGIN_PATH. '/models/front/events/testEventsData.php';
         if ($categoryId) {
             return array_filter($events, function($data) use($categoryId) {
                 return ($data['category'] == $categoryId) ? 1 : 0;
@@ -210,9 +61,11 @@ class GlmMembersFront_events_list extends GlmDataEvents
     private function getModelEventData()
     {
         return array(
-            'title'       => 'Owr Prowl: Barred Owls',
-            'starting'    => '02/25/2016',
-            'ending'      => '02/25/2016',
+            'id'          => 14,
+            'slug'        => '?eventId=14',
+            'title'       => 'Project Snowstorm: Snowy Owls in Michigan',
+            'starting'    => '03/01/2016',
+            'ending'      => '03/01/2016',
             'description' => '<p>Test event description text here!</p>',
             'category'    => 7
         );
@@ -243,13 +96,25 @@ class GlmMembersFront_events_list extends GlmDataEvents
             $search = true;
             $action = 'event-list';
         }
+        $fromDate = filter_var($_REQUEST['glm_event_from'], FILTER_SANITIZE_STRING);
+        $toDate   = filter_var($_REQUEST['glm_event_to'], FILTER_SANITIZE_STRING);
+
+        if ($eventNameSearch = filter_var($_REQUEST['event_name'], FILTER_SANITIZE_STRING)) {
+            $search = true;
+            $action = 'event-list';
+        }
 
         $categories = $this->getCategories();
+        wp_register_script(
+            'event-dashboard-js',
+            GLM_MEMBERS_EVENTS_PLUGIN_BASE_URL . '/js/dashboard.js',
+            'jquery-datepicker',
+            GLM_MEMBERS_EVENTS_PLUGIN_VERSION,
+            true
+        );
+        wp_enqueue_script('event-dashboard-js');
 
         switch ($action) {
-        case 'event-detail':
-            $event = $this->getModelEventData($eventId);
-            break;
         case 'event-list':
             $events = $this->getModelEventsData($categoryId);
             $view = 'list.html';
@@ -270,17 +135,33 @@ class GlmMembersFront_events_list extends GlmDataEvents
             }
             break;
         }
+        if ( $fromDate && $toDate ) {
+            $events = array_filter($events, function($event) use($fromDate, $toDate){
+                $fromTime       = strtotime($fromDate);
+                $toTime         = strtotime($toDate);
+                $eventStartTime = strtotime($event['starting']);
+                $eventEndTime   = strtotime($event['ending']);
+                return $toTime >= $eventStartTime && $fromTime <= $eventEndTime;
+            });
+        }
 
-
+        if ($eventNameSearch) {
+            $events = array_filter($events, function($event) use($eventNameSearch){
+                return preg_match('/' . preg_quote( $eventNameSearch ) . '/i', $event['title']);
+            });
+        }
 
         // Compile template data
         $templateData = array(
-            'siteBaseUrl' => GLM_MEMBERS_SITE_BASE_URL,
-            'categoryId'  => $categoryId,
-            'categories'  => $categories,
-            'events'      => $events,
-            'event'       => $event,
-            'catEvents'   => $categoryEvents
+            'siteBaseUrl'=> GLM_MEMBERS_EVENTS_SITE_BASE_URL,
+            'categoryId' => $categoryId,
+            'categories' => $categories,
+            'events'     => $events,
+            'event'      => $event,
+            'catEvents'  => $categoryEvents,
+            'fromDate'   => $fromDate,
+            'toDate'     => $toDate,
+            'eventName'  => $eventNameSearch
         );
 
         return array(
diff --git a/models/front/events/testCategoryData.php b/models/front/events/testCategoryData.php
new file mode 100644 (file)
index 0000000..d0ac133
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+$categories = array(
+    1 => array(
+        'id'   => 1,
+        'name' => 'Arts & Crafts'
+    ),
+    2 => array(
+        'id'   => 2,
+        'name' => 'Arts/Cultural/Live Theatre'
+    ),
+    3 => array(
+        'id'   => 3,
+        'name' => 'Beer/Wine Focus'
+    ),
+    4 => array(
+        'id'   => 4,
+        'name' => 'Concerts/Live Music'
+    ),
+    5 => array(
+        'id'   => 5,
+        'name' => 'Educational'
+    ),
+    6 => array(
+        'id'   => 6,
+        'name' => 'Festivals/Fairs/Parades'
+    ),
+    7 => array(
+        'id'   => 7,
+        'name' => 'Outdoor/Nature'
+    ),
+    8 => array(
+        'id'   => 8,
+        'name' => 'Special Event'
+    ),
+    9 => array(
+        'id'   => 9,
+        'name' => 'Sports'
+    ),
+);
diff --git a/models/front/events/testEventsData.php b/models/front/events/testEventsData.php
new file mode 100644 (file)
index 0000000..e314c1c
--- /dev/null
@@ -0,0 +1,143 @@
+<?php
+$events = array(
+    array(
+        'id'          => 1,
+        'slug'        => '?eventId=1',
+        'title'       => '20th Annual Garage Sale Art fair',
+        'starting'    => '02/27/2016',
+        'ending'      => '02/27/2016',
+        'description' => '<p>If you love art fairs and love a bargain - this is the show for you! Held in Main Expo & Expo South.</p>',
+        'url'         => 'http://www.garagesaleartfair.com/',
+        'street'      => '2900 Lake St.',
+        'city'        => 'Kalamazoo',
+        'state'       => 'MI',
+        'zip'         => '49048',
+        'email'       => 'bonnie@garagesaleartfair.com',
+        'cost'        => '$5; free admission for children',
+        'category'    => 1
+    ),
+    array(
+        'id'          => 2,
+        'slug'        => '?eventId=2',
+        'title'       => 'ARTbreak: Talk: The Art of Collaboration with artists Vicki VanAmeyden and Ginger Owen',
+        'starting'    => '03/01/2016',
+        'ending'      => '03/01/2016',
+        'description' => '<p>Since 2006, artists Ginger Owen and Vicki VanAmeyden have been collaborating on process-driven artworks. Join both artists as they discuss the collaborative process, their recent body of work "Heritage Habitats", the relevance of their individual works, and the practice of collaboration in their respective courses.</p><p>Brown bag lunches welcome.</p>',
+        'category'    => 1
+    ),
+    array(
+        'id'          => 3,
+        'slug'        => '?eventId=3',
+        'title'       => 'Easter Craft & Vendor Show',
+        'starting'    => '03/26/2016',
+        'ending'      => '03/26/2016',
+        'description' => '<p>Get ready for spring at the Easter craft & vendor show. Held in Expo South.</p>',
+        'category'    => 1
+    ),
+    array(
+        'id'          => 4,
+        'slug'        => '?eventId=4',
+        'title'       => 'Henderson Castle Tours',
+        'starting'    => '05/11/2016',
+        'ending'      => '05/11/2016',
+        'description' => '<p>History enthusiasts and novices alike will love this tour. Take an hour to explore the entire castle and grounds: basement areas not regularly open to guests, the organic gardens, and our Bordeaux style wine cave.</p>',
+        'category'    => 2
+    ),
+    array(
+        'id'          => 5,
+        'slug'        => '?eventId=5',
+        'title'       => 'Colour Correction: British and American Screenprints, 1967-75',
+        'starting'    => '06/11/2015',
+        'ending'      => '06/10/2016',
+        'description' => '<p>Colour Correction: British and American Screenprints, 1967-75 features work by 32 artists, including some of Andy Warhol\'s iconic images of Marilyn Monroe, Mao Zedong, and a can of Campbell\'s Tomato Soup. Invented in the early 20th century as a quick, low-cost way to create colorful, graphic prints, silkscreening was originally and primarily used for advertising. "Colour Correction chronicles a time of social and political change, and change in the world of contemporary art," says Karla Niehus, KIA Associate Curator of Exhibitions. "These artists were among the first to use screenprinting outside the commercial advertising arena. They helped redefine the medium as a fine art form and created some of the most innovative and resonant printmaking of the era." On view will be works by some of the best-known printmakers, including Josef Albers -- whose work was recently added to the White House walls at the request of President and Mrs. Obama. The KIA\'s two largest galleries will hold the exhibition\'s 80 prints, which range from the fanciful Pop art of Nicholas Monro to the political critiques of May Stevens and the minimalist abstractions and optical exercises of Richard Anuszkiewicz, William T. Williams, and Liliane Lijn. Additional artists shown will be Ilya Bolotowsky, Patrick Caulfield, Robyn Denny, Patrick Heron, Patrick Hughes, R.B. Kitaj, Robert Motherwell, Peter Phillips, John Piper, Larry Rivers, and Richard Smith. The exhibition was organized by the Nasher Museum of Art at Duke University and curated by Marshall Price, Ph.D., the Nancy Hanks Curator of Modern and Contemporary Art at the Nasher Museum. Dr. Price will be at the KIA for a presentation sponsored by the Kalamazoo Art League on December 9 at 10 am. He will discuss the printmaking renaissance of the 1960s in the U.K. and the U.S.</p>',
+        'category'    => 2
+    ),
+    array(
+        'id'          => 6,
+        'slug'        => '?eventId=6',
+        'title'       => 'Suspended! Sculpture from ArtPrize 2015',
+        'starting'    => '12/12/2016',
+        'ending'      => '12/13/2016',
+        'description' => '<p>Work by three artists from the 2015 ArtPrize exhibition in Grand Rapids - all of it 3D sculpture that will be hanging from the galleries ceilings.</p>',
+        'category'    => 2
+    ),
+    array(
+        'id'          => 7,
+        'slug'        => '?eventId=7',
+        'title'       => '"Tasting on the Town"',
+        'starting'    => '04/21/2016',
+        'ending'      => '04/21/2016',
+        'description' => '<p>This is an opportunity to taste a variety of wines. The evening is a fun one with live music, a variety of wines to sample and delicious hors\'doeuvers prepared by "Just Good Foods" in the Rose Street Market.</p>',
+        'category'    => 3
+    ),
+    array(
+        'id'          => 8,
+        'slug'        => '?eventId=8',
+        'title'       => 'Patrick Henry Beer Collectibles Show',
+        'starting'    => '05/14/2016',
+        'ending'      => '05/14/2016',
+        'description' => '<p>Patrick Henry\'s annual beer collectibles show at Bell\'s Brewery in Kalamazoo, Michigan. Beer cans, neons, bottles, steins, tap handles, glasses, and MORE. This show will have everything you could possibly want to decorate your man cave or rec room. Make a weekend of it and enjoy some of Michigan\'s greatest craft breweries. The one dollar cost of admission will be donated to the Boys & Girls Club of Kalamazoo.</p>',
+        'category'    => 3
+    ),
+    array(
+        'id'          => 9,
+        'slug'        => '?eventId=9',
+        'title'       => 'Wine Tasting Dinner',
+        'starting'    => '05/20/2016',
+        'ending'      => '05/20/2016',
+        'description' => '<p>The Wine Tasting Dinner includes a delectable four-course dinner, paired with wines from all around the world. While you dine on a delicious chef-crafted feast, learn professional tips on choosing the best wines for your next dinner.<br> Dinner will include a spring green salad, shrimp ceviche, beef and pork cassoulet, and KBS smoked gouda with fig preserves, chevre and roasted cherries served with artisan bread, followed by chocolate caramel pot\'d creme with marscapone for dessert.<br> This program is restricted to guests aged 21 and older. Cost is $49 adult. Register online by May 13 (http://events.anr.msu.edu/event.cfm?folder=Winetasting). For more information, visit conference.kbs.msu.edu, email conference@kbs.msu.edu, or call 269-671-2400.</p>',
+        'url'         => 'http://conference.kbs.msu.edu',
+        'street'      => '3700 E. Gull Lake Dr.',
+        'city'        => 'Hickory Corners',
+        'state'       => 'MI',
+        'zip'         => '49060',
+        'email'       => 'conference@kbs.msu.edu',
+        'cost'        => '$49',
+        'category'    => 3
+    ),
+    array(
+        'id'          => 10,
+        'slug'        => '?eventId=10',
+        'title'       => 'Owl Prowl: Barred Owls',
+        'starting'    => '02/25/2016',
+        'ending'      => '02/25/2016',
+        'description' => '<p>Test event description text here!</p>',
+        'category'    => 7
+    ),
+    array(
+        'id'          => 11,
+        'slug'        => '?eventId=11',
+        'title'       => 'Owls of Michigan',
+        'starting'    => '02/28/2016',
+        'ending'      => '02/28/2016',
+        'description' => '<p>Test event description text here!</p>',
+        'category'    => 7
+    ),
+    array(
+        'id'          => 12,
+        'slug'        => '?eventId=12',
+        'title'       => 'Bird Sanctuary Resource Center Re-Opening',
+        'starting'    => '02/29/2016',
+        'ending'      => '02/29/2016',
+        'description' => '<p>Test event description text here!</p>',
+        'category'    => 7
+    ),
+    array(
+        'id'          => 13,
+        'slug'        => '?eventId=13',
+        'title'       => 'Lead Day Hike',
+        'starting'    => '02/29/2016',
+        'ending'      => '02/29/2016',
+        'description' => '<p>Test event description text here!</p>',
+        'category'    => 7
+    ),
+    array(
+        'id'          => 14,
+        'slug'        => '?eventId=14',
+        'title'       => 'Project Snowstorm: Snowy Owls in Michigan',
+        'starting'    => '03/01/2016',
+        'ending'      => '03/01/2016',
+        'description' => '<p>Test event description text here!</p>',
+        'category'    => 7
+    )
+);
index 4fdb966..a326380 100644 (file)
@@ -1,18 +1,25 @@
 <h2>Dashboard</h2>
+{* Show the Search form and Short Cuts menu *}
 <div class="row">
         {include file='front/events/searchForm.html'}
         {include file='front/events/shortCuts.html'}
 </div>
+{* Loop through each Category and output the first three events as list *}
 <div class="row">
     {foreach $catEvents as $catid => $category}
     <div class="small-12 medium-6 columns{if $category@last} end{/if}">
         <ul class="category-block pricing-table">
             <li class="title">{$categories.{$catid}.name}</li>
             {foreach $category as $event}
+                {* Only output the first three so if it goes to 4 then break out of the loop *}
                 {if $event@iteration == 4}
                     {break}
                 {/if}
-            <li class="description text-left">{$event.title}</li>
+            <li class="description text-left">
+                <a href="{$siteBaseUrl}event-detail/{$event.slug}">
+                {$event.title}
+                </a>
+            </li>
             {/foreach}
         </ul>
     </div>
diff --git a/views/front/events/detail.html b/views/front/events/detail.html
new file mode 100644 (file)
index 0000000..2775eb3
--- /dev/null
@@ -0,0 +1,34 @@
+<div class="row">
+    <div class="small-12 column">
+        <img style="margin: 15px;" src="http://placehold.it/730x280">
+    </div>
+    <div class="small-12 column">
+        <div class="row">
+            <div class="small-5 small-text-center column">
+                <img style="margin: 0 15px 15px;" src="http://placehold.it/220x220">
+                <button style="margin: 0 15px 15px;">Get Driving Directions</button>
+            </div>
+            <div class="small-7 column">
+                <div class="row">
+                    <div class="small-12 column"><strong>{$event.starting}</strong></div>
+                    <div class="small-12 column"><strong>{$event.title}</strong><br>
+                        {$event.street}<br>
+                        {$event.city}, {$event.state} {$event.zip}
+                    </div>
+                    <div class="small-12 column">{$event.cost}</div>
+                    <div class="small-12 column"><strong>Contact & More Info</strong><br>
+                        {if $event.url}
+                        <a href="{$event.url}">{$event.url}</a><br>
+                        {/if}
+                        {if $event.email}
+                        Email: <a href="mailto: {$event.email}">{$event.email}</a>
+                        {/if}
+                    </div>
+                </div>
+            </div>
+            <div class="small-12 column">
+                <p>{$event.description}</p>
+            </div>
+        </div>
+    </div>
+</div>
index d046609..46d45d6 100644 (file)
@@ -10,7 +10,7 @@
             <div class="small-6 medium-2 columns">{$event.starting}</div>
             <div class="small-6 medium-10 columns">
                 {$categories[$event.category].name}<br>
-                <a href="{$thisURL}?eventId={$event.id}">{$event.title}</a>
+                <a href="{$siteBaseUrl}event-detail/{$event.slug}">{$event.title}</a>
             </div>
         </div>
         <hr>
index 0fbaab3..da4a81d 100644 (file)
@@ -7,7 +7,7 @@
                     <label for="glm-event-name">Event Name </label>
                 </div>
                 <div class="small-12 medium-6 columns">
-                    <input id="glm-event-name" name="event_name">
+                    <input id="glm-event-name" name="event_name" value="{$eventName}">
                 </div>
                 <div class="small-12 small-text-center columns">
                     <input type="submit" class="button radius">
                     <label for="glm-event-from">From</label>
                 </div>
                 <div class="small-12 medium-6 columns">
-                    <input id="glm-event-from" name="event_name">
+                    <input id="glm-event-from" name="glm_event_from" value="{$fromDate}">
                 </div>
                 <div class="small-12 medium-6 text-right columns">
                     <label for="glm-event-to">To</label>
                 </div>
                 <div class="small-12 medium-6 columns">
-                    <input id="glm-event-to" name="event_name">
+                    <input id="glm-event-to" name="glm_event_to" value="{$toDate}">
                 </div>
                 <div class="small-12 medium-6 text-right columns">
                     <label for="glm-event-category">Category</label>