= schedule page added;

+ clients dir for browser code;
+ some models (course);
= other (main style, etc);
This commit is contained in:
tmshv committed 2014-03-18 23:16:45 +04:00
1 parent c1e160d779
commit 8784043f1d
12 files changed
+285 -81

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
const COURSES = require("./courses.json");
exports.courses = COURSES;
exports.course = getCourseByID;
exports.name = getCourseNameByID;
function getCourseByID(id){
for(var i=0; i<COURSES.length; i++){
var p = COURSES[i];
if(p.id == id){
return p;
}
}
return null;
}
function getCourseNameByID(id){
var p = getCourseByID(id);
if(p) return p.name;
else return null;
}
+26
View File
@@ -0,0 +1,26 @@
[
{
"id": "painting",
"name": "Живопись"
},
{
"id": "drawing",
"name": "Рисунок"
},
{
"id": "sculpting",
"name": "Скульптура"
},
{
"id": "composition",
"name": "Композиция"
},
{
"id": "history",
"name": "История искусства"
},
{
"id": "cg",
"name": "Комп. графика"
}
]
+3 -3
View File
@@ -3,7 +3,7 @@
"name": "1",
"monday": {
"lesson": "composition",
"teacher": "as-mantseva",
"teacher": "as-timasheva",
"time": [
"15:00 15:45",
"15:55 16:40"
@@ -46,7 +46,7 @@
},
"saturday": {
"lesson": "composition",
"teacher": "as-mantseva",
"teacher": "as-timasheva",
"time": [
"12:00 12:45",
"12:55 13:40"
@@ -73,7 +73,7 @@
},
"saturday": {
"lesson": "composition",
"teacher": "as-mantseva",
"teacher": "as-timasheva",
"time": [
"10:00 10:45",
"10:55 11:40"
+36
View File
@@ -0,0 +1,36 @@
const TEAM = require("./team.json");
exports.team = TEAM;
exports.person = getPersonByID;
exports.name = getNameByID;
exports.short = getShortNameByID;
function getPersonByID(id){
for(var i=0; i<TEAM.length; i++){
var p = TEAM[i];
if(p.id == id){
return p;
}
}
return null;
}
function getNameByID(id){
var p = getPersonByID(id);
if(p) return p.name;
else return null;
}
function getShortNameByID(id){
var n = getNameByID(id);
if(n) return shortifyName(n)
else return null;
}
function shortifyName(name){
var m = /(.+)\s(.+)\s(.+)/.exec(name);
var n = m[1].replace(/^(.).+/, "$1. ") +
m[2].replace(/^(.).+/, "$1. ") +
m[3];
return n;
}