FUCKING BIG UPDATE: server, parallax, apis, new data models, style, layout, other
This commit is contained in:
1 parent
e0f54171a9
commit
359cc430f5
78 files changed
+1063
-445
No files matched your search
@@ -1,16 +1,16 @@
|
|||||||
import APIFeed from './APIFeed';
|
import APITimeline from './APITimeline';
|
||||||
import APIGallery from './APIGallery';
|
import APIAlbum from './APIAlbum';
|
||||||
import APIDocument from './APIDocument';
|
import APIDocument from './APIDocument';
|
||||||
import APICollective from './APICollective';
|
import APITeacher from './APITeacher';
|
||||||
import APISchedule from './APISchedule';
|
import APISchedule from './APISchedule';
|
||||||
import APIEvent from './APIEvent';
|
import APIEvent from './APIEvent';
|
||||||
|
|
||||||
export default class API {
|
export default class API {
|
||||||
constructor(request) {
|
constructor(request) {
|
||||||
this.news = new APIFeed(request);
|
this.timeline = new APITimeline(request);
|
||||||
this.gallery = new APIGallery(request);
|
this.album = new APIAlbum(request);
|
||||||
this.document = new APIDocument(request);
|
this.document = new APIDocument(request);
|
||||||
this.collective = new APICollective(request);
|
this.teacher = new APITeacher(request);
|
||||||
this.schedule = new APISchedule(request);
|
this.schedule = new APISchedule(request);
|
||||||
this.event = new APIEvent(request);
|
this.event = new APIEvent(request);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,6 +4,6 @@ export default class APICollective extends EndPoint {
|
|||||||
list(sort=null) {
|
list(sort=null) {
|
||||||
let url = '/collective';
|
let url = '/collective';
|
||||||
if(sort) url = `/collective?sort=${sort.join(',')}`;
|
if(sort) url = `/collective?sort=${sort.join(',')}`;
|
||||||
return this.request.get(url, {cache: true});
|
return this.get(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,11 +3,11 @@ import EndPoint from './EndPoint';
|
|||||||
export default class APIDocument extends EndPoint {
|
export default class APIDocument extends EndPoint {
|
||||||
documents(){
|
documents(){
|
||||||
let url = '/documents/type/document';
|
let url = '/documents/type/document';
|
||||||
return this.request.get(url, {cache: true});
|
return this.get(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
awards() {
|
awards() {
|
||||||
let url = '/documents/type/award';
|
let url = '/documents/type/award';
|
||||||
return this.request.get(url, {cache: true});
|
return this.get(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,11 +3,11 @@ import EndPoint from './EndPoint';
|
|||||||
export default class APIEvent extends EndPoint {
|
export default class APIEvent extends EndPoint {
|
||||||
list(skip=1, limit=10) {
|
list(skip=1, limit=10) {
|
||||||
let url = `/events?skip=${skip}&limit=${limit}`;
|
let url = `/events?skip=${skip}&limit=${limit}`;
|
||||||
return this.request.get(url, {cache: true});
|
return this.get(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
post(id) {
|
post(id) {
|
||||||
let url = `/event/${id}`;
|
let url = `/event/${id}`;
|
||||||
return this.request.get(url, {cache: true});
|
return this.get(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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,11 +2,11 @@ import EndPoint from './EndPoint';
|
|||||||
|
|
||||||
export default class APIGallery extends EndPoint {
|
export default class APIGallery extends EndPoint {
|
||||||
year(year) {
|
year(year) {
|
||||||
return this.request.get(`/gallery/${year}`, {cache: true});
|
return this.get(`/gallery/${year}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
album(year, course, album, doPopulate) {
|
album(year, course, album, doPopulate) {
|
||||||
let url = `/gallery/${year}/${course}/${album}?populate=${doPopulate}`;
|
let url = `/gallery/${year}/${course}/${album}?populate=${doPopulate}`;
|
||||||
return this.request.get(url, {cache: true});
|
return this.get(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
import EndPoint from './EndPoint';
|
import EndPoint from './EndPoint';
|
||||||
|
|
||||||
export default class APISchedule extends EndPoint {
|
export default class APISchedule extends EndPoint {
|
||||||
get(period, semester, doPopulate=true) {
|
static buildScheduleUrl(period, semester) {
|
||||||
let url = `/schedule/${period}/${semester}?populate=${doPopulate}`;
|
return `/schedule/${period}/${semester}`;
|
||||||
return this.request.get(url, {cache: true});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
buildScheduleUrl(period, semester) {
|
fetch(period, semester, doPopulate=true) {
|
||||||
return `/schedule/${period}/${semester}`;
|
let url = `/schedule/${period}/${semester}?populate=${doPopulate}`;
|
||||||
|
return this.get(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
list() {
|
list() {
|
||||||
let url = '/schedule/list';
|
let url = '/schedule/list';
|
||||||
return this.request.get(url, {cache: true});
|
return this.get(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,4 +2,8 @@ export default class EndPoint{
|
|||||||
constructor(http){
|
constructor(http){
|
||||||
this.request = http;
|
this.request = http;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get(url){
|
||||||
|
return this.request.get(url, {cache: true});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+112
-6
@@ -19,14 +19,17 @@ import ScheduleSlide from './components/ScheduleSlide';
|
|||||||
import ScheduleRecord from './components/ScheduleRecord';
|
import ScheduleRecord from './components/ScheduleRecord';
|
||||||
import FooterLinks from './components/FooterLinks';
|
import FooterLinks from './components/FooterLinks';
|
||||||
import EventPost from './components/EventPost';
|
import EventPost from './components/EventPost';
|
||||||
|
import Album from './components/Album';
|
||||||
|
import Parallax from './components/Parallax';
|
||||||
|
|
||||||
import PageSchool from './components/PageSchool';
|
import PageSchool from './components/PageSchool';
|
||||||
import PageEvents from './components/PageEvents';
|
import PageEvents from './components/PageEvents';
|
||||||
import PageEvent from './components/PageEvent';
|
import PageEvent from './components/PageEvent';
|
||||||
import PageSchedule from './components/PageSchedule';
|
import PageSchedule from './components/PageSchedule';
|
||||||
import PageCollective from './components/PageCollective';
|
import PageCollective from './components/PageCollective';
|
||||||
|
import PageTeacher from './components/PageTeacher';
|
||||||
import PageGallery from './components/PageGallery';
|
import PageGallery from './components/PageGallery';
|
||||||
import PageGalleryAlbum from './components/PageGalleryAlbum';
|
import PageAlbum from './components/PageAlbum';
|
||||||
import PageDocuments from './components/PageDocuments';
|
import PageDocuments from './components/PageDocuments';
|
||||||
|
|
||||||
import AppController from './controllers/AppController';
|
import AppController from './controllers/AppController';
|
||||||
@@ -45,7 +48,7 @@ import IOService from './services/io';
|
|||||||
import MenuService from './services/menu';
|
import MenuService from './services/menu';
|
||||||
import API from './services/api';
|
import API from './services/api';
|
||||||
|
|
||||||
import {routes} from './config';
|
import {collectiveSortPattern} from './config';
|
||||||
|
|
||||||
let app = angular.module('hudozka', [
|
let app = angular.module('hudozka', [
|
||||||
'ngRoute',
|
'ngRoute',
|
||||||
@@ -58,9 +61,109 @@ app.config(($locationProvider, $routeProvider) => {
|
|||||||
$locationProvider.hashPrefix('!');
|
$locationProvider.hashPrefix('!');
|
||||||
$locationProvider.html5Mode(true);
|
$locationProvider.html5Mode(true);
|
||||||
|
|
||||||
routes.forEach(route => {
|
let routers = [
|
||||||
if (typeof route === 'function') route = route();
|
{
|
||||||
$routeProvider.when(route.name, route);
|
name: '/',
|
||||||
|
template: '<page-school></page-school>',
|
||||||
|
title: 'ДХШ Шлиссельбурга'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '/events/:page?/:pageNumber?',
|
||||||
|
template: '<page-events events="$resolve.posts"></page-events>',
|
||||||
|
title: 'События Школы',
|
||||||
|
|
||||||
|
resolve: {
|
||||||
|
posts: api => api.event
|
||||||
|
.list()
|
||||||
|
.then(i => i.data)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '/event/:event',
|
||||||
|
template: '<page-event></page-event>'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '/schedule/:period?/:semester?',
|
||||||
|
template: '<page-schedule schedules="$resolve.list"></page-schedule>',
|
||||||
|
title: 'Расписание',
|
||||||
|
resolve: {
|
||||||
|
list: api => api.schedule
|
||||||
|
.list()
|
||||||
|
.then(i => i.data)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '/collective',
|
||||||
|
template: '<page-collective members="$resolve.list"></page-collective>',
|
||||||
|
title: 'Преподаватели',
|
||||||
|
resolve: {
|
||||||
|
list: api => api.teacher
|
||||||
|
.list(collectiveSortPattern)
|
||||||
|
.then(i => i.data)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '/teacher/:id',
|
||||||
|
template: '<page-teacher member="$resolve.profile"></page-teacher>',
|
||||||
|
title: 'Преподаватели',
|
||||||
|
resolve: {
|
||||||
|
profile: ($route, api) => {
|
||||||
|
let id = $route.current.params.id;
|
||||||
|
return api.teacher
|
||||||
|
.fetch(id)
|
||||||
|
.then(i => i.data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '/gallery',
|
||||||
|
template: '<page-gallery albums="$resolve.list"></page-gallery>',
|
||||||
|
title: 'Работы учащихся',
|
||||||
|
resolve: {
|
||||||
|
list: api => api.album
|
||||||
|
.list()
|
||||||
|
.then(i => i.data)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '/album/:id',
|
||||||
|
template: '<page-album album="$resolve.album"></page-album>',
|
||||||
|
resolve: {
|
||||||
|
album: ($route, api) => {
|
||||||
|
let id = $route.current.params.id;
|
||||||
|
|
||||||
|
return api.album
|
||||||
|
.fetch(id)
|
||||||
|
.then(i => i.data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '/documents',
|
||||||
|
template: '<page-documents awards="$resolve.awards" documents="$resolve.documents"></page-documents>',
|
||||||
|
title: 'Документы',
|
||||||
|
resolve: {
|
||||||
|
awards: api => api.document
|
||||||
|
.awards()
|
||||||
|
.then(i => i.data),
|
||||||
|
|
||||||
|
documents: api => api.document
|
||||||
|
.documents()
|
||||||
|
.then(i => i.data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
.map(i => {
|
||||||
|
let path = i.name;
|
||||||
|
delete i.name;
|
||||||
|
return {
|
||||||
|
path: path,
|
||||||
|
route: i
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
routers.forEach(i => {
|
||||||
|
$routeProvider.when(i.path, i.route);
|
||||||
});
|
});
|
||||||
|
|
||||||
$routeProvider.otherwise({
|
$routeProvider.otherwise({
|
||||||
@@ -96,6 +199,8 @@ app.run(($location, $rootScope, $http) => {
|
|||||||
TimelineRecordPost,
|
TimelineRecordPost,
|
||||||
TimelineRecordInstagram,
|
TimelineRecordInstagram,
|
||||||
EventPost,
|
EventPost,
|
||||||
|
Album,
|
||||||
|
Parallax,
|
||||||
Document,
|
Document,
|
||||||
Award,
|
Award,
|
||||||
GalleryItem,
|
GalleryItem,
|
||||||
@@ -106,8 +211,9 @@ app.run(($location, $rootScope, $http) => {
|
|||||||
PageEvents,
|
PageEvents,
|
||||||
PageSchedule,
|
PageSchedule,
|
||||||
PageCollective,
|
PageCollective,
|
||||||
|
PageTeacher,
|
||||||
PageGallery,
|
PageGallery,
|
||||||
PageGalleryAlbum,
|
PageAlbum,
|
||||||
PageDocuments,
|
PageDocuments,
|
||||||
AppController,
|
AppController,
|
||||||
CopyrightController,
|
CopyrightController,
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
import template from '../../templates/components/album.html';
|
||||||
|
|
||||||
|
export class AlbumController {
|
||||||
|
constructor($sce) {
|
||||||
|
if(this.album){
|
||||||
|
//this.post = $sce.trustAsHtml(this.album.post);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function (app) {
|
||||||
|
app.component('album', {
|
||||||
|
bindings: {
|
||||||
|
//album: '<'
|
||||||
|
title: '@'
|
||||||
|
},
|
||||||
|
transclude: true,
|
||||||
|
template: template,
|
||||||
|
controllerAs: '$',
|
||||||
|
//controller: function ($sce) {
|
||||||
|
// if(this.album){
|
||||||
|
// this.post = $sce.trustAsHtml(this.album.post);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
});
|
||||||
|
};
|
||||||
@@ -6,6 +6,7 @@ export default function (app) {
|
|||||||
title: '@',
|
title: '@',
|
||||||
albums: '<'
|
albums: '<'
|
||||||
},
|
},
|
||||||
template: template
|
template: template,
|
||||||
|
controllerAs: '$'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -3,8 +3,9 @@ import template from '../../templates/components/award.html';
|
|||||||
export default function (app) {
|
export default function (app) {
|
||||||
app.component('award', {
|
app.component('award', {
|
||||||
bindings: {
|
bindings: {
|
||||||
document: '='
|
document: '<'
|
||||||
},
|
},
|
||||||
template: template
|
template: template,
|
||||||
|
controllerAs: '$'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -3,8 +3,12 @@ import template from '../../templates/components/gallery-item.html';
|
|||||||
export default function (app) {
|
export default function (app) {
|
||||||
app.component('galleryItem', {
|
app.component('galleryItem', {
|
||||||
bindings: {
|
bindings: {
|
||||||
record: '='
|
record: '<'
|
||||||
},
|
},
|
||||||
template: template
|
template: template,
|
||||||
|
controllerAs: '$',
|
||||||
|
controller: function () {
|
||||||
|
this.previewImage = this.record.preview.url;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -5,6 +5,7 @@ export default function (app) {
|
|||||||
bindings: {
|
bindings: {
|
||||||
menu: '<'
|
menu: '<'
|
||||||
},
|
},
|
||||||
template: template
|
template: template,
|
||||||
|
controllerAs: '$'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
import template from '../../templates/components/page-album.html';
|
||||||
|
|
||||||
|
export default function (app) {
|
||||||
|
app.component('pageAlbum', {
|
||||||
|
bindings: {
|
||||||
|
album: '<'
|
||||||
|
},
|
||||||
|
template: template,
|
||||||
|
controllerAs: '$',
|
||||||
|
controller: function ($rootScope,$sce, menu) {
|
||||||
|
menu.activate('/gallery');
|
||||||
|
|
||||||
|
this.post = $sce.trustAsHtml(this.album.post);
|
||||||
|
|
||||||
|
//this.crumbs = [
|
||||||
|
// {
|
||||||
|
// url: '/gallery',
|
||||||
|
// name: 'Галерея'
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: 1010
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: album.title
|
||||||
|
// }
|
||||||
|
//];
|
||||||
|
|
||||||
|
$rootScope.title = this.album.title;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
import template from '../../templates/components/page-collective.html';
|
import template from '../../templates/components/page-collective.html';
|
||||||
import {collectiveSortPattern} from '../config';
|
|
||||||
|
|
||||||
export default function (app) {
|
export default function (app) {
|
||||||
app.component('pageCollective', {
|
app.component('pageCollective', {
|
||||||
|
bindings:{
|
||||||
|
members: '<'
|
||||||
|
},
|
||||||
template: template,
|
template: template,
|
||||||
controller: function(api) {
|
controller: function() {
|
||||||
this.pageClass = 'page-collective';
|
//api.collective.list(collectiveSortPattern)
|
||||||
|
// .success(collective => {
|
||||||
api.collective.list(collectiveSortPattern)
|
// this.members = collective;
|
||||||
.success(collective => {
|
// });
|
||||||
this.members = collective;
|
|
||||||
});
|
|
||||||
|
|
||||||
//let rangelen = r => r[1] - r[0];
|
//let rangelen = r => r[1] - r[0];
|
||||||
//let interpolate = (r, i) => (i - r[0]) / rangelen(r);
|
//let interpolate = (r, i) => (i - r[0]) / rangelen(r);
|
||||||
|
|||||||
@@ -1,40 +1,37 @@
|
|||||||
import template from '../../templates/components/page-documents.html';
|
import template from '../../templates/components/page-documents.html';
|
||||||
|
import {unique} from '../../utils/common';
|
||||||
let unique = fn => list => [...new Set(list.map(fn))];
|
|
||||||
|
|
||||||
export default function (app) {
|
export default function (app) {
|
||||||
app.component('pageDocuments', {
|
app.component('pageDocuments', {
|
||||||
|
bindings: {
|
||||||
|
awards: '<',
|
||||||
|
documents: '<'
|
||||||
|
},
|
||||||
template: template,
|
template: template,
|
||||||
controller: function (api) {
|
controllerAs: '$',
|
||||||
|
controller: function () {
|
||||||
this.pageClass = 'page-documents';
|
this.pageClass = 'page-documents';
|
||||||
let categories = unique(i => i.category);
|
let categories = unique(i => i.category);
|
||||||
|
|
||||||
this.collections = [];
|
this.collections = [];
|
||||||
|
|
||||||
api.document.documents()
|
let documents = this.documents;
|
||||||
.success(documents => {
|
let cats = categories(documents)
|
||||||
let cats = categories(documents)
|
.map(cat => new Object({
|
||||||
.map(cat => new Object({
|
name: cat,
|
||||||
name: cat,
|
documents: []
|
||||||
documents: []
|
}));
|
||||||
}));
|
|
||||||
|
|
||||||
let docCollections = documents.reduce(
|
let docCollections = documents.reduce(
|
||||||
(cats, doc) => {
|
(cats, doc) => {
|
||||||
let c = cats.find(i => i.name === doc.category);
|
let c = cats.find(i => i.name === doc.category);
|
||||||
c.documents.push(doc);
|
c.documents.push(doc);
|
||||||
return cats;
|
return cats;
|
||||||
},
|
},
|
||||||
cats
|
cats
|
||||||
);
|
);
|
||||||
|
|
||||||
this.collections = this.collections.concat(docCollections);
|
this.collections = this.collections.concat(docCollections);
|
||||||
});
|
|
||||||
|
|
||||||
api.document.awards()
|
|
||||||
.success(data => {
|
|
||||||
this.awards = data;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -2,16 +2,19 @@ import template from '../../templates/components/page-events.html';
|
|||||||
|
|
||||||
export default function (app) {
|
export default function (app) {
|
||||||
app.component('pageEvents', {
|
app.component('pageEvents', {
|
||||||
|
bindings: {
|
||||||
|
events: '<'
|
||||||
|
},
|
||||||
template: template,
|
template: template,
|
||||||
controllerAs: '$',
|
controllerAs: '$',
|
||||||
controller: function (api, menu) {
|
controller: function (api, menu) {
|
||||||
this.pageClass = 'page-events';
|
this.pageClass = 'page-events';
|
||||||
menu.activate('/events');
|
menu.activate('/events');
|
||||||
|
|
||||||
api.event.list()
|
//api.event.list()
|
||||||
.success(posts => {
|
// .success(posts => {
|
||||||
this.posts = posts;
|
// this.posts = posts;
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -1,27 +1,37 @@
|
|||||||
import template from '../../templates/components/page-gallery.html';
|
import template from '../../templates/components/page-gallery.html';
|
||||||
|
import {branch} from '../../utils/common';
|
||||||
|
|
||||||
export default function (app) {
|
export default function (app) {
|
||||||
|
let branchYears = branch(
|
||||||
|
i => 'date' in i ? i.date.getFullYear() : 'XXXX'
|
||||||
|
);
|
||||||
|
|
||||||
app.component('pageGallery', {
|
app.component('pageGallery', {
|
||||||
|
bindings: {
|
||||||
|
albums: '<'
|
||||||
|
},
|
||||||
template: template,
|
template: template,
|
||||||
controller: function (api) {
|
controllerAs: '$',
|
||||||
|
controller: function () {
|
||||||
this.pageClass = 'page-gallery';
|
this.pageClass = 'page-gallery';
|
||||||
|
|
||||||
this.years = [];
|
let years = branchYears(
|
||||||
[2015, 2014, 2013, 2012, 2011, 2010]
|
this.albums
|
||||||
.forEach((year, year_index) => {
|
.map(i => {
|
||||||
api.gallery.year(year)
|
i['date'] = new Date(i['date']);
|
||||||
.success(albums => {
|
return i;
|
||||||
if (albums.length) {
|
})
|
||||||
this.years[year_index] = {
|
);
|
||||||
year: year,
|
|
||||||
albums: albums.map(album => {
|
this.collections = Object
|
||||||
let preview = album.content[0];
|
.keys(years)
|
||||||
album.preview_url = preview.content.medium.url;
|
.map(i => parseInt(i))
|
||||||
return album;
|
.sort((a, b) => b - a)
|
||||||
})
|
.map(i => {
|
||||||
};
|
return {
|
||||||
}
|
title: i,
|
||||||
})
|
albums: years[i]
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,74 +1,62 @@
|
|||||||
import template from '../../templates/components/page-schedule.html';
|
import template from '../../templates/components/page-schedule.html';
|
||||||
|
import APISchedule from '../api/APISchedule';
|
||||||
import {populate} from '../../utils/populate';
|
import {populate} from '../../utils/populate';
|
||||||
import {getCourseNameByID} from '../../models/course';
|
import {getCourseNameByID} from '../../models/course';
|
||||||
import {indexEquals} from '../../utils/common';
|
import {indexEquals} from '../../utils/common';
|
||||||
import {select, choise} from '../../utils/common';
|
import {select, choise} from '../../utils/common';
|
||||||
|
|
||||||
function isRequested(period, semester) {
|
|
||||||
return function (schedule) {
|
|
||||||
return schedule.period === period && schedule.semester === semester;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function (app) {
|
export default function (app) {
|
||||||
app.component('pageSchedule', {
|
app.component('pageSchedule', {
|
||||||
template: template,
|
template: template,
|
||||||
|
bindings: {
|
||||||
|
//currentSchedule: '<',
|
||||||
|
schedules: '<'
|
||||||
|
},
|
||||||
controller: function($http, $location, $routeParams, api, menu) {
|
controller: function($http, $location, $routeParams, api, menu) {
|
||||||
this.pageClass = 'page-schedule';
|
this.pageClass = 'page-schedule';
|
||||||
menu.activate('/schedule');
|
menu.activate('/schedule');
|
||||||
|
|
||||||
let current_period = $routeParams.period;
|
const period = $routeParams.period;
|
||||||
let current_semester = $routeParams.semester;
|
const semester = $routeParams.semester;
|
||||||
let isScheduleRequested = current_period && current_semester;
|
const useRoute = period && semester;
|
||||||
|
|
||||||
this.schedules = [];
|
this.loadSchedule = (record, doUpdateURL) => {
|
||||||
let getScheduleByID = (id) => choise(
|
let id = record._id;
|
||||||
this.schedules,
|
let scheduleItem = getScheduleByID(id);
|
||||||
select(i => i._id === id)
|
if (scheduleItem) {
|
||||||
);
|
let p = scheduleItem.period;
|
||||||
|
let s = scheduleItem.semester;
|
||||||
api.schedule.list()
|
api.schedule.fetch(p, s, true)
|
||||||
.success(schedules => {
|
.then(i => i.data)
|
||||||
// By url params or last element
|
.then(i => {
|
||||||
let selector = isScheduleRequested ? isRequested(current_period, current_semester) : indexEquals(schedules.length - 1);
|
this.schedule = i.schedule;
|
||||||
|
if (doUpdateURL) $location.url(APISchedule.buildScheduleUrl(p, s));
|
||||||
schedules = schedules.map(schedule => {
|
|
||||||
let sem = [['spring', 'Весна'], ['autumn', 'Осень']]
|
|
||||||
.reduce(select(
|
|
||||||
i => i[0] === schedule.semester,
|
|
||||||
i => i[1]
|
|
||||||
));
|
|
||||||
schedule.text = `${sem} ${schedule.period} года`;
|
|
||||||
|
|
||||||
return schedule;
|
|
||||||
});
|
|
||||||
|
|
||||||
schedules.forEach((schedule, i) => {
|
|
||||||
if (selector(schedule, i)) {
|
|
||||||
this.currentSchedule = schedules[i];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.schedules = schedules;
|
|
||||||
this.loadSchedule(this.currentSchedule, isScheduleRequested);
|
|
||||||
});
|
|
||||||
|
|
||||||
this.loadSchedule = (s, doUpdateURL) => {
|
|
||||||
let id = s._id;
|
|
||||||
let schedule_item = getScheduleByID(id);
|
|
||||||
|
|
||||||
if (schedule_item) {
|
|
||||||
let sem = schedule_item.semester;
|
|
||||||
let period = schedule_item.period;
|
|
||||||
|
|
||||||
api.schedule.get(period, sem, true)
|
|
||||||
.success(scheduleRecord => {
|
|
||||||
this.schedule = scheduleRecord.schedule;
|
|
||||||
|
|
||||||
if (doUpdateURL) $location.url(api.schedule.buildScheduleUrl(period, sem));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let getScheduleByID = id => this.schedules
|
||||||
|
.find(i => i._id === id);
|
||||||
|
|
||||||
|
let getRoutedSchedule = list => {
|
||||||
|
return list.find(i => i.period === period && i.semester === semester)
|
||||||
|
};
|
||||||
|
|
||||||
|
let last = list => list.length ? list[list.length - 1] : null;
|
||||||
|
let getDefaultSchedule = list => last(list);
|
||||||
|
|
||||||
|
let word = semester => [['spring', 'Весна'], ['autumn', 'Осень']]
|
||||||
|
.find(i => i[0] === semester)
|
||||||
|
[1];
|
||||||
|
|
||||||
|
this.schedules.forEach(i => {
|
||||||
|
let periodIndex = i.semester === 'spring' ? 1 : 0;
|
||||||
|
let year = i.period.split('-')[periodIndex];
|
||||||
|
i.text = `${word(i.semester)} ${year} года`;
|
||||||
|
});
|
||||||
|
this.currentSchedule = useRoute ? getRoutedSchedule(this.schedules) : getDefaultSchedule(this.schedules);
|
||||||
|
|
||||||
|
this.loadSchedule(this.currentSchedule, useRoute);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -1,10 +1,19 @@
|
|||||||
import template from '../../templates/components/page-school.html';
|
import template from '../../templates/components/page-school.html';
|
||||||
|
import {mobileMatchSelector} from '../config';
|
||||||
|
|
||||||
export default function (app) {
|
export default function (app) {
|
||||||
app.component('pageSchool', {
|
app.component('pageSchool', {
|
||||||
template: template,
|
template: template,
|
||||||
|
controllerAs: '$',
|
||||||
controller: function() {
|
controller: function() {
|
||||||
this.pageClass = 'page-school';
|
this.helloBlock = 'parallax';
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (window.matchMedia(mobileMatchSelector).matches) {
|
||||||
|
this.helloBlock = 'mobile-image';
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
}
|
||||||
|
|
||||||
//let fotorama;
|
//let fotorama;
|
||||||
//let $tape = $('.tape-block');
|
//let $tape = $('.tape-block');
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import template from '../../templates/components/page-teacher.html';
|
||||||
|
|
||||||
|
export default function (app) {
|
||||||
|
app.component('pageTeacher', {
|
||||||
|
bindings:{
|
||||||
|
member: '<'
|
||||||
|
},
|
||||||
|
template: template,
|
||||||
|
controllerAs: '$',
|
||||||
|
controller: function(menu){
|
||||||
|
menu.activate('/collective');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
import template from '../../templates/components/parallax.html'
|
||||||
|
|
||||||
|
export default function (app) {
|
||||||
|
app.directive('parallax', function () {
|
||||||
|
return {
|
||||||
|
restrict: 'E',
|
||||||
|
template: template,
|
||||||
|
controllerAs: '$',
|
||||||
|
link: function (scope, element) {
|
||||||
|
let map_range = (i, low1, high1, low2, high2) => low2 + (high2 - low2) * (i - low1) / (high1 - low1);
|
||||||
|
|
||||||
|
scope.layers = [
|
||||||
|
{x: 0, y: 0, s: 0, url: 'https://static.shlisselburg.org/art/graphics/main/11.jpg'},
|
||||||
|
//{x: 716, y: 127, s: -0.4, url: 'https://static.shlisselburg.org/art/graphics/main/10.png'},
|
||||||
|
//{x: 0, y: 216, s: -0.3, url: 'https://static.shlisselburg.org/art/graphics/main/9.png'},
|
||||||
|
|
||||||
|
{x: 0, y: 450, s: -0.2, url: 'https://static.shlisselburg.org/art/graphics/main/8.png'},
|
||||||
|
{x: 683, y: 378, s: -0.25, url: 'https://static.shlisselburg.org/art/graphics/main/7.png'},
|
||||||
|
{x: 0, y: 522, s: -0.3, url: 'https://static.shlisselburg.org/art/graphics/main/6.png'},
|
||||||
|
{x: 414, y: 585, s: -0.4, url: 'https://static.shlisselburg.org/art/graphics/main/5.png'},
|
||||||
|
{x: 0, y: 213, s: -.5, url: 'https://static.shlisselburg.org/art/graphics/main/4.png'},
|
||||||
|
{x: 206, y: 667, s: -.6, url: 'https://static.shlisselburg.org/art/graphics/main/3.png'},
|
||||||
|
{x: 556, y: 506, s: -0.7, url: 'https://static.shlisselburg.org/art/graphics/main/2.png'},
|
||||||
|
{x: 0, y: 914, s: -0.7, url: 'https://static.shlisselburg.org/art/graphics/main/1.png'},
|
||||||
|
|
||||||
|
{x: 13, y: 88, s: 0, url: 'https://static.shlisselburg.org/art/graphics/main/title.png'}
|
||||||
|
];
|
||||||
|
|
||||||
|
function mapper(range1, range2, fit) {
|
||||||
|
let [r1, r2] = range1;
|
||||||
|
let [d1, d2] = range2;
|
||||||
|
|
||||||
|
let constrain = value => {
|
||||||
|
var min = Math.min(d1, d2);
|
||||||
|
var max = Math.max(d1, d2);
|
||||||
|
return Math.min(max, Math.max(min, value));
|
||||||
|
};
|
||||||
|
|
||||||
|
return value => fit ?
|
||||||
|
constrain(map_range(value, r1, r2, d1, d2))
|
||||||
|
:
|
||||||
|
map_range(value, r1, r2, d1, d2)
|
||||||
|
}
|
||||||
|
|
||||||
|
let hm = mapper([0, 900], [0, 900], true);
|
||||||
|
let em = mapper([340, 900], [0, 400], true);
|
||||||
|
//let pm = mapper([0, 1000], [1000, 900], true);
|
||||||
|
|
||||||
|
function updateHead(value) {
|
||||||
|
//console.log(value);
|
||||||
|
|
||||||
|
let v = hm(value);
|
||||||
|
//let v = value;
|
||||||
|
|
||||||
|
try {
|
||||||
|
[...document.querySelectorAll('.parallax .parallax__layer')]
|
||||||
|
.forEach((e, i) => {
|
||||||
|
let layer = scope.layers[i];
|
||||||
|
e.style.top = `${layer.y + v * layer.s}px`;
|
||||||
|
});
|
||||||
|
|
||||||
|
let end = document.querySelector('.parallax .parallax__end');
|
||||||
|
end.style.height = `${em(value)}px`;
|
||||||
|
|
||||||
|
//let container = document.querySelector('.parallax');
|
||||||
|
//container.style.height = '1000px';
|
||||||
|
//container.style.height = `${pm(value)}px`;
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
updateHead(0);
|
||||||
|
$(window).scroll(() => {
|
||||||
|
updateHead($(window).scrollTop())
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import template from '../../templates/components/schedule.html';
|
import template from '../../templates/components/schedule.html';
|
||||||
|
import {mobileMatchSelector} from '../config';
|
||||||
|
|
||||||
export default function(app) {
|
export default function(app) {
|
||||||
app.component('schedule', {
|
app.component('schedule', {
|
||||||
@@ -10,11 +11,11 @@ export default function(app) {
|
|||||||
this.type = 'table';
|
this.type = 'table';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (window.matchMedia('(max-device-width: 30em)').matches) {
|
if (window.matchMedia(mobileMatchSelector).matches) {
|
||||||
this.type = 'slider';
|
this.type = 'slider';
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -13,9 +13,9 @@ function week(schedule) {
|
|||||||
date: dates[i],
|
date: dates[i],
|
||||||
groups: schedule.map(group => {
|
groups: schedule.map(group => {
|
||||||
return {
|
return {
|
||||||
name: group.name,
|
name: group.group,
|
||||||
time: group.time,
|
time: group.time,
|
||||||
content: group.days[i]
|
content: group.week[i]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,29 @@
|
|||||||
import {splitName} from '../../models/collective';
|
import {splitName} from '../../models/collective';
|
||||||
|
import {stringToBoolean} from '../../utils/string';
|
||||||
import template from '../../templates/components/teacher-profile.html';
|
import template from '../../templates/components/teacher-profile.html';
|
||||||
|
|
||||||
export default function (app) {
|
export default function (app) {
|
||||||
app.component('teacherProfile', {
|
app.component('teacherProfile', {
|
||||||
bindings: {
|
bindings: {
|
||||||
member: '='
|
profile: '<',
|
||||||
|
showUrl: '@'
|
||||||
},
|
},
|
||||||
template: template,
|
template: template,
|
||||||
|
controllerAs: '$',
|
||||||
controller: function($sce){
|
controller: function($sce){
|
||||||
const [_, first, middle, last] = splitName(this.member.name);
|
this.url = this.showUrl === 'true';
|
||||||
|
//this.showUrl = stringToBoolean(this.showUrl);
|
||||||
|
|
||||||
|
const [_, first, middle, last] = splitName(this.profile.name);
|
||||||
this.firstName = first;
|
this.firstName = first;
|
||||||
this.middleName = middle;
|
this.middleName = middle;
|
||||||
this.lastName = last;
|
this.lastName = last;
|
||||||
|
|
||||||
if(this.member.picture){
|
if (this.profile.picture) {
|
||||||
this.image = this.member.picture.big;
|
this.image = this.profile.picture.data.big;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.biography = $sce.trustAsHtml(this.member.biography);
|
this.biography = $sce.trustAsHtml(this.profile.biography);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -28,8 +28,8 @@ export default function(app) {
|
|||||||
app.component('timeline', {
|
app.component('timeline', {
|
||||||
template: template,
|
template: template,
|
||||||
controller: function($timeout, usSpinnerService, io, api){
|
controller: function($timeout, usSpinnerService, io, api){
|
||||||
let portion = 0;
|
let skip = 0;
|
||||||
let count = 10;
|
let limit = 10;
|
||||||
this.feed = [];
|
this.feed = [];
|
||||||
|
|
||||||
this.timelineUpdating = false;
|
this.timelineUpdating = false;
|
||||||
@@ -59,7 +59,7 @@ export default function(app) {
|
|||||||
this.timelineUpdating = true;
|
this.timelineUpdating = true;
|
||||||
usSpinnerService.spin('timelineMore');
|
usSpinnerService.spin('timelineMore');
|
||||||
|
|
||||||
api.news.feed(count, portion)
|
api.timeline.feed(limit, skip)
|
||||||
.error(error => {
|
.error(error => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
})
|
})
|
||||||
@@ -72,7 +72,7 @@ export default function(app) {
|
|||||||
else return post;
|
else return post;
|
||||||
});
|
});
|
||||||
|
|
||||||
portion++;
|
skip++;
|
||||||
this.feed = this.feed.concat(feed2);
|
this.feed = this.feed.concat(feed2);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export default function (app) {
|
|||||||
},
|
},
|
||||||
template: template,
|
template: template,
|
||||||
controller: function($sce){
|
controller: function($sce){
|
||||||
this.message = $sce.trustAsHtml(this.post.body);
|
this.message = $sce.trustAsHtml(this.post.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
+2
-41
@@ -2,6 +2,8 @@ import {stringReplace} from '../utils/string';
|
|||||||
|
|
||||||
const nbsp = 0xA0;
|
const nbsp = 0xA0;
|
||||||
|
|
||||||
|
export const mobileMatchSelector = '(max-device-width: 30em)';
|
||||||
|
|
||||||
export let contacts = {
|
export let contacts = {
|
||||||
telephone: '+7 (81362) 76-312',
|
telephone: '+7 (81362) 76-312',
|
||||||
email: 'hudozka@gmail.com',
|
email: 'hudozka@gmail.com',
|
||||||
@@ -19,47 +21,6 @@ export let collectiveSortPattern = [
|
|||||||
'nv-andreeva'
|
'nv-andreeva'
|
||||||
];
|
];
|
||||||
|
|
||||||
export let routes = [
|
|
||||||
{
|
|
||||||
name: '/',
|
|
||||||
template: '<page-school></page-school>',
|
|
||||||
title: 'ДХШ Шлиссельбурга'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '/events/:page?/:pageNumber?',
|
|
||||||
template: '<page-events></page-events>',
|
|
||||||
title: 'События Школы'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '/event/:event',
|
|
||||||
template: '<page-event></page-event>'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '/schedule/:period?/:semester?',
|
|
||||||
template: '<page-schedule></page-schedule>',
|
|
||||||
title: 'Расписание'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '/collective',
|
|
||||||
template: '<page-collective></page-collective>',
|
|
||||||
title: 'Преподаватели'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '/gallery',
|
|
||||||
template: '<page-gallery></page-gallery>',
|
|
||||||
title: 'Работы учащихся'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '/gallery/:year/:course/:album',
|
|
||||||
template: '<page-gallery-album></page-gallery-album>'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '/documents',
|
|
||||||
template: '<page-documents></page-documents>',
|
|
||||||
title: 'Документы'
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
export const footer = {
|
export const footer = {
|
||||||
links: {
|
links: {
|
||||||
docs: {
|
docs: {
|
||||||
|
|||||||
@@ -1,7 +1,17 @@
|
|||||||
import {footer} from '../config';
|
import {footer, mobileMatchSelector} from '../config';
|
||||||
|
|
||||||
export default function (app) {
|
export default function (app) {
|
||||||
app.controller('AppController', ($scope, menu) => {
|
app.controller('AppController', ($scope, menu) => {
|
||||||
|
try {
|
||||||
|
if (window.matchMedia(mobileMatchSelector).matches) {
|
||||||
|
$scope.navigation = 'navigation';
|
||||||
|
}else{
|
||||||
|
$scope.navigation = 'main-menu';
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
$scope.navigation = 'main-menu';
|
||||||
|
}
|
||||||
|
|
||||||
$scope.menuProvider = menu.items;
|
$scope.menuProvider = menu.items;
|
||||||
$scope.footer = footer;
|
$scope.footer = footer;
|
||||||
});
|
});
|
||||||
|
|||||||
+19
-7
@@ -1,7 +1,8 @@
|
|||||||
|
import co from 'co';
|
||||||
import {c} from '../core/db';
|
import {c} from '../core/db';
|
||||||
import {getCollective} from './collective';
|
import {getCollective} from './collective';
|
||||||
|
|
||||||
import {populate} from '../models/schedule';
|
import {populate, scheduleDate} from '../models/schedule';
|
||||||
import {shortifyName} from '../models/collective';
|
import {shortifyName} from '../models/collective';
|
||||||
import {courses} from '../models/course';
|
import {courses} from '../models/course';
|
||||||
|
|
||||||
@@ -15,9 +16,16 @@ export function* getSchedule(period, semester) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function* getScheduleList() {
|
export function* getScheduleList() {
|
||||||
return yield c('schedules')
|
let list = yield c('schedules')
|
||||||
.find({}, {period: 1, semester: 1})
|
.find({}, {period: 1, semester: 1})
|
||||||
.toArray();
|
.toArray();
|
||||||
|
return list
|
||||||
|
.sort((a, b) => {
|
||||||
|
let ad = scheduleDate(a);
|
||||||
|
let bd = scheduleDate(b);
|
||||||
|
|
||||||
|
return ad.getTime() - bd.getTime();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function* populateSchedule(schedule) {
|
export function* populateSchedule(schedule) {
|
||||||
@@ -30,11 +38,11 @@ export function* populateSchedule(schedule) {
|
|||||||
let populateLesson = populate(courses);
|
let populateLesson = populate(courses);
|
||||||
let populateTeacher = populate(collective_dict, i => shortifyName(i));
|
let populateTeacher = populate(collective_dict, i => shortifyName(i));
|
||||||
|
|
||||||
return schedule.map(group => {
|
return schedule.map(i => {
|
||||||
return {
|
return {
|
||||||
name: group.name,
|
group: i.group,
|
||||||
time: group.time,
|
time: i.time,
|
||||||
days: group.days.map(record => {
|
week: i.week.map(record => {
|
||||||
if (!record) return record;
|
if (!record) return record;
|
||||||
|
|
||||||
let lesson = record.lesson;
|
let lesson = record.lesson;
|
||||||
@@ -44,7 +52,11 @@ export function* populateSchedule(schedule) {
|
|||||||
return {
|
return {
|
||||||
time: time,
|
time: time,
|
||||||
lesson: populateLesson(lesson),
|
lesson: populateLesson(lesson),
|
||||||
teacher: populateTeacher(teacher)
|
teacher: {
|
||||||
|
id: teacher,
|
||||||
|
url: `/teacher/${teacher}`,
|
||||||
|
name: populateTeacher(teacher)
|
||||||
|
}
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ function Publisher() {
|
|||||||
|
|
||||||
return uploadInstagrams(posts)
|
return uploadInstagrams(posts)
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return db.c("posts").find({"data.id": {$in: ids}}).toArray();
|
return db.c("timeline").find({"data.id": {$in: ids}}).toArray();
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.then(function (posts) {
|
.then(function (posts) {
|
||||||
@@ -91,7 +91,7 @@ function findInstagrams(tag){
|
|||||||
function uploadInstagrams(list){
|
function uploadInstagrams(list){
|
||||||
return Promise.all(
|
return Promise.all(
|
||||||
list.map(function (g) {
|
list.map(function (g) {
|
||||||
return db.c("posts").update({"data.id": g.data.id}, g, {upsert: true});
|
return db.c("timeline").update({"data.id": g.data.id}, g, {upsert: true});
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
+20
-1
@@ -1,5 +1,24 @@
|
|||||||
let tryReplace = (dict, record, map = i=>i) =>
|
let tryReplace = (dict, record, map = i=>i) =>
|
||||||
record in dict ? map(dict[record]) : record;
|
record in dict ? map(dict[record]) : record;
|
||||||
|
|
||||||
|
export const autumnMonth = 8;
|
||||||
|
export const springMonth = 0;
|
||||||
|
|
||||||
|
|
||||||
export const populate = (dict, map) =>
|
export const populate = (dict, map) =>
|
||||||
id => tryReplace(dict, id, map);
|
id => tryReplace(dict, id, map);
|
||||||
|
|
||||||
|
export function scheduleDate(schedule){
|
||||||
|
let {period, semester} = schedule;
|
||||||
|
|
||||||
|
let i = semester === 'spring' ? 1 : 0;
|
||||||
|
let year = parseInt(
|
||||||
|
period.split('-')[i]
|
||||||
|
);
|
||||||
|
|
||||||
|
return new Date(
|
||||||
|
year,
|
||||||
|
i ? springMonth : autumnMonth ,
|
||||||
|
1
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -19,7 +19,7 @@ export default function (app) {
|
|||||||
function *(type) {
|
function *(type) {
|
||||||
let types = {
|
let types = {
|
||||||
'document': ['documents', {type: 'document'}, populateDocPreview],
|
'document': ['documents', {type: 'document'}, populateDocPreview],
|
||||||
'award': ['awards', {}]
|
'award': ['awards', {}, populateDocPreview]
|
||||||
};
|
};
|
||||||
|
|
||||||
if (type in types) {
|
if (type in types) {
|
||||||
|
|||||||
+10
-1
@@ -1,14 +1,23 @@
|
|||||||
import route from 'koa-route';
|
import route from 'koa-route';
|
||||||
import {c} from '../core/db';
|
import {c} from '../core/db';
|
||||||
import {json} from './';
|
import {json} from './';
|
||||||
|
import {sortBy} from '../utils/sort';
|
||||||
|
|
||||||
export default function (app) {
|
export default function (app) {
|
||||||
|
let sortByDate = sortBy(
|
||||||
|
i => (new Date(i.date))
|
||||||
|
.getTime()
|
||||||
|
);
|
||||||
|
|
||||||
app.use(route.get('/events', json(
|
app.use(route.get('/events', json(
|
||||||
function *() {
|
function *() {
|
||||||
let query = {};
|
let query = {};
|
||||||
this.body = yield c('events')
|
let events = yield c('events')
|
||||||
.find(query)
|
.find(query)
|
||||||
.toArray();
|
.toArray();
|
||||||
|
|
||||||
|
this.body = events
|
||||||
|
.sort(sortByDate);
|
||||||
}
|
}
|
||||||
)));
|
)));
|
||||||
|
|
||||||
|
|||||||
+61
-41
@@ -6,47 +6,62 @@ import {json} from './';
|
|||||||
export default function (app) {
|
export default function (app) {
|
||||||
app.use(route.get('/gallery', json(
|
app.use(route.get('/gallery', json(
|
||||||
function *() {
|
function *() {
|
||||||
var query = {};
|
let query = {};
|
||||||
var albums = yield c('albums')
|
let fields = ['_id', 'id', 'title', 'date'];
|
||||||
.find(query)
|
//.reduce((f, i) => {
|
||||||
.toArray();
|
// f[i] = 1;
|
||||||
|
// return f;
|
||||||
|
//}, {});
|
||||||
|
|
||||||
albums = yield albums.map(processAlbum);
|
|
||||||
this.body = albums;
|
|
||||||
}
|
|
||||||
)));
|
|
||||||
|
|
||||||
app.use(route.get('/gallery/:year', json(
|
|
||||||
function *(year) {
|
|
||||||
year = parseInt(year);
|
|
||||||
let start = new Date(year, 0, 1);
|
|
||||||
let end = new Date(year, 11, 31);
|
|
||||||
let query = {
|
|
||||||
date: {$gte: start, $lt: end}
|
|
||||||
};
|
|
||||||
let albums = yield c('albums')
|
let albums = yield c('albums')
|
||||||
.find(query)
|
.find(query)
|
||||||
.toArray();
|
.toArray();
|
||||||
|
|
||||||
|
//albums = albums.map(i => {
|
||||||
|
// return fields.reduce((a, key)=> {
|
||||||
|
// a[key] = i[key];
|
||||||
|
// return a;
|
||||||
|
// }, {});
|
||||||
|
//});
|
||||||
|
|
||||||
albums = yield albums.map(processAlbum);
|
albums = yield albums.map(processAlbum);
|
||||||
this.body = albums;
|
this.body = albums;
|
||||||
}
|
}
|
||||||
)));
|
)));
|
||||||
|
|
||||||
app.use(route.get('/gallery/:year/:course/:album', json(
|
//app.use(route.get('/gallery/:year', json(
|
||||||
function *(year, course, album) {
|
// function *(year) {
|
||||||
year = parseInt(year);
|
// year = parseInt(year);
|
||||||
course = '/' + course;
|
// let start = new Date(year, 0, 1);
|
||||||
album = '/' + album;
|
// let end = new Date(year, 11, 31);
|
||||||
let start = new Date(year, 0, 1);
|
// let query = {
|
||||||
let end = new Date(year, 11, 31);
|
// date: {$gte: start, $lt: end}
|
||||||
let query = {
|
// };
|
||||||
date: {$gte: start, $lt: end},
|
// let albums = yield c('albums')
|
||||||
course_uri: course,
|
// .find(query)
|
||||||
uri: album
|
// .toArray();
|
||||||
};
|
//
|
||||||
|
// albums = yield albums.map(processAlbum);
|
||||||
|
// this.body = albums;
|
||||||
|
// }
|
||||||
|
//)));
|
||||||
|
|
||||||
let record = yield c('albums').findOne(query);
|
app.use(route.get('/album/:id', json(
|
||||||
|
function *(id) {
|
||||||
|
//year = parseInt(year);
|
||||||
|
//course = '/' + course;
|
||||||
|
//album = '/' + album;
|
||||||
|
//let start = new Date(year, 0, 1);
|
||||||
|
//let end = new Date(year, 11, 31);
|
||||||
|
//let query = {
|
||||||
|
// date: {$gte: start, $lt: end},
|
||||||
|
// course_uri: course,
|
||||||
|
// uri: album
|
||||||
|
//};
|
||||||
|
|
||||||
|
let record = yield c('albums').findOne({
|
||||||
|
id: id
|
||||||
|
});
|
||||||
record = yield processAlbum(record);
|
record = yield processAlbum(record);
|
||||||
this.body = record;
|
this.body = record;
|
||||||
}
|
}
|
||||||
@@ -54,19 +69,24 @@ export default function (app) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let processAlbum = album => co(function *() {
|
let processAlbum = album => co(function *() {
|
||||||
album.url = `/gallery/{year}{course}{album}`
|
//album.url = `/gallery/{year}{course}{album}`
|
||||||
.replace('{year}', album.date.getFullYear())
|
// .replace('{year}', album.date.getFullYear())
|
||||||
.replace('{course}', album.course_uri)
|
// .replace('{course}', album.course_uri)
|
||||||
.replace('{album}', album.uri);
|
// .replace('{album}', album.uri);
|
||||||
|
album.url = `/album/${album.id}`;
|
||||||
|
|
||||||
album.content = yield album.content.map(product_id => co(function *() {
|
//album.content = yield album.content.map(product_id => co(function *() {
|
||||||
let product = yield c('products').findOne({_id: product_id});
|
// let product = yield c('products').findOne({_id: product_id});
|
||||||
if (product) return product;
|
// if (product) return product;
|
||||||
else return null;
|
// else return null;
|
||||||
}));
|
//}));
|
||||||
|
|
||||||
let teacher = yield c('collective').findOne({id: album.teacher});
|
//let teacher = yield c('collective').findOne({id: album.teacher});
|
||||||
album.teacher = teacher.name;
|
//album.teacher = teacher.name;
|
||||||
|
|
||||||
|
let previewImageId = album.images[0];
|
||||||
|
let image = yield c('images').findOne({_id: previewImageId});
|
||||||
|
album.preview = image.data.medium;
|
||||||
|
|
||||||
return album;
|
return album;
|
||||||
});
|
});
|
||||||
+2
-7
@@ -2,14 +2,9 @@ import path from 'path';
|
|||||||
import fs from 'mz/fs';
|
import fs from 'mz/fs';
|
||||||
import config from '../config';
|
import config from '../config';
|
||||||
|
|
||||||
export function queryObject(){
|
import {map, assign} from '../utils/common';
|
||||||
let assign = (dict, key, value) => {
|
|
||||||
dict[key] = value;
|
|
||||||
return dict;
|
|
||||||
};
|
|
||||||
let map = (v, fn) =>
|
|
||||||
value => fn(value) ? v : value;
|
|
||||||
|
|
||||||
|
export function queryObject() {
|
||||||
let toTrue = map(true, i => i === 'true');
|
let toTrue = map(true, i => i === 'true');
|
||||||
let toFalse = map(false, i => i === 'false');
|
let toFalse = map(false, i => i === 'false');
|
||||||
const processors = [toTrue, toFalse];
|
const processors = [toTrue, toFalse];
|
||||||
|
|||||||
+50
-62
@@ -1,78 +1,75 @@
|
|||||||
/**
|
import route from 'koa-route';
|
||||||
* Created by tmshv on 22/11/14.
|
import {accepts, index} from './';
|
||||||
*/
|
import {c} from '../core/db';
|
||||||
|
import {sortBy} from '../utils/sort';
|
||||||
|
|
||||||
var route = require("koa-route");
|
export default function (app) {
|
||||||
var router = require("./");
|
let sortNewsByDate = sortBy(
|
||||||
var db = require("../core/db");
|
i => (new Date(i.date))
|
||||||
|
.getTime()
|
||||||
|
);
|
||||||
|
|
||||||
module.exports = function (app) {
|
app.use(route.get('/news', accepts({
|
||||||
app.use(route.get("/news", router.accepts({
|
'text/html': function *() {
|
||||||
"text/html": function *() {
|
this.redirect('/');
|
||||||
this.redirect("/");
|
|
||||||
},
|
},
|
||||||
"text/plain": function *() {
|
'text/plain': function *() {
|
||||||
this.redirect("/");
|
this.redirect('/');
|
||||||
},
|
},
|
||||||
"application/json": function *() {
|
'application/json': function *() {
|
||||||
var count = parseInt(this.query["count"]) || 10;
|
let limit = parseInt(this.query['limit']) || 10;
|
||||||
var portion = parseInt(this.query["portion"]) || 0;
|
let skip = parseInt(this.query['skip']) || 0;
|
||||||
var skip = portion * count;
|
|
||||||
|
|
||||||
var query = {};
|
let query = {};
|
||||||
if (this.query.type) query.type = this.query.type;
|
if (this.query.type) query.type = this.query.type;
|
||||||
|
|
||||||
var pinned = [];
|
let pinned = [];
|
||||||
if(portion == 0) {
|
if(skip == 0) {
|
||||||
var now = new Date();
|
const now = new Date();
|
||||||
pinned = yield db.c("posts").find({until: {$gte: now}}).toArray()
|
pinned = yield c('timeline')
|
||||||
.then(function (items) {
|
.find({until: {$gte: now}})
|
||||||
return items.sort(sortNewsByDate);
|
.toArray()
|
||||||
});
|
.then(i => i.sort(sortNewsByDate));
|
||||||
}
|
}
|
||||||
var pinned_ids = pinned.map(function (p) {
|
|
||||||
return p["_id"]+"";
|
|
||||||
});
|
|
||||||
|
|
||||||
var posts = yield db.c("posts").find(query)
|
let sid = id => id + '';
|
||||||
|
let pinnedIds = pinned.map(p => sid(p['_id']));
|
||||||
|
|
||||||
|
let posts = yield c('timeline')
|
||||||
|
.find(query)
|
||||||
.sort({date: -1})
|
.sort({date: -1})
|
||||||
.skip(skip)
|
.skip(skip)
|
||||||
.limit(count)
|
.limit(limit)
|
||||||
.toArray()
|
.toArray()
|
||||||
.then(function (items) {
|
.then(items => items.filter(
|
||||||
return items.filter(function (i) {
|
i => pinnedIds.indexOf(sid(i['_id'])) < 0
|
||||||
var id = i["_id"]+"";
|
));
|
||||||
return pinned_ids.indexOf(id) < 0;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
this.body = pinned.concat(posts);
|
this.body = pinned.concat(posts);
|
||||||
//this.body = pinned_ids
|
|
||||||
}
|
}
|
||||||
})));
|
})));
|
||||||
|
|
||||||
app.use(route.get("/news/pinned", router.accepts({
|
app.use(route.get('/news/pinned', accepts({
|
||||||
"text/html": function *() {
|
'text/html': function *() {
|
||||||
this.redirect("/");
|
this.redirect('/');
|
||||||
},
|
},
|
||||||
"text/plain": function *() {
|
'text/plain': function *() {
|
||||||
this.redirect("/");
|
this.redirect('/');
|
||||||
},
|
},
|
||||||
"application/json": function *() {
|
'application/json': function *() {
|
||||||
var now = new Date();
|
let now = new Date();
|
||||||
var pinned = yield db.c("posts").find({until: {$gte: now}}).toArray()
|
this.body = yield c('timeline')
|
||||||
.then(function (items) {
|
.find({until: {$gte: now}})
|
||||||
return items.sort(sortNewsByDate);
|
.toArray()
|
||||||
});
|
.then(i => i.sort(sortNewsByDate));
|
||||||
this.body = pinned;
|
|
||||||
}
|
}
|
||||||
})));
|
})));
|
||||||
|
|
||||||
app.use(route.get("/news/:uri", router.accepts({
|
app.use(route.get('/news/:id', accepts({
|
||||||
"text/html": router.index(),
|
'text/html': index(),
|
||||||
"text/plain": router.index(),
|
'text/plain': index(),
|
||||||
"application/json": function *(uri) {
|
'application/json': function *(id) {
|
||||||
var item = yield db.c("posts").findOne({uri: uri});
|
let item = yield c('timeline').findOne({uri: id});
|
||||||
if (item) {
|
if (item) {
|
||||||
this.body = item;
|
this.body = item;
|
||||||
} else {
|
} else {
|
||||||
@@ -81,12 +78,3 @@ module.exports = function (app) {
|
|||||||
}
|
}
|
||||||
})));
|
})));
|
||||||
};
|
};
|
||||||
|
|
||||||
function sortNewsByDate(i1, i2) {
|
|
||||||
var t1 = new Date(i1.date).getTime();
|
|
||||||
var t2 = new Date(i2.date).getTime();
|
|
||||||
|
|
||||||
if (t1 < t2) return 1;
|
|
||||||
if (t1 > t2) return -1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
import co from 'co';
|
||||||
|
import route from 'koa-route';
|
||||||
|
import {index, json} from './';
|
||||||
|
import {sortByPattern} from '../utils/sort';
|
||||||
|
import {c} from '../core/db';
|
||||||
|
|
||||||
|
let split = d => s => s.split(d);
|
||||||
|
let toArray = split(',');
|
||||||
|
|
||||||
|
export default function (app) {
|
||||||
|
app.use(route.get('/collective', index()));
|
||||||
|
|
||||||
|
app.use(route.get('/teacher/list', json(
|
||||||
|
function *() {
|
||||||
|
this.type = 'application/json';
|
||||||
|
let pattern = toArray(this.query.sort || '');
|
||||||
|
|
||||||
|
let data = yield c('collective').find();
|
||||||
|
if (!data) {
|
||||||
|
this.status = 404;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let collective = yield data
|
||||||
|
.map(processProfile);
|
||||||
|
|
||||||
|
this.body = sortByPattern(collective, pattern, i => i.id);
|
||||||
|
}
|
||||||
|
)));
|
||||||
|
|
||||||
|
app.use(route.get('/teacher/:id', json(
|
||||||
|
function *(id) {
|
||||||
|
this.type = 'application/json';
|
||||||
|
|
||||||
|
let data = yield c('collective').findOne({id: id});
|
||||||
|
if (!data) {
|
||||||
|
this.status = 404;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.body = yield processProfile(data);
|
||||||
|
}
|
||||||
|
)))
|
||||||
|
};
|
||||||
|
|
||||||
|
let processProfile = profile => co(function *() {
|
||||||
|
let imageId = profile.picture;
|
||||||
|
profile.picture = yield c('images').findOne({_id: imageId});
|
||||||
|
profile.url = `/teacher/${profile.id}`;
|
||||||
|
return profile;
|
||||||
|
});
|
||||||
+2
-2
@@ -22,7 +22,7 @@ import instagram from './instagram/router';
|
|||||||
import instagramIO from './instagram/io';
|
import instagramIO from './instagram/io';
|
||||||
import error404 from './routes/404';
|
import error404 from './routes/404';
|
||||||
import documents from './routes/documents';
|
import documents from './routes/documents';
|
||||||
import collective from './routes/collective';
|
import teachers from './routes/teachers';
|
||||||
import events from './routes/events';
|
import events from './routes/events';
|
||||||
|
|
||||||
export const app = koa();
|
export const app = koa();
|
||||||
@@ -58,5 +58,5 @@ instagram(app);
|
|||||||
instagramIO(app);
|
instagramIO(app);
|
||||||
documents(app);
|
documents(app);
|
||||||
events(app);
|
events(app);
|
||||||
app.use(collective());
|
teachers(app);
|
||||||
app.use(error404());
|
app.use(error404());
|
||||||
+1
-14
@@ -1,26 +1,13 @@
|
|||||||
@import "variables";
|
@import "variables";
|
||||||
|
|
||||||
.album-block {
|
.album-block {
|
||||||
width: 100%;
|
//margin: 1em auto 2em;
|
||||||
margin: 1em auto 2em;
|
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 1.5em 0 1em;
|
margin: 1.5em 0 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fotorama__nav-wrap {
|
|
||||||
margin: 6em 0 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fotorama__stage{
|
|
||||||
overflow: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fotorama__stage__frame{
|
|
||||||
overflow: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
.album {
|
.album {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|||||||
@@ -5,5 +5,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.body-wrapper__content {
|
.body-wrapper__content {
|
||||||
margin: $menu-thickness auto 0;
|
margin: 0 auto 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: $mobile-width) {
|
||||||
|
.body-wrapper__content {
|
||||||
|
margin: $menu-thickness auto 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,8 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
position: relative;
|
position: relative;
|
||||||
align-items:flex-end;
|
justify-content: center;
|
||||||
|
align-items:flex-start;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__title{
|
&__title{
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
@import "../variables";
|
||||||
|
|
||||||
|
.album {
|
||||||
|
margin-bottom: $double-margin;
|
||||||
|
|
||||||
|
&__head {
|
||||||
|
margin-bottom: 1.25em;
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
font-size: $big-font-size;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date {
|
||||||
|
text-align: center;
|
||||||
|
color: #aaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: $dark-color;
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__body{
|
||||||
|
img {
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 40em;
|
||||||
|
|
||||||
|
display: block;
|
||||||
|
margin: 1.25em auto $small-margin;
|
||||||
|
}
|
||||||
|
|
||||||
|
p{
|
||||||
|
margin-bottom: 1.25em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: $mobile-width) {
|
||||||
|
.album {
|
||||||
|
&__body {
|
||||||
|
img {
|
||||||
|
max-height: 20em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -23,6 +23,6 @@
|
|||||||
|
|
||||||
@media (max-width: $mobile-width) {
|
@media (max-width: $mobile-width) {
|
||||||
.document {
|
.document {
|
||||||
margin: 0 0 $single-margin;
|
margin: 0 $single-margin/2 $single-margin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
@import "../variables";
|
||||||
|
|
||||||
.documents-container {
|
.documents-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
@@ -5,8 +7,7 @@
|
|||||||
align-items: baseline;
|
align-items: baseline;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 31.25em) {
|
@media (max-width: $mobile-width) {
|
||||||
.documents-block {
|
.documents-container {
|
||||||
margin: 1em 0 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,10 +4,10 @@
|
|||||||
margin-bottom: $double-margin;
|
margin-bottom: $double-margin;
|
||||||
|
|
||||||
&__head {
|
&__head {
|
||||||
margin-bottom: $small-margin;
|
margin-bottom: 1.25em;
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
font-size: 1.75em;
|
font-size: $big-font-size;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,9 +25,27 @@
|
|||||||
&__body{
|
&__body{
|
||||||
img {
|
img {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
max-height: 100%;
|
//max-height: 100%;
|
||||||
|
|
||||||
|
max-height: 40em;
|
||||||
|
|
||||||
display: block;
|
display: block;
|
||||||
margin: 0 auto $small-margin;
|
margin: 1.25em auto $small-margin;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin-bottom: 1.25em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: $mobile-width) {
|
||||||
|
.event-post {
|
||||||
|
|
||||||
|
&__body {
|
||||||
|
img {
|
||||||
|
max-height: 20em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,20 +4,35 @@ $img-max-width: 500px;
|
|||||||
$double-margin-half: $double-margin / 2;
|
$double-margin-half: $double-margin / 2;
|
||||||
$percentage: 25%;
|
$percentage: 25%;
|
||||||
|
|
||||||
gallery-item {
|
.gallery-item {
|
||||||
width: $percentage;
|
|
||||||
padding: 0 $double-margin-half;
|
|
||||||
box-sizing: padding-box;
|
box-sizing: padding-box;
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
margin-bottom: $single-margin;
|
width: 13em;
|
||||||
|
height: 15em;
|
||||||
|
margin: 0 $single-margin $double-margin;
|
||||||
|
|
||||||
img{
|
h3 {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: $dark-color;
|
||||||
|
border-bottom: none;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
border-bottom: none;
|
||||||
|
color: $blue-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: $mobile-width) {
|
@media screen and (max-width: $mobile-width) {
|
||||||
.gallery-item {
|
.gallery-item {
|
||||||
margin: 0 0 1em;
|
margin: 0 0 $double-margin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
background-color: $darker-color;
|
background-color: rgba(255, 255, 255, 0.95);
|
||||||
|
|
||||||
font-size: 1.1em;
|
font-size: 1.1em;
|
||||||
color: $menu-inactive-item-color;
|
color: $menu-inactive-item-color;
|
||||||
@@ -29,13 +29,15 @@
|
|||||||
a {
|
a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
||||||
color: $light-color;
|
color: $dark-color;
|
||||||
border-bottom: 1px solid darken($light-color, 50%);
|
//border-bottom: 1px solid darken($light-color, 50%);
|
||||||
|
border-bottom: 1px solid lighten($dark-color, 60%);
|
||||||
|
|
||||||
&:hover {
|
//&:hover {
|
||||||
color: $lighter-color;
|
// color: $dark-color;
|
||||||
border-bottom: 1px solid darken($lighter-color, 50%);
|
//
|
||||||
}
|
// border-bottom: 1px solid darken($lighter-color, 50%);
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
.selected {
|
.selected {
|
||||||
@@ -43,7 +45,7 @@
|
|||||||
border-top: $menu-colored-mark-thickness solid $light-color;
|
border-top: $menu-colored-mark-thickness solid $light-color;
|
||||||
|
|
||||||
a:link, a:visited {
|
a:link, a:visited {
|
||||||
color: $lighter-color;
|
color: $dark-color;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
@@ -74,8 +76,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: $mobile-width) {
|
@media (max-width: $mobile-width) {
|
||||||
header{
|
header{
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.main-menu{
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -19,20 +19,28 @@
|
|||||||
.navigation__right {
|
.navigation__right {
|
||||||
color: $light-color;
|
color: $light-color;
|
||||||
margin-right: 3em;
|
margin-right: 3em;
|
||||||
|
|
||||||
|
z-index:1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: $mobile-width) {
|
@media (max-width: $mobile-width) {
|
||||||
.navigation {
|
.navigation {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
display: flex;
|
width: 100%;
|
||||||
justify-content: flex-start;
|
z-index: 100;
|
||||||
align-items: center;
|
position: relative;
|
||||||
|
top: 0;
|
||||||
|
|
||||||
|
display: block;
|
||||||
|
//display: flex;
|
||||||
|
//justify-content: flex-start;
|
||||||
|
//align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navigation__right {
|
.navigation__right {
|
||||||
//display: none;
|
//display: none;
|
||||||
margin-right: 0;
|
//margin-right: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8,4 +8,18 @@
|
|||||||
&.ng-enter {
|
&.ng-enter {
|
||||||
animation: slideInRight $short-duration both ease-in;
|
animation: slideInRight $short-duration both ease-in;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-collective {
|
||||||
|
&__collective-image {
|
||||||
|
min-height: 40em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: $mobile-width) {
|
||||||
|
.page-collective {
|
||||||
|
&__collective-image {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -9,4 +9,31 @@
|
|||||||
&.ng-enter {
|
&.ng-enter {
|
||||||
animation: scaleUp $short-duration both ease-in;
|
animation: scaleUp $short-duration both ease-in;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.hudozka-title {
|
||||||
|
padding: $double-margin 0;
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
p {
|
||||||
|
color: $light-color;
|
||||||
|
margin-bottom: $single-margin;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
margin-top: $single-margin;
|
||||||
|
font-size: 1.5em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: $mobile-width) {
|
||||||
|
.hudozka-title {
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 1em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
@import "../variables";
|
||||||
|
|
||||||
|
.parallax {
|
||||||
|
height: 1000px;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
&__layer {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__end {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
background-color: white;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,25 +27,34 @@ $info-width: 100% - $picture-width;
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
|
font-size: $big-font-size;
|
||||||
font-weight: 200;
|
font-weight: 200;
|
||||||
|
|
||||||
strong {
|
strong {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
a {
|
||||||
margin-bottom: $single-margin;
|
color: $dark-color;
|
||||||
}
|
|
||||||
|
|
||||||
.biography {
|
&:hover{
|
||||||
margin-top: $single-margin;
|
border-bottom-color: lighten($dark-color, 40%);
|
||||||
|
}
|
||||||
p{
|
|
||||||
margin-bottom: $single-margin;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__position {
|
||||||
|
font-size: $bigger-font-size;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__biography {
|
||||||
|
margin-top: $double-margin;
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin-bottom: $single-margin;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: $mobile-width) {
|
@media (max-width: $mobile-width) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
@import "components/album-collection";
|
@import "components/album-collection";
|
||||||
@import "components/gallery-item";
|
@import "components/gallery-item";
|
||||||
@import "components/document";
|
@import "components/document";
|
||||||
|
@import "components/documents-container";
|
||||||
@import "components/teacher-proifile";
|
@import "components/teacher-proifile";
|
||||||
@import "components/main-menu";
|
@import "components/main-menu";
|
||||||
@import "components/navigation";
|
@import "components/navigation";
|
||||||
@@ -12,6 +13,8 @@
|
|||||||
@import "components/schedule-table";
|
@import "components/schedule-table";
|
||||||
@import "components/footer-links";
|
@import "components/footer-links";
|
||||||
@import "components/event-post";
|
@import "components/event-post";
|
||||||
|
@import "components/album";
|
||||||
|
@import "components/parallax";
|
||||||
|
|
||||||
@import "components/page-school";
|
@import "components/page-school";
|
||||||
@import "components/page-schedule";
|
@import "components/page-schedule";
|
||||||
@@ -23,8 +26,6 @@
|
|||||||
@import "content";
|
@import "content";
|
||||||
@import "page-animation";
|
@import "page-animation";
|
||||||
|
|
||||||
@import "documents";
|
|
||||||
@import "album";
|
|
||||||
@import "schedule-selector";
|
@import "schedule-selector";
|
||||||
@import "schedule-mobile";
|
@import "schedule-mobile";
|
||||||
@import "error-404";
|
@import "error-404";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<div class="album-collection">
|
<div class="album-collection">
|
||||||
<h2 class="album-collection__title">{{$ctrl.title}}</h2>
|
<h2 class="album-collection__title">{{$.title}}</h2>
|
||||||
<div class="album-collection__body">
|
<div class="album-collection__body">
|
||||||
<gallery-item ng-repeat="album in $ctrl.albums" record="album"></gallery-item>
|
<gallery-item ng-repeat="i in $.albums" record="i"></gallery-item>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<article class="album">
|
||||||
|
<!--<header class="album__head">-->
|
||||||
|
<!--<h2>{{$.album.title}}</h2>-->
|
||||||
|
<!--<p class="date">{{$.album.date | date : "dd.MM.yyyy"}}</p>-->
|
||||||
|
<!--</header>-->
|
||||||
|
|
||||||
|
<!--<div class="album__body" ng-bind-html="$.post"></div>-->
|
||||||
|
|
||||||
|
<header class="album__head">
|
||||||
|
<h2>{{$.title}}</h2>
|
||||||
|
<!--<p class="date">{{$.album.date | date : "dd.MM.yyyy"}}</p>-->
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="album__body" ng-transclude></div>
|
||||||
|
</article>
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
<div class="document">
|
<div class="document">
|
||||||
<a href="{{$ctrl.document.thumbs.original.url}}" target="_blank">
|
<div class="document__image">
|
||||||
<img ng-src="{{$ctrl.document.thumbs.medium.url}}">
|
<a href="{{$.document.url}}" target="_blank" class="invisible">
|
||||||
</a>
|
<img ng-src="{{$.document.preview.data.small.url}}">
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<div class="event-post">
|
<article class="event-post">
|
||||||
<div class="event-post__head">
|
<header class="event-post__head">
|
||||||
<a href="{{$.url}}"><h3>{{$.post.title}}</h3></a>
|
<a href="{{$.url}}"><h3>{{$.post.title}}</h3></a>
|
||||||
<p class="date">{{$.post.date | date : "dd.MM.yyyy"}}</p>
|
<p class="date">{{$.post.date | date : "dd.MM.yyyy"}}</p>
|
||||||
</div>
|
</header>
|
||||||
|
|
||||||
<div class="event-post__body" ng-bind-html="$.message"></div>
|
<div class="event-post__body" ng-bind-html="$.message"></div>
|
||||||
</div>
|
</article>
|
||||||
@@ -1,9 +1,6 @@
|
|||||||
<div class="gallery-item">
|
<div class="gallery-item">
|
||||||
<h3>
|
<a href="{{$.record.url}}">
|
||||||
<a href="{{$ctrl.record.url}}">{{$ctrl.record.title}}</a>
|
<h3>{{$.record.title}}</h3>
|
||||||
</h3>
|
<img ng-src="{{$.previewImage}}" alt="{{$.record.title}}"/>
|
||||||
<a href="{{$ctrl.record.url}}" class="invisible">
|
|
||||||
<img ng-src="{{$ctrl.record.preview_url}}" alt="{{$ctrl.record.title}}"/>
|
|
||||||
</a>
|
</a>
|
||||||
<p>{{$ctrl.record.course}}</p>
|
|
||||||
</div>
|
</div>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<div class="navigation">
|
<div class="navigation">
|
||||||
<main-menu items="$ctrl.menu"></main-menu>
|
<main-menu items="$.menu"></main-menu>
|
||||||
|
|
||||||
<div class="navigation__right">
|
<div class="navigation__right">
|
||||||
<span>+7 (81362) 76-312</span>
|
<span>+7 (81362) 76-312</span>
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<div class="content content_thin content--padding-top--menu">
|
||||||
|
<!--<album album="$.album"></album>-->
|
||||||
|
<album title="{{$.album.title}}">
|
||||||
|
<div ng-bind-html="$.post"></div>
|
||||||
|
</album>
|
||||||
|
|
||||||
|
<!--<breadcrumbs crumbs="$.crumbs"></breadcrumbs>-->
|
||||||
|
|
||||||
|
<!--<div class="album-block">-->
|
||||||
|
<!--<h1>{{$.album.title}}</h1>-->
|
||||||
|
|
||||||
|
<!--<div class="album" ng-show="$.album">-->
|
||||||
|
<!--<div class="album-info">-->
|
||||||
|
<!--<p>Предмет: {{$.album.course}}</p>-->
|
||||||
|
<!--<p>Преподаватель: {{$.album.teacherName}}</p>-->
|
||||||
|
<!--<p class="description" ng-show="$.album.description">{{$.album.description}}</p>-->
|
||||||
|
<!--</div>-->
|
||||||
|
|
||||||
|
<!--<div class="album-item" ng-repeat="product in $.album.content">-->
|
||||||
|
<!--<img ng-src="{{product.content.big.url}}" alt=""/>-->
|
||||||
|
|
||||||
|
<!--<div class="product-info">-->
|
||||||
|
<!--<div>-->
|
||||||
|
<!--<p ng-show="product.title" class="title">{{product.title | removeNewline}}</p>-->
|
||||||
|
|
||||||
|
<!--<p>{{product.author}}</p>-->
|
||||||
|
|
||||||
|
<!--<p ng-show="product.authorAge">{{product.authorAge}} лет</p>-->
|
||||||
|
<!--</div>-->
|
||||||
|
<!--</div>-->
|
||||||
|
<!--</div>-->
|
||||||
|
<!--</div>-->
|
||||||
|
<!--</div>-->
|
||||||
|
</div>
|
||||||
@@ -1,7 +1,12 @@
|
|||||||
<div class="page-collective content content_full">
|
<div class="page-collective content content_full">
|
||||||
<!--<img ng-style="$ctrl.imageStyle" class="collective-image" src="https://static.shlisselburg.org/art/collective/collective.jpg" alt="">-->
|
<img class="page-collective__collective-image"
|
||||||
<!--<div class="page-collective__body content content_semi-wide content_down-screen content_padding">-->
|
width="100%"
|
||||||
<div class="content content_semi-wide">
|
src="https://static.shlisselburg.org/art/graphics/collective.jpg">
|
||||||
<teacher-profile ng-repeat="person in $ctrl.members track by $index" member="person"></teacher-profile>
|
|
||||||
|
<div class="content content_semi-wide content--padding-top--double">
|
||||||
|
<teacher-profile
|
||||||
|
ng-repeat="i in $ctrl.members"
|
||||||
|
profile="i"
|
||||||
|
show-url="{{true}}"></teacher-profile>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<div class="content content_wide">
|
<div class="content content_wide content--padding-top--menu">
|
||||||
<div ng-repeat="c in $ctrl.collections">
|
<div ng-repeat="c in $.collections">
|
||||||
<h2>{{c.name}}</h2>
|
<h2>{{c.name}}</h2>
|
||||||
|
|
||||||
<div class="documents-container">
|
<div class="documents-container">
|
||||||
@@ -9,6 +9,6 @@
|
|||||||
|
|
||||||
<h2>Награды</h2>
|
<h2>Награды</h2>
|
||||||
<div class="documents-container">
|
<div class="documents-container">
|
||||||
<award ng-repeat="i in $ctrl.awards" document="i"></award>
|
<award ng-repeat="i in $.awards" document="i"></award>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
<div class="content content_thin content--padding-top--double">
|
<section class="content content_thin content--padding-top--menu">
|
||||||
<event-post ng-repeat="i in $.posts" post="i"></event-post>
|
<event-post ng-repeat="i in $.posts" post="i"></event-post>
|
||||||
</div>
|
</section>
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
<div class="content content_thin content--padding-top--double">
|
<section class="content content_thin content--padding-top--menu">
|
||||||
<event-post ng-repeat="i in $.posts" post="i"></event-post>
|
<event-post ng-repeat="i in $.events" post="i"></event-post>
|
||||||
</div>
|
</section>
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
<div class="content content_wide">
|
<div class="content content_wide content--padding-top--menu">
|
||||||
<album-collection ng-repeat="i in $ctrl.years"
|
<album-collection
|
||||||
title="{{i.year}}" albums="i.albums"
|
ng-repeat="i in $.collections"
|
||||||
|
title="{{i.title}}"
|
||||||
|
albums="i.albums"
|
||||||
></album-collection>
|
></album-collection>
|
||||||
</div>
|
</div>
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
<div class="content content_wide">
|
<div class="content content_wide content--padding-top--menu">
|
||||||
<div class="schedule-selector">
|
<div class="schedule-selector">
|
||||||
<label> Семестр
|
<label> Семестр
|
||||||
<select
|
<select
|
||||||
ng-model="$ctrl.currentSchedule"
|
ng-model="$ctrl.currentSchedule"
|
||||||
ng-change="$ctrl.loadSchedule($ctrl.currentSchedule, true)"
|
ng-change="$ctrl.loadSchedule($ctrl.currentSchedule, true)"
|
||||||
ng-options="s.text for s in $ctrl.schedules">
|
ng-options="s.text for s in $ctrl.schedules">
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<schedule schedule="$ctrl.schedule"></schedule>
|
<schedule schedule="$ctrl.schedule"></schedule>
|
||||||
</div>
|
</div>
|
||||||
@@ -1,8 +1,14 @@
|
|||||||
<div class="content content_full">
|
<div class="content content_full" ng-switch="$.helloBlock">
|
||||||
<img src="https://static.shlisselburg.org/art/graphics/entrance.jpg" width="100%">
|
<img ng-switch-when="mobile-image"
|
||||||
|
src="https://static.shlisselburg.org/art/graphics/entrance.jpg" width="100%">
|
||||||
|
<parallax ng-switch-default></parallax>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content content_thin">
|
<div class="content content_thin">
|
||||||
|
<div class="hudozka-title">
|
||||||
|
<p>МБОУДОД</p>
|
||||||
|
<h1>Шлиссельбургская детская художественная школа</h1>
|
||||||
|
</div>
|
||||||
<!--<div class="main-block">-->
|
<!--<div class="main-block">-->
|
||||||
<!--<div>-->
|
<!--<div>-->
|
||||||
<!--<!–<a href="tel://{{telephone}}"></a>–>-->
|
<!--<!–<a href="tel://{{telephone}}"></a>–>-->
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<div class="content content_semi-wide content--padding-top--menu">
|
||||||
|
<teacher-profile profile="$.member" show-url="{{false}}"></teacher-profile>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<div class="parallax">
|
||||||
|
<div class="parallax__layer" ng-repeat="i in layers" ng-style="{top: i.y, left: i.x}">
|
||||||
|
<img ng-src="{{i.url}}" alt="">
|
||||||
|
</div>
|
||||||
|
<div class="parallax__end"></div>
|
||||||
|
</div>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<div class="schedule-record__head">Группа {{$ctrl.record.name}} ({{$ctrl.record.time}})</div>
|
<div class="schedule-record__head">Группа {{$ctrl.record.name}} ({{$ctrl.record.time}})</div>
|
||||||
<div class="schedule-record__main">
|
<div class="schedule-record__main">
|
||||||
<p class="schedule-record__name">{{$ctrl.record.content.lesson}}</p>
|
<p class="schedule-record__name">{{$ctrl.record.content.lesson}}</p>
|
||||||
<p class="schedule-record__tutor">{{$ctrl.record.content.teacher}}</p>
|
<p class="schedule-record__tutor"><a href="{{$ctrl.record.content.teacher.url}}">{{$ctrl.record.content.teacher.name}}</a></p>
|
||||||
<p class="schedule-record__time" ng-repeat="time in $ctrl.record.content.time">{{time}}</p>
|
<p class="schedule-record__time" ng-repeat="time in $ctrl.record.content.time">{{time}}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -28,17 +28,22 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="schedule-table__body">
|
<div class="schedule-table__body">
|
||||||
<div class="schedule-table__body-row" ng-repeat="group in $ctrl.schedule">
|
<div class="schedule-table__body-row"
|
||||||
|
ng-repeat="i in $ctrl.schedule">
|
||||||
|
|
||||||
<div class="schedule-table__body-group">
|
<div class="schedule-table__body-group">
|
||||||
<p class="name">{{group.name}}</p>
|
<p class="name">{{i.group}}</p>
|
||||||
<p class="time">{{group.time}}</p>
|
<p class="time">{{i.time}}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="schedule-table__record" ng-repeat="day in group.days track by $index" ng-class="{current: $ctrl.isToday($index)}">
|
<div class="schedule-table__record"
|
||||||
|
ng-repeat="day in i.week track by $index"
|
||||||
|
ng-class="{current: $ctrl.isToday($index)}"
|
||||||
|
>
|
||||||
|
|
||||||
<p class="lesson"><a href="">{{day.lesson}}</a></p>
|
<p class="lesson"><a href="">{{day.lesson}}</a></p>
|
||||||
<p class="teacher"><a href="">{{day.teacher}}</a></p>
|
<p class="teacher"><a href="{{day.teacher.url}}">{{day.teacher.name}}</a></p>
|
||||||
<p class="time">{{day.time[0] | join: '—'}}</p>
|
<p class="time" ng-repeat="time in day.time">{{time}}</p>
|
||||||
<p class="time">{{day.time[1] | join: '—'}}</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,18 +1,19 @@
|
|||||||
<div class="teacher-profile">
|
<div class="teacher-profile">
|
||||||
<div class="teacher-profile__picture">
|
<div class="teacher-profile__picture">
|
||||||
<img ng-src="{{$ctrl.image.url}}" >
|
<img ng-src="{{$.image.url}}" >
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="teacher-profile__info">
|
<div class="teacher-profile__info">
|
||||||
<h3>{{$ctrl.firstName}} {{$ctrl.middleName}} <strong>{{$ctrl.lastName}}</strong></h3>
|
<h3 ng-hide="$.url">{{$.firstName}} {{$.middleName}} <strong>{{$.lastName}}</strong></h3>
|
||||||
|
<h3 ng-show="$.url"><a href="{{$.profile.url}}">{{$.firstName}} {{$.middleName}} <strong>{{$.lastName}}</strong></a></h3>
|
||||||
|
|
||||||
<div class="info">
|
<div>
|
||||||
<p><strong>{{$ctrl.member.position}}</strong></p>
|
<p class="teacher-profile__position"><i><strong>{{$.profile.position}}</strong></i></p>
|
||||||
<p>{{$ctrl.member.status}}</p>
|
<p>{{$.profile.status}}</p>
|
||||||
<p>Образование: {{$ctrl.member.edu}}</p>
|
<p>Образование: {{$.profile.edu}}</p>
|
||||||
<p>Диплом: {{$ctrl.member.diploma}}</p>
|
<p>Диплом: <i>{{$.profile.diploma}}</i></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="biography" ng-bind-html="$ctrl.biography"></div>
|
<div class="teacher-profile__biography" ng-bind-html="$.biography"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
+10
-3
@@ -46,13 +46,20 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="body-wrapper" ng-controller="AppController">
|
<div class="body-wrapper" ng-controller="AppController">
|
||||||
<header>
|
<header ng-switch="navigation">
|
||||||
<main-menu items="menuProvider"></main-menu>
|
<main-menu items="menuProvider"></main-menu>
|
||||||
<!--<navigation menu="menuProvider"></navigation>-->
|
|
||||||
</header>
|
</header>
|
||||||
|
<!--<header ng-switch="navigation">-->
|
||||||
|
<!--<navigation menu="menuProvider"-->
|
||||||
|
<!--ng-switch-when="navigation"-->
|
||||||
|
<!--></navigation>-->
|
||||||
|
<!--<!–<main-menu items="menuProvider"–>-->
|
||||||
|
<!--<!–ng-switch-default–>-->
|
||||||
|
<!--<!–></main-menu>–>-->
|
||||||
|
<!--</header>-->
|
||||||
|
|
||||||
<div class="body-wrapper__content">
|
<div class="body-wrapper__content">
|
||||||
<div class="page {{pageClass}}" ng-view autoscroll="true"></div>
|
<ng-view class="page" autoscroll></ng-view>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
|
|||||||
Reference in new issue
Block a user