Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions client/eventList.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ <h1>Upcoming Events</h1>
<div class="container-fluid">
{{#each events}}
<div class="col-sm-3" id="e">
<a href="https://google.com">
<a href="/event/{{_id}}">
<div class="event">{{title}}</div>
<div class="desc">{{description}}<br>Date: {{startTime}}</div>
<div class="desc"><br><h3>Date: {{> eventDate eDate=startTime}}</h3></div>
<div class="photos">
<img src="image.jpg" alt="Event image" width="278" height="210">
<img src="{{posterUrl poster}}" alt="Event image" width="278" height="210">
</div>
</a>
</div>
Expand Down
94 changes: 94 additions & 0 deletions client/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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;
}
});

Expand All @@ -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;
}
});
165 changes: 130 additions & 35 deletions event.html
Original file line number Diff line number Diff line change
@@ -1,46 +1,141 @@
<template name="eventPage">
<div class="container" >
{{#with eventData}}
{{> eventPoster title=title poster=poster}}
<div class="container" id="duration">
<div class="table-responsive">
<table class="table table-nonfluid">
<thead>
<tr>
<th> Starts @</th>
<th></th>
<th></th>
<th></th>
<th></th>
<th> Ends @ </th>
</tr>
</thead>
<tbody>
<tr>
<td> <big>{{> eventDate eDate=startTime}}, {{calStartTime}} </big></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td> <big>{{> eventDate eDate=endTime}}, {{calEndTime}}</big></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="container" id="nonfluidContainer">
<div class="container col-sm-8" id="eventDescriptor">
<div class="row" id="descriptionHeading">
<h3>Description</h3>
</div>
<hr>
<div class="row" id="descriptionContent">
{{description}}
</div>
</div>

<div class="col-sm-1"></div>

<div class="jumbotron">
<button id="b1">Register Now >></button>
</div>
<div class="row">
<div class="col-md-3" id="overview">
<h3><strong>About</strong> </h3>
<p>Event Owner: Team .EXE</p>
<div class="container col-sm-3" id="venue">

</div>
<div class="col-md-3" id="overview">
<h3><strong>Details</strong></h3>
<ul>

<li>Coding event</li>
<li></li>
<li>Exiting Prices</li>
</ul>
</div>
<div class="container col-sm-12" id="eventDescriptor">
<div class="row" id="descriptionContent">
<h4>Target Audience: <strong>{{targetAudience}}</strong></h4>
</div>
</div>

<div class="col-md-3" id="overview">
<h3><strong>OverView</strong></h3>
<p>Started On : <b> hh:mm </b> </p>
<p>Closes On : <b> hh:mm </b> </p>
<p>Location : <b> Auditorium </b> </p>
</div>
</div>
<div class="container col-sm-12" id="eventDescriptor">
<div class="row" id="descriptionHeading">
<h4>Venue</h4>
</div>
<hr>
<div class="row" id="descriptionContent">
<h3>{{venue}}</h3>
</div>
</div>

<div class="container col-sm-12" id="eventDescriptor">
<div class="row" id="descriptionHeading">
<h3>Contact</h3>
</div>
<hr>
<div class="row" id="descriptionContent">
<h4> <big>{{contactPerson}}</big><br>
{{contactNumber}} </h4>
</div>
</div>

<div class="row">
<div class="col-md-4">
<h3><strong> Detailed Description </strong></h3>
<p> </p>
<p> </p>
</div>
</div>
{{/with}}
<script id="dsq-count-scr" src="//nitheventsportal.disqus.com/count.js" async></script>
</template>



<div class="col-md-4">
<h3><strong>Rules</strong></h3>
<p> </p>
<p> </p>
<!-- Small Templates -->
<template name="authorTemplate">
{{name inheritedAuthor}}
</template>

<template name="eventDate">
{{day eDate}},
{{date eDate}}
{{time eDate}}
</template>


<template name="eventPoster">
{{#with posterUrl poster}}
<header style="background:linear-gradient(
rgba(0, 0, 0, 0),
rgba(0, 0, 0, 1)
),url({{this.url}});
background-size:cover;
background-position:center;">
<div class="header-content">
<div class="header-content-inner">
<h1>{{this.title}}</h1>
</div>
</div>
</header>
{{/with}}
</template>


<template name="eventTiming">
<div class="container" id="duration">
<div class="table-responsive">
<table class="table table-nonfluid">
<thead>
<tr>
<th> Starts @</th>
<th></th>
<th></th>
<th></th>
<th></th>
<th> Ends @ </th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>{{calStartTime}}</strong> </td>
<td></td>
<td></td>
<td></td>
<td></td>
<td> {{> eventDate eDate=endTime}} <strong>{{calEndTime}}</strong></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</template>

<template name="myFilePreview">
<a href="{{file.url}}">{{file.original.name}}</a>
</template>
Loading