diff --git a/index.html b/index.html
index 0488d153..e3ee1d01 100644
--- a/index.html
+++ b/index.html
@@ -38,13 +38,15 @@
diff --git a/partials/tabs/events.html b/partials/tabs/events.html
new file mode 100644
index 00000000..b2ca401c
--- /dev/null
+++ b/partials/tabs/events.html
@@ -0,0 +1,39 @@
+
+
+
+
+
Organization Events
+
+
+
+
+
+
+
{{ category.name }}
+
+
+
+
+
{{ event.title }}
+
{{ event.description }}
+
No event description available!
+
+
+
+
+
+
+
+
+ No Events Found! If you're already a member of organization and a developer,
+ you can share it with us on Community website
+ by logging-in.
+
+
diff --git a/resources/css/style.css b/resources/css/style.css
index 9aee65e0..c3a090c7 100644
--- a/resources/css/style.css
+++ b/resources/css/style.css
@@ -19,6 +19,15 @@
.black-shadow {
box-shadow: 0 0 15px 2px black;
}
+.break-word {
+ word-wrap: break-word;
+}
+.center-align-text {
+ text-align: center;
+}
+.constant-content-height {
+ height: 150px;
+}
.center-content {
justify-content: center;
}
@@ -31,6 +40,13 @@
.display-none {
display: none;
}
+.event-card {
+ width: 320px;
+ margin-right: 20px;
+}
+.events-detail {
+ margin: 15px 0;
+}
.evenly-spread-content {
justify-content: space-evenly;
}
@@ -98,6 +114,15 @@
i.fa {
cursor: pointer;
}
+.lighter-font {
+ font-weight: lighter;
+}
+.no-events-available {
+ font-size: 1.2em;
+ height: 30vh;
+ justify-content: center;
+ flex-direction: column;
+}
.project-detail-element > .clickable:hover, .clickable:hover .chip:hover {
cursor: pointer;
background-color: #f3f5f8;
diff --git a/resources/js/app.js b/resources/js/app.js
index 0a22c397..b0567be4 100644
--- a/resources/js/app.js
+++ b/resources/js/app.js
@@ -58,6 +58,9 @@
when('/forms', {
template: '
'
}).
+ when('/events', {
+ template: '
'
+ }).
otherwise({
redirectTo: '/projects'
});
@@ -653,4 +656,63 @@
}
}]);
+ app.directive('events', ['$http', function ($http) {
+ return {
+ restrict: 'E',
+ templateUrl: '/partials/tabs/events.html',
+ controller: function ($scope, $rootScope) {
+ var today = new Date()
+ $scope.eventsData = []
+ $scope.eventsList = {
+ ongoing_events: {
+ name: 'Ongoing Event(s)',
+ events: []
+ },
+ upcoming_events: {
+ name: 'Upcoming Events(s)',
+ events: []
+ },
+ past_events: {
+ name: 'Past Event(s)',
+ events: []
+ }
+ }
+
+ $http.get('https://webservices.coala.io/calendar')
+ .then(function(result){
+ self.eventsData = result.data
+ })
+
+ $scope.groupEvents = function(){
+ angular.forEach($scope.eventsData, function(event){
+ var event_start_time = new Date(event.start_date_time)
+ if(event.end_date_time === null){
+ var event_end_time = new Date(today.getTime() + 86400000)
+ }
+ else{
+ var event_end_time = new Date(event.end_date_time)
+ }
+
+ if(event_start_time <= today && today <= event_end_time) {
+ $scope.eventsList.ongoing_events.events.push(event)
+ } // ongoing event
+ else if (event_end_time < today &&
+ ((today - event_start_time) / (86400000) <= 90)) {
+ $scope.eventsList.past_events.events.push(event)
+ } // has happened in last 3 months
+ else if(
+ event_start_time > today && event_end_time > today &&
+ ((event_start_time - today) / (86400000) <= 90)) {
+ $scope.eventsList.upcoming_events.events.push(event)
+ } // will occur in next 3 months
+ })
+ }
+
+ $scope.groupEvents()
+
+ },
+ controllerAs: "ed"
+ }
+ }]);
+
})();