diff --git a/index.html b/index.html
index dcd9166e..43fc1dde 100644
--- a/index.html
+++ b/index.html
@@ -38,11 +38,13 @@
diff --git a/partials/tabs/events.html b/partials/tabs/events.html
new file mode 100644
index 00000000..f0c6a2c4
--- /dev/null
+++ b/partials/tabs/events.html
@@ -0,0 +1,38 @@
+
+
+
+
~
+ 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 f2395d87..9fed2604 100644
--- a/resources/css/style.css
+++ b/resources/css/style.css
@@ -1,3 +1,26 @@
+.apply-flex {
+ display: flex;
+ flex-flow: row wrap;
+}
+.break-word {
+ word-wrap: break-word;
+}
+.constant-content-height {
+ height: 150px;
+}
+.center-text {
+ text-align: center;
+}
+.event-card {
+ width: 320px;
+ margin-right: 20px;
+}
+.events-detail {
+ margin: 15px 0;
+}
+.evenly-spaced-content {
+ justify-content: space-evenly;
+}
.hash_value_dup {
position: 'absolute';
left: '-9999px';
@@ -32,6 +55,24 @@
.fa-clipboard:hover .hinttext {
visibility: visible;
}
+.lighter-font {
+ font-weight: lighter;
+}
+.no-events-available {
+ font-size: 1.2em;
+ height: 30vh;
+ justify-content: center;
+ flex-direction: column;
+}
+.page-details {
+ justify-content: center;
+ flex-wrap: nowrap;
+}
+.page-name {
+ display: flex;
+ 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 af811167..aa5ab5ac 100644
--- a/resources/js/app.js
+++ b/resources/js/app.js
@@ -55,6 +55,9 @@
when('/faq', {
template: '
'
}).
+ when('/events', {
+ template: '
'
+ }).
otherwise({
redirectTo: '/projects'
});
@@ -416,4 +419,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"
+ }
+ }]);
+
})();