FUCKING BIG UPDATE: server, parallax, apis, new data models, style, layout, other

This commit is contained in:
tmshv committed 2016-03-03 01:34:45 +03:00
1 parent e0f54171a9
commit 359cc430f5
78 files changed
+1063 -445

No files matched your search

+6 -6
View File
@@ -1,16 +1,16 @@
import APIFeed from './APIFeed';
import APIGallery from './APIGallery';
import APITimeline from './APITimeline';
import APIAlbum from './APIAlbum';
import APIDocument from './APIDocument';
import APICollective from './APICollective';
import APITeacher from './APITeacher';
import APISchedule from './APISchedule';
import APIEvent from './APIEvent';
export default class API {
constructor(request) {
this.news = new APIFeed(request);
this.gallery = new APIGallery(request);
this.timeline = new APITimeline(request);
this.album = new APIAlbum(request);
this.document = new APIDocument(request);
this.collective = new APICollective(request);
this.teacher = new APITeacher(request);
this.schedule = new APISchedule(request);
this.event = new APIEvent(request);
}
+16
View File
@@ -0,0 +1,16 @@
import EndPoint from './EndPoint';
export default class APIAlbum extends EndPoint {
list(){
return this.get(`/gallery`);
}
year(year) {
return this.get(`/gallery/${year}`);
}
fetch(id, doPopulate) {
let url = `/album/${id}?populate=${doPopulate}`;
return this.get(url);
}
}
+1 -1
View File
@@ -4,6 +4,6 @@ export default class APICollective extends EndPoint {
list(sort=null) {
let url = '/collective';
if(sort) url = `/collective?sort=${sort.join(',')}`;
return this.request.get(url, {cache: true});
return this.get(url);
}
}
+2 -2
View File
@@ -3,11 +3,11 @@ import EndPoint from './EndPoint';
export default class APIDocument extends EndPoint {
documents(){
let url = '/documents/type/document';
return this.request.get(url, {cache: true});
return this.get(url);
}
awards() {
let url = '/documents/type/award';
return this.request.get(url, {cache: true});
return this.get(url);
}
}
+2 -2
View File
@@ -3,11 +3,11 @@ 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});
return this.get(url);
}
post(id) {
let url = `/event/${id}`;
return this.request.get(url, {cache: true});
return this.get(url);
}
}
-13
View File
@@ -1,13 +0,0 @@
/**
* Created by tmshv on 22/11/14.
*/
import {query} from '../../utils/net';
import EndPoint from './EndPoint';
export default class APIFeed extends EndPoint{
feed(count, portion) {
let q = query([['count', count], ['portion', portion]]);
return this.request.get(`/news?${q}`);
}
}
+2 -2
View File
@@ -2,11 +2,11 @@ import EndPoint from './EndPoint';
export default class APIGallery extends EndPoint {
year(year) {
return this.request.get(`/gallery/${year}`, {cache: true});
return this.get(`/gallery/${year}`);
}
album(year, course, album, doPopulate) {
let url = `/gallery/${year}/${course}/${album}?populate=${doPopulate}`;
return this.request.get(url, {cache: true});
return this.get(url);
}
}
+6 -6
View File
@@ -1,17 +1,17 @@
import EndPoint from './EndPoint';
export default class APISchedule extends EndPoint {
get(period, semester, doPopulate=true) {
let url = `/schedule/${period}/${semester}?populate=${doPopulate}`;
return this.request.get(url, {cache: true});
static buildScheduleUrl(period, semester) {
return `/schedule/${period}/${semester}`;
}
buildScheduleUrl(period, semester) {
return `/schedule/${period}/${semester}`;
fetch(period, semester, doPopulate=true) {
let url = `/schedule/${period}/${semester}?populate=${doPopulate}`;
return this.get(url);
}
list() {
let url = '/schedule/list';
return this.request.get(url, {cache: true});
return this.get(url);
}
}
+14
View File
@@ -0,0 +1,14 @@
import EndPoint from './EndPoint';
export default class APITeacher extends EndPoint {
list(sort=null) {
let url = '/teacher/list';
if(sort) url = `/teacher/list?sort=${sort.join(',')}`;
return this.get(url);
}
fetch(id) {
let url = `/teacher/${id}`;
return this.get(url);
}
}
+9
View File
@@ -0,0 +1,9 @@
import {query} from '../../utils/net';
import EndPoint from './EndPoint';
export default class APITimeline extends EndPoint{
feed(limit=10, skip=0) {
let q = query([['limit', limit], ['skip', skip]]);
return this.get(`/news?${q}`);
}
}
+4
View File
@@ -2,4 +2,8 @@ export default class EndPoint{
constructor(http){
this.request = http;
}
get(url){
return this.request.get(url, {cache: true});
}
}