From b89272f8f17c526ba69c2a40d35349c9beda8ce3 Mon Sep 17 00:00:00 2001 From: rohanjaswal2507 Date: Sun, 3 Apr 2016 11:24:00 +0530 Subject: [PATCH] Modified event Page --- client/eventList.html | 6 +- client/main.js | 94 ++++++++++++++++++++++ event.html | 165 ++++++++++++++++++++++++++++++-------- shared/style.css | 181 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 408 insertions(+), 38 deletions(-) diff --git a/client/eventList.html b/client/eventList.html index 6ee80a4..45ed02c 100644 --- a/client/eventList.html +++ b/client/eventList.html @@ -7,11 +7,11 @@

Upcoming Events

{{#each events}} diff --git a/client/main.js b/client/main.js index 42faed0..73a6d0e 100644 --- a/client/main.js +++ b/client/main.js @@ -45,9 +45,79 @@ Template.eventPage.helpers({ Event = Events.findOne({_id:Session.get("eventId")}); Event.begin = new Date(Event.startTime); return Event; + }, + calStartTime: function(){ + eventData = Events.findOne({_id:Session.get("eventId")}); + eDate = eventData.startTime; + date = new Date(parseInt(eDate)); + hour = date.getHours(); + min = date.getMinutes(); + if(min < 10){ + min = "0" + min.toString(); + } + if(hour > 12){ + hour = hour%12; + return hour + ":" + min + " PM"; + } else { + return hour + ":" + min + " AM"; + } + }, + calEndTime: function(){ + eventData = Events.findOne({_id:Session.get("eventId")}); + eDate = eventData.endTime; + date = new Date(parseInt(eDate)); + hour = date.getHours(); + min = date.getMinutes(); + if(min < 10){ + min = "0" + min.toString(); + } + if(hour > 12){ + hour = hour%12; + return hour + ":" + min + " PM"; + } else { + return hour + ":" + min + " AM"; + } } }); +Template.eventDate.helpers({ + day: function(eDate){ + date = new Date(parseInt(eDate)); + days = { + "1" : "Mon", + "2" : "Tue", + "3" : "Wed", + "4" : "Thu", + "5" : "Fri", + "6" : "Sat", + "0" : "Sun", + }; + return days[date.getDay()]; + }, + date: function(eDate){ + date = new Date(parseInt(eDate)); + months = { + "0" : "Jan", + "1" : "Feb", + "2" : "Mar", + "3" : "Apr", + "4" : "May", + "5" : "Jun", + "6" : "Jul", + "7" : "Aug", + "8" : "Sep", + "9" : "Oct", + "10" : "Nov", + "11" : "Dec" + }; + month = date.getMonth(); + day = date.getDate(); + return months[month] + " " + day; + }, + time: function(){ + + } +}); // Eventlist template helpers @@ -59,6 +129,13 @@ Template.eventList.helpers({ eventList = Events.find({}); return eventList; + }, + posterUrl: function(posterId){ + file = Posters.findOne({_id:posterId}); + fileURL = file.url(); + //eventData = Events.findOne({poster:posterId}); + //file.title = eventData.title; + return fileURL; } }); @@ -72,8 +149,25 @@ Template.afQuickField.events({ Posters.insert(fileObj, function(err, fileObj){ if(!err){ console.log(fileObj); + } else { + console.log("Poster inserted!"); } }); }); } }); + + + +Template.eventPoster.helpers({ + posterUrl: function(posterId){ + file = Posters.findOne({_id:posterId}); + fileURL = file.url(); + eventData = Events.findOne({poster:posterId}); + file.title = eventData.title; + return file; + }, + eventTitle: function(title){ + return title; + } +}); diff --git a/event.html b/event.html index 716aeae..9d5bca2 100644 --- a/event.html +++ b/event.html @@ -1,46 +1,141 @@ + + -
-

Rules

-

-

+ + + + + + + + + + + diff --git a/shared/style.css b/shared/style.css index d24bac2..7adae4a 100644 --- a/shared/style.css +++ b/shared/style.css @@ -1,3 +1,184 @@ +body { + background-color: #e6e6e6; + width: 100%; + height: 100%; +} +header { + height: 500px; + width: 100%; + text-align: center; +} + +header .header-content { + position: relative; + width: 100%; + top: 90%; +} + +header .header-content .header-content-inner h1 { + margin-top: 0; + margin-bottom: 0; + color: #fff; + text-align: left; + padding-left: 8%; +} + + +@media(max-width:768px) { + header { + min-height: 100%; + } + + header .header-content { + position: absolute; + top: 80%; + padding: 0 50px; + -webkit-transform: translateY(-50%); + -ms-transform: translateY(-50%); + transform: translateY(-50%); + } + + header .header-content .header-content-inner { + margin-right: auto; + margin-left: auto; + } + + header .header-content .header-content-inner h1 { + margin-right: auto; + margin-left: auto; + text-align: center; + } + +} + +#duration { + margin-top: 10px; + border: 1px solid #b3b3b3; + background-color: #fff; + box-shadow: 2px 2px 2px #bfbfbf; +} + +.table-nonfluid { + margin-top: 20px; + font-size: 16px; + width: auto; +} + +#nonfluidContainer { + padding: 0px; +} + +#eventDescriptor { + margin-top: 10px; + border: 1px solid #b3b3b3; + background-color: #fff; + box-shadow: 2px 2px 2px #bfbfbf; +} + +#description{ + border: 1px solid #b3b3b3; + background-color: #fff; + box-shadow: 2px 2px 2px #bfbfbf; +} + +#descriptionHeading { + margin: auto; +} + +#descriptionContent { + margin: auto; +} + +#venue { + padding: 0px; +} + +.eventDabba{ + margin-top:50px; +} +.event_poster{ + width: 100%; +} + +#myCarousel { + width: 100%; +} + +.carousel-inner .item { + width: 100%; + height: 80vh; + background-size: cover; + background-position: center; +} + +.slide1 { + background: linear-gradient( + rgba(0, 0, 0, 0), + rgba(0, 0, 0, 1) + ), + url(a.jpg); +} + +.slide2 { + background: linear-gradient( + rgba(0, 0, 0, 0), + rgba(0, 0, 0, 1) + ), + url(b.jpg); +} + +.slide3 { + background: linear-gradient( + rgba(0, 0, 0, 0), + rgba(0, 0, 0, 1) + ), + url(c.jpg); +} + +.slide4 { + background: linear-gradient( + rgba(0, 0, 0, 0), + rgba(0, 0, 0, 1) + ), + url(d.jpg); +} + +#eventThumb { + margin-top: 10px; + padding-left: 0px; + padding-right: 0px; + border: 1px solid #b3b3b3; + background-color: #fff; + box-shadow: 2px 2px 2px #bfbfbf; + display: inline-block; +} + +#eventName { + margin: 10px; +} + +#masonry { /* Masonry container */ + -moz-column-count:4; + -moz-column-gap: 3%; + -moz-column-width: 20%; + -webkit-column-count:4; + -webkit-column-gap: 3%; + -webkit-column-width: 20%; + column-count: 4; + column-gap: 3%; + column-width: 20%; +} + +@media(max-width:767px) { + #masonry { + -moz-column-count:1; + -moz-column-width: 90%; + -webkit-column-count:1; + -webkit-column-width: 90%; + column-count: 1; + column-width: 90%; + } +} #heading{ height: 200px; background-color: #2B3856;