diff --git a/src/client/api/API.js b/src/client/api/API.js
index 59b6767f..d7356cc1 100644
--- a/src/client/api/API.js
+++ b/src/client/api/API.js
@@ -3,6 +3,7 @@ import APIGallery from './APIGallery';
import APIDocument from './APIDocument';
import APICollective from './APICollective';
import APISchedule from './APISchedule';
+import APIEvent from './APIEvent';
export default class API {
constructor(request) {
@@ -11,5 +12,6 @@ export default class API {
this.document = new APIDocument(request);
this.collective = new APICollective(request);
this.schedule = new APISchedule(request);
+ this.event = new APIEvent(request);
}
}
\ No newline at end of file
diff --git a/src/client/api/APIEvent.js b/src/client/api/APIEvent.js
new file mode 100644
index 00000000..721cee85
--- /dev/null
+++ b/src/client/api/APIEvent.js
@@ -0,0 +1,13 @@
+import EndPoint from './EndPoint';
+
+export default class APIEvent extends EndPoint {
+ list(skip=1, limit=10) {
+ let url = `/events?skip=${skip}&limit=${limit}`;
+ return this.request.get(url, {cache: true});
+ }
+
+ post(id) {
+ let url = `/event/${id}`;
+ return this.request.get(url, {cache: true});
+ }
+}
\ No newline at end of file
diff --git a/src/client/app.js b/src/client/app.js
index 03f13d8f..7f10e14c 100644
--- a/src/client/app.js
+++ b/src/client/app.js
@@ -18,8 +18,11 @@ import ScheduleSlider from './components/ScheduleSlider';
import ScheduleSlide from './components/ScheduleSlide';
import ScheduleRecord from './components/ScheduleRecord';
import FooterLinks from './components/FooterLinks';
+import EventPost from './components/EventPost';
import PageSchool from './components/PageSchool';
+import PageEvents from './components/PageEvents';
+import PageEvent from './components/PageEvent';
import PageSchedule from './components/PageSchedule';
import PageCollective from './components/PageCollective';
import PageGallery from './components/PageGallery';
@@ -92,12 +95,15 @@ app.run(($location, $rootScope, $http) => {
TimelineRecord,
TimelineRecordPost,
TimelineRecordInstagram,
+ EventPost,
Document,
Award,
GalleryItem,
AlbumCollection,
TeacherProfile,
PageSchool,
+ PageEvent,
+ PageEvents,
PageSchedule,
PageCollective,
PageGallery,
diff --git a/src/client/components/EventPost.js b/src/client/components/EventPost.js
new file mode 100644
index 00000000..2e824695
--- /dev/null
+++ b/src/client/components/EventPost.js
@@ -0,0 +1,15 @@
+import template from '../../templates/components/event-post.html';
+
+export default function (app) {
+ app.component('eventPost', {
+ bindings: {
+ post: '<'
+ },
+ template: template,
+ controllerAs: '$',
+ controller: function ($sce) {
+ this.message = $sce.trustAsHtml(this.post.post);
+ this.url = `/event/${this.post.id}`;
+ }
+ });
+};
\ No newline at end of file
diff --git a/src/client/components/PageEvent.js b/src/client/components/PageEvent.js
new file mode 100644
index 00000000..a306bb99
--- /dev/null
+++ b/src/client/components/PageEvent.js
@@ -0,0 +1,21 @@
+import template from '../../templates/components/page-event.html';
+
+export default function (app) {
+ app.component('pageEvent', {
+ template: template,
+ controllerAs: '$',
+ controller: function ($rootScope, $routeParams, api, menu) {
+ this.pageClass = 'page-event';
+ menu.activate('/events');
+
+ let id = $routeParams.event;
+ if(!id) return;
+
+ api.event.post(id)
+ .success(post => {
+ $rootScope.title = post.title;
+ this.posts = [post];
+ });
+ }
+ });
+};
\ No newline at end of file
diff --git a/src/client/components/PageEvents.js b/src/client/components/PageEvents.js
new file mode 100644
index 00000000..22303860
--- /dev/null
+++ b/src/client/components/PageEvents.js
@@ -0,0 +1,17 @@
+import template from '../../templates/components/page-events.html';
+
+export default function (app) {
+ app.component('pageEvents', {
+ template: template,
+ controllerAs: '$',
+ controller: function (api, menu) {
+ this.pageClass = 'page-events';
+ menu.activate('/events');
+
+ api.event.list()
+ .success(posts => {
+ this.posts = posts;
+ });
+ }
+ });
+};
\ No newline at end of file
diff --git a/src/client/config.js b/src/client/config.js
index 3b3552e8..ba014eec 100644
--- a/src/client/config.js
+++ b/src/client/config.js
@@ -25,6 +25,15 @@ export let routes = [
template: '
{{$.post.date | date : "dd.MM.yyyy"}}
+