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 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);
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
let url = '/collective';
|
||||
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 {
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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 {
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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){
|
||||
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 FooterLinks from './components/FooterLinks';
|
||||
import EventPost from './components/EventPost';
|
||||
import Album from './components/Album';
|
||||
import Parallax from './components/Parallax';
|
||||
|
||||
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 PageTeacher from './components/PageTeacher';
|
||||
import PageGallery from './components/PageGallery';
|
||||
import PageGalleryAlbum from './components/PageGalleryAlbum';
|
||||
import PageAlbum from './components/PageAlbum';
|
||||
import PageDocuments from './components/PageDocuments';
|
||||
|
||||
import AppController from './controllers/AppController';
|
||||
@@ -45,7 +48,7 @@ import IOService from './services/io';
|
||||
import MenuService from './services/menu';
|
||||
import API from './services/api';
|
||||
|
||||
import {routes} from './config';
|
||||
import {collectiveSortPattern} from './config';
|
||||
|
||||
let app = angular.module('hudozka', [
|
||||
'ngRoute',
|
||||
@@ -58,9 +61,109 @@ app.config(($locationProvider, $routeProvider) => {
|
||||
$locationProvider.hashPrefix('!');
|
||||
$locationProvider.html5Mode(true);
|
||||
|
||||
routes.forEach(route => {
|
||||
if (typeof route === 'function') route = route();
|
||||
$routeProvider.when(route.name, route);
|
||||
let routers = [
|
||||
{
|
||||
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({
|
||||
@@ -96,6 +199,8 @@ app.run(($location, $rootScope, $http) => {
|
||||
TimelineRecordPost,
|
||||
TimelineRecordInstagram,
|
||||
EventPost,
|
||||
Album,
|
||||
Parallax,
|
||||
Document,
|
||||
Award,
|
||||
GalleryItem,
|
||||
@@ -106,8 +211,9 @@ app.run(($location, $rootScope, $http) => {
|
||||
PageEvents,
|
||||
PageSchedule,
|
||||
PageCollective,
|
||||
PageTeacher,
|
||||
PageGallery,
|
||||
PageGalleryAlbum,
|
||||
PageAlbum,
|
||||
PageDocuments,
|
||||
AppController,
|
||||
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: '@',
|
||||
albums: '<'
|
||||
},
|
||||
template: template
|
||||
template: template,
|
||||
controllerAs: '$'
|
||||
});
|
||||
};
|
||||
@@ -3,8 +3,9 @@ import template from '../../templates/components/award.html';
|
||||
export default function (app) {
|
||||
app.component('award', {
|
||||
bindings: {
|
||||
document: '='
|
||||
document: '<'
|
||||
},
|
||||
template: template
|
||||
template: template,
|
||||
controllerAs: '$'
|
||||
});
|
||||
};
|
||||
@@ -3,8 +3,12 @@ import template from '../../templates/components/gallery-item.html';
|
||||
export default function (app) {
|
||||
app.component('galleryItem', {
|
||||
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: {
|
||||
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 {collectiveSortPattern} from '../config';
|
||||
|
||||
export default function (app) {
|
||||
app.component('pageCollective', {
|
||||
bindings:{
|
||||
members: '<'
|
||||
},
|
||||
template: template,
|
||||
controller: function(api) {
|
||||
this.pageClass = 'page-collective';
|
||||
|
||||
api.collective.list(collectiveSortPattern)
|
||||
.success(collective => {
|
||||
this.members = collective;
|
||||
});
|
||||
controller: function() {
|
||||
//api.collective.list(collectiveSortPattern)
|
||||
// .success(collective => {
|
||||
// this.members = collective;
|
||||
// });
|
||||
|
||||
//let rangelen = r => r[1] - r[0];
|
||||
//let interpolate = (r, i) => (i - r[0]) / rangelen(r);
|
||||
|
||||
@@ -1,40 +1,37 @@
|
||||
import template from '../../templates/components/page-documents.html';
|
||||
|
||||
let unique = fn => list => [...new Set(list.map(fn))];
|
||||
import {unique} from '../../utils/common';
|
||||
|
||||
export default function (app) {
|
||||
app.component('pageDocuments', {
|
||||
bindings: {
|
||||
awards: '<',
|
||||
documents: '<'
|
||||
},
|
||||
template: template,
|
||||
controller: function (api) {
|
||||
controllerAs: '$',
|
||||
controller: function () {
|
||||
this.pageClass = 'page-documents';
|
||||
let categories = unique(i => i.category);
|
||||
|
||||
this.collections = [];
|
||||
|
||||
api.document.documents()
|
||||
.success(documents => {
|
||||
let cats = categories(documents)
|
||||
.map(cat => new Object({
|
||||
name: cat,
|
||||
documents: []
|
||||
}));
|
||||
let documents = this.documents;
|
||||
let cats = categories(documents)
|
||||
.map(cat => new Object({
|
||||
name: cat,
|
||||
documents: []
|
||||
}));
|
||||
|
||||
let docCollections = documents.reduce(
|
||||
(cats, doc) => {
|
||||
let c = cats.find(i => i.name === doc.category);
|
||||
c.documents.push(doc);
|
||||
return cats;
|
||||
},
|
||||
cats
|
||||
);
|
||||
let docCollections = documents.reduce(
|
||||
(cats, doc) => {
|
||||
let c = cats.find(i => i.name === doc.category);
|
||||
c.documents.push(doc);
|
||||
return cats;
|
||||
},
|
||||
cats
|
||||
);
|
||||
|
||||
this.collections = this.collections.concat(docCollections);
|
||||
});
|
||||
|
||||
api.document.awards()
|
||||
.success(data => {
|
||||
this.awards = data;
|
||||
});
|
||||
this.collections = this.collections.concat(docCollections);
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -2,16 +2,19 @@ import template from '../../templates/components/page-events.html';
|
||||
|
||||
export default function (app) {
|
||||
app.component('pageEvents', {
|
||||
bindings: {
|
||||
events: '<'
|
||||
},
|
||||
template: template,
|
||||
controllerAs: '$',
|
||||
controller: function (api, menu) {
|
||||
this.pageClass = 'page-events';
|
||||
menu.activate('/events');
|
||||
|
||||
api.event.list()
|
||||
.success(posts => {
|
||||
this.posts = posts;
|
||||
});
|
||||
//api.event.list()
|
||||
// .success(posts => {
|
||||
// this.posts = posts;
|
||||
// });
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -1,27 +1,37 @@
|
||||
import template from '../../templates/components/page-gallery.html';
|
||||
import {branch} from '../../utils/common';
|
||||
|
||||
export default function (app) {
|
||||
let branchYears = branch(
|
||||
i => 'date' in i ? i.date.getFullYear() : 'XXXX'
|
||||
);
|
||||
|
||||
app.component('pageGallery', {
|
||||
bindings: {
|
||||
albums: '<'
|
||||
},
|
||||
template: template,
|
||||
controller: function (api) {
|
||||
controllerAs: '$',
|
||||
controller: function () {
|
||||
this.pageClass = 'page-gallery';
|
||||
|
||||
this.years = [];
|
||||
[2015, 2014, 2013, 2012, 2011, 2010]
|
||||
.forEach((year, year_index) => {
|
||||
api.gallery.year(year)
|
||||
.success(albums => {
|
||||
if (albums.length) {
|
||||
this.years[year_index] = {
|
||||
year: year,
|
||||
albums: albums.map(album => {
|
||||
let preview = album.content[0];
|
||||
album.preview_url = preview.content.medium.url;
|
||||
return album;
|
||||
})
|
||||
};
|
||||
}
|
||||
})
|
||||
let years = branchYears(
|
||||
this.albums
|
||||
.map(i => {
|
||||
i['date'] = new Date(i['date']);
|
||||
return i;
|
||||
})
|
||||
);
|
||||
|
||||
this.collections = Object
|
||||
.keys(years)
|
||||
.map(i => parseInt(i))
|
||||
.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 APISchedule from '../api/APISchedule';
|
||||
import {populate} from '../../utils/populate';
|
||||
import {getCourseNameByID} from '../../models/course';
|
||||
import {indexEquals} 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) {
|
||||
app.component('pageSchedule', {
|
||||
template: template,
|
||||
bindings: {
|
||||
//currentSchedule: '<',
|
||||
schedules: '<'
|
||||
},
|
||||
controller: function($http, $location, $routeParams, api, menu) {
|
||||
this.pageClass = 'page-schedule';
|
||||
menu.activate('/schedule');
|
||||
|
||||
let current_period = $routeParams.period;
|
||||
let current_semester = $routeParams.semester;
|
||||
let isScheduleRequested = current_period && current_semester;
|
||||
const period = $routeParams.period;
|
||||
const semester = $routeParams.semester;
|
||||
const useRoute = period && semester;
|
||||
|
||||
this.schedules = [];
|
||||
let getScheduleByID = (id) => choise(
|
||||
this.schedules,
|
||||
select(i => i._id === id)
|
||||
);
|
||||
|
||||
api.schedule.list()
|
||||
.success(schedules => {
|
||||
// By url params or last element
|
||||
let selector = isScheduleRequested ? isRequested(current_period, current_semester) : indexEquals(schedules.length - 1);
|
||||
|
||||
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));
|
||||
this.loadSchedule = (record, doUpdateURL) => {
|
||||
let id = record._id;
|
||||
let scheduleItem = getScheduleByID(id);
|
||||
if (scheduleItem) {
|
||||
let p = scheduleItem.period;
|
||||
let s = scheduleItem.semester;
|
||||
api.schedule.fetch(p, s, true)
|
||||
.then(i => i.data)
|
||||
.then(i => {
|
||||
this.schedule = i.schedule;
|
||||
if (doUpdateURL) $location.url(APISchedule.buildScheduleUrl(p, s));
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
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 {mobileMatchSelector} from '../config';
|
||||
|
||||
export default function (app) {
|
||||
app.component('pageSchool', {
|
||||
template: template,
|
||||
controllerAs: '$',
|
||||
controller: function() {
|
||||
this.pageClass = 'page-school';
|
||||
this.helloBlock = 'parallax';
|
||||
|
||||
try {
|
||||
if (window.matchMedia(mobileMatchSelector).matches) {
|
||||
this.helloBlock = 'mobile-image';
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
//let fotorama;
|
||||
//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 {mobileMatchSelector} from '../config';
|
||||
|
||||
export default function(app) {
|
||||
app.component('schedule', {
|
||||
@@ -10,11 +11,11 @@ export default function(app) {
|
||||
this.type = 'table';
|
||||
|
||||
try {
|
||||
if (window.matchMedia('(max-device-width: 30em)').matches) {
|
||||
if (window.matchMedia(mobileMatchSelector).matches) {
|
||||
this.type = 'slider';
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
@@ -13,9 +13,9 @@ function week(schedule) {
|
||||
date: dates[i],
|
||||
groups: schedule.map(group => {
|
||||
return {
|
||||
name: group.name,
|
||||
name: group.group,
|
||||
time: group.time,
|
||||
content: group.days[i]
|
||||
content: group.week[i]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,23 +1,29 @@
|
||||
import {splitName} from '../../models/collective';
|
||||
import {stringToBoolean} from '../../utils/string';
|
||||
import template from '../../templates/components/teacher-profile.html';
|
||||
|
||||
export default function (app) {
|
||||
app.component('teacherProfile', {
|
||||
bindings: {
|
||||
member: '='
|
||||
profile: '<',
|
||||
showUrl: '@'
|
||||
},
|
||||
template: template,
|
||||
controllerAs: '$',
|
||||
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.middleName = middle;
|
||||
this.lastName = last;
|
||||
|
||||
if(this.member.picture){
|
||||
this.image = this.member.picture.big;
|
||||
if (this.profile.picture) {
|
||||
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', {
|
||||
template: template,
|
||||
controller: function($timeout, usSpinnerService, io, api){
|
||||
let portion = 0;
|
||||
let count = 10;
|
||||
let skip = 0;
|
||||
let limit = 10;
|
||||
this.feed = [];
|
||||
|
||||
this.timelineUpdating = false;
|
||||
@@ -59,7 +59,7 @@ export default function(app) {
|
||||
this.timelineUpdating = true;
|
||||
usSpinnerService.spin('timelineMore');
|
||||
|
||||
api.news.feed(count, portion)
|
||||
api.timeline.feed(limit, skip)
|
||||
.error(error => {
|
||||
console.log(error);
|
||||
})
|
||||
@@ -72,7 +72,7 @@ export default function(app) {
|
||||
else return post;
|
||||
});
|
||||
|
||||
portion++;
|
||||
skip++;
|
||||
this.feed = this.feed.concat(feed2);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -7,7 +7,7 @@ export default function (app) {
|
||||
},
|
||||
template: template,
|
||||
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;
|
||||
|
||||
export const mobileMatchSelector = '(max-device-width: 30em)';
|
||||
|
||||
export let contacts = {
|
||||
telephone: '+7 (81362) 76-312',
|
||||
email: 'hudozka@gmail.com',
|
||||
@@ -19,47 +21,6 @@ export let collectiveSortPattern = [
|
||||
'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 = {
|
||||
links: {
|
||||
docs: {
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
import {footer} from '../config';
|
||||
import {footer, mobileMatchSelector} from '../config';
|
||||
|
||||
export default function (app) {
|
||||
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.footer = footer;
|
||||
});
|
||||
|
||||
+19
-7
@@ -1,7 +1,8 @@
|
||||
import co from 'co';
|
||||
import {c} from '../core/db';
|
||||
import {getCollective} from './collective';
|
||||
|
||||
import {populate} from '../models/schedule';
|
||||
import {populate, scheduleDate} from '../models/schedule';
|
||||
import {shortifyName} from '../models/collective';
|
||||
import {courses} from '../models/course';
|
||||
|
||||
@@ -15,9 +16,16 @@ export function* getSchedule(period, semester) {
|
||||
}
|
||||
|
||||
export function* getScheduleList() {
|
||||
return yield c('schedules')
|
||||
let list = yield c('schedules')
|
||||
.find({}, {period: 1, semester: 1})
|
||||
.toArray();
|
||||
return list
|
||||
.sort((a, b) => {
|
||||
let ad = scheduleDate(a);
|
||||
let bd = scheduleDate(b);
|
||||
|
||||
return ad.getTime() - bd.getTime();
|
||||
});
|
||||
}
|
||||
|
||||
export function* populateSchedule(schedule) {
|
||||
@@ -30,11 +38,11 @@ export function* populateSchedule(schedule) {
|
||||
let populateLesson = populate(courses);
|
||||
let populateTeacher = populate(collective_dict, i => shortifyName(i));
|
||||
|
||||
return schedule.map(group => {
|
||||
return schedule.map(i => {
|
||||
return {
|
||||
name: group.name,
|
||||
time: group.time,
|
||||
days: group.days.map(record => {
|
||||
group: i.group,
|
||||
time: i.time,
|
||||
week: i.week.map(record => {
|
||||
if (!record) return record;
|
||||
|
||||
let lesson = record.lesson;
|
||||
@@ -44,7 +52,11 @@ export function* populateSchedule(schedule) {
|
||||
return {
|
||||
time: time,
|
||||
lesson: populateLesson(lesson),
|
||||
teacher: populateTeacher(teacher)
|
||||
teacher: {
|
||||
id: teacher,
|
||||
url: `/teacher/${teacher}`,
|
||||
name: populateTeacher(teacher)
|
||||
}
|
||||
};
|
||||
})
|
||||
};
|
||||
|
||||
@@ -27,7 +27,7 @@ function Publisher() {
|
||||
|
||||
return uploadInstagrams(posts)
|
||||
.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) {
|
||||
@@ -91,7 +91,7 @@ function findInstagrams(tag){
|
||||
function uploadInstagrams(list){
|
||||
return Promise.all(
|
||||
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) =>
|
||||
record in dict ? map(dict[record]) : record;
|
||||
|
||||
export const autumnMonth = 8;
|
||||
export const springMonth = 0;
|
||||
|
||||
|
||||
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) {
|
||||
let types = {
|
||||
'document': ['documents', {type: 'document'}, populateDocPreview],
|
||||
'award': ['awards', {}]
|
||||
'award': ['awards', {}, populateDocPreview]
|
||||
};
|
||||
|
||||
if (type in types) {
|
||||
|
||||
+10
-1
@@ -1,14 +1,23 @@
|
||||
import route from 'koa-route';
|
||||
import {c} from '../core/db';
|
||||
import {json} from './';
|
||||
import {sortBy} from '../utils/sort';
|
||||
|
||||
export default function (app) {
|
||||
let sortByDate = sortBy(
|
||||
i => (new Date(i.date))
|
||||
.getTime()
|
||||
);
|
||||
|
||||
app.use(route.get('/events', json(
|
||||
function *() {
|
||||
let query = {};
|
||||
this.body = yield c('events')
|
||||
let events = yield c('events')
|
||||
.find(query)
|
||||
.toArray();
|
||||
|
||||
this.body = events
|
||||
.sort(sortByDate);
|
||||
}
|
||||
)));
|
||||
|
||||
|
||||
+61
-41
@@ -6,47 +6,62 @@ import {json} from './';
|
||||
export default function (app) {
|
||||
app.use(route.get('/gallery', json(
|
||||
function *() {
|
||||
var query = {};
|
||||
var albums = yield c('albums')
|
||||
.find(query)
|
||||
.toArray();
|
||||
let query = {};
|
||||
let fields = ['_id', 'id', 'title', 'date'];
|
||||
//.reduce((f, i) => {
|
||||
// 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')
|
||||
.find(query)
|
||||
.toArray();
|
||||
|
||||
//albums = albums.map(i => {
|
||||
// return fields.reduce((a, key)=> {
|
||||
// a[key] = i[key];
|
||||
// return a;
|
||||
// }, {});
|
||||
//});
|
||||
|
||||
albums = yield albums.map(processAlbum);
|
||||
this.body = albums;
|
||||
}
|
||||
)));
|
||||
|
||||
app.use(route.get('/gallery/:year/:course/:album', json(
|
||||
function *(year, course, album) {
|
||||
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
|
||||
};
|
||||
//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')
|
||||
// .find(query)
|
||||
// .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);
|
||||
this.body = record;
|
||||
}
|
||||
@@ -54,19 +69,24 @@ export default function (app) {
|
||||
};
|
||||
|
||||
let processAlbum = album => co(function *() {
|
||||
album.url = `/gallery/{year}{course}{album}`
|
||||
.replace('{year}', album.date.getFullYear())
|
||||
.replace('{course}', album.course_uri)
|
||||
.replace('{album}', album.uri);
|
||||
//album.url = `/gallery/{year}{course}{album}`
|
||||
// .replace('{year}', album.date.getFullYear())
|
||||
// .replace('{course}', album.course_uri)
|
||||
// .replace('{album}', album.uri);
|
||||
album.url = `/album/${album.id}`;
|
||||
|
||||
album.content = yield album.content.map(product_id => co(function *() {
|
||||
let product = yield c('products').findOne({_id: product_id});
|
||||
if (product) return product;
|
||||
else return null;
|
||||
}));
|
||||
//album.content = yield album.content.map(product_id => co(function *() {
|
||||
// let product = yield c('products').findOne({_id: product_id});
|
||||
// if (product) return product;
|
||||
// else return null;
|
||||
//}));
|
||||
|
||||
let teacher = yield c('collective').findOne({id: album.teacher});
|
||||
album.teacher = teacher.name;
|
||||
//let teacher = yield c('collective').findOne({id: album.teacher});
|
||||
//album.teacher = teacher.name;
|
||||
|
||||
let previewImageId = album.images[0];
|
||||
let image = yield c('images').findOne({_id: previewImageId});
|
||||
album.preview = image.data.medium;
|
||||
|
||||
return album;
|
||||
});
|
||||
+2
-7
@@ -2,14 +2,9 @@ import path from 'path';
|
||||
import fs from 'mz/fs';
|
||||
import config from '../config';
|
||||
|
||||
export function queryObject(){
|
||||
let assign = (dict, key, value) => {
|
||||
dict[key] = value;
|
||||
return dict;
|
||||
};
|
||||
let map = (v, fn) =>
|
||||
value => fn(value) ? v : value;
|
||||
import {map, assign} from '../utils/common';
|
||||
|
||||
export function queryObject() {
|
||||
let toTrue = map(true, i => i === 'true');
|
||||
let toFalse = map(false, i => i === 'false');
|
||||
const processors = [toTrue, toFalse];
|
||||
|
||||
+50
-62
@@ -1,78 +1,75 @@
|
||||
/**
|
||||
* Created by tmshv on 22/11/14.
|
||||
*/
|
||||
import route from 'koa-route';
|
||||
import {accepts, index} from './';
|
||||
import {c} from '../core/db';
|
||||
import {sortBy} from '../utils/sort';
|
||||
|
||||
var route = require("koa-route");
|
||||
var router = require("./");
|
||||
var db = require("../core/db");
|
||||
export default function (app) {
|
||||
let sortNewsByDate = sortBy(
|
||||
i => (new Date(i.date))
|
||||
.getTime()
|
||||
);
|
||||
|
||||
module.exports = function (app) {
|
||||
app.use(route.get("/news", router.accepts({
|
||||
"text/html": function *() {
|
||||
this.redirect("/");
|
||||
app.use(route.get('/news', accepts({
|
||||
'text/html': function *() {
|
||||
this.redirect('/');
|
||||
},
|
||||
"text/plain": function *() {
|
||||
this.redirect("/");
|
||||
'text/plain': function *() {
|
||||
this.redirect('/');
|
||||
},
|
||||
"application/json": function *() {
|
||||
var count = parseInt(this.query["count"]) || 10;
|
||||
var portion = parseInt(this.query["portion"]) || 0;
|
||||
var skip = portion * count;
|
||||
'application/json': function *() {
|
||||
let limit = parseInt(this.query['limit']) || 10;
|
||||
let skip = parseInt(this.query['skip']) || 0;
|
||||
|
||||
var query = {};
|
||||
let query = {};
|
||||
if (this.query.type) query.type = this.query.type;
|
||||
|
||||
var pinned = [];
|
||||
if(portion == 0) {
|
||||
var now = new Date();
|
||||
pinned = yield db.c("posts").find({until: {$gte: now}}).toArray()
|
||||
.then(function (items) {
|
||||
return items.sort(sortNewsByDate);
|
||||
});
|
||||
let pinned = [];
|
||||
if(skip == 0) {
|
||||
const now = new Date();
|
||||
pinned = yield c('timeline')
|
||||
.find({until: {$gte: now}})
|
||||
.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})
|
||||
.skip(skip)
|
||||
.limit(count)
|
||||
.limit(limit)
|
||||
.toArray()
|
||||
.then(function (items) {
|
||||
return items.filter(function (i) {
|
||||
var id = i["_id"]+"";
|
||||
return pinned_ids.indexOf(id) < 0;
|
||||
});
|
||||
});
|
||||
.then(items => items.filter(
|
||||
i => pinnedIds.indexOf(sid(i['_id'])) < 0
|
||||
));
|
||||
|
||||
this.body = pinned.concat(posts);
|
||||
//this.body = pinned_ids
|
||||
}
|
||||
})));
|
||||
|
||||
app.use(route.get("/news/pinned", router.accepts({
|
||||
"text/html": function *() {
|
||||
this.redirect("/");
|
||||
app.use(route.get('/news/pinned', accepts({
|
||||
'text/html': function *() {
|
||||
this.redirect('/');
|
||||
},
|
||||
"text/plain": function *() {
|
||||
this.redirect("/");
|
||||
'text/plain': function *() {
|
||||
this.redirect('/');
|
||||
},
|
||||
"application/json": function *() {
|
||||
var now = new Date();
|
||||
var pinned = yield db.c("posts").find({until: {$gte: now}}).toArray()
|
||||
.then(function (items) {
|
||||
return items.sort(sortNewsByDate);
|
||||
});
|
||||
this.body = pinned;
|
||||
'application/json': function *() {
|
||||
let now = new Date();
|
||||
this.body = yield c('timeline')
|
||||
.find({until: {$gte: now}})
|
||||
.toArray()
|
||||
.then(i => i.sort(sortNewsByDate));
|
||||
}
|
||||
})));
|
||||
|
||||
app.use(route.get("/news/:uri", router.accepts({
|
||||
"text/html": router.index(),
|
||||
"text/plain": router.index(),
|
||||
"application/json": function *(uri) {
|
||||
var item = yield db.c("posts").findOne({uri: uri});
|
||||
app.use(route.get('/news/:id', accepts({
|
||||
'text/html': index(),
|
||||
'text/plain': index(),
|
||||
'application/json': function *(id) {
|
||||
let item = yield c('timeline').findOne({uri: id});
|
||||
if (item) {
|
||||
this.body = item;
|
||||
} 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 error404 from './routes/404';
|
||||
import documents from './routes/documents';
|
||||
import collective from './routes/collective';
|
||||
import teachers from './routes/teachers';
|
||||
import events from './routes/events';
|
||||
|
||||
export const app = koa();
|
||||
@@ -58,5 +58,5 @@ instagram(app);
|
||||
instagramIO(app);
|
||||
documents(app);
|
||||
events(app);
|
||||
app.use(collective());
|
||||
teachers(app);
|
||||
app.use(error404());
|
||||
+1
-14
@@ -1,26 +1,13 @@
|
||||
@import "variables";
|
||||
|
||||
.album-block {
|
||||
width: 100%;
|
||||
margin: 1em auto 2em;
|
||||
//margin: 1em auto 2em;
|
||||
|
||||
h3 {
|
||||
text-align: center;
|
||||
margin: 1.5em 0 1em;
|
||||
}
|
||||
|
||||
.fotorama__nav-wrap {
|
||||
margin: 6em 0 0;
|
||||
}
|
||||
|
||||
.fotorama__stage{
|
||||
overflow: inherit;
|
||||
}
|
||||
|
||||
.fotorama__stage__frame{
|
||||
overflow: inherit;
|
||||
}
|
||||
|
||||
.album {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
@@ -5,5 +5,11 @@
|
||||
}
|
||||
|
||||
.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;
|
||||
flex-wrap: wrap;
|
||||
position: relative;
|
||||
align-items:flex-end;
|
||||
justify-content: center;
|
||||
align-items:flex-start;
|
||||
}
|
||||
|
||||
&__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) {
|
||||
.document {
|
||||
margin: 0 0 $single-margin;
|
||||
margin: 0 $single-margin/2 $single-margin;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
@import "../variables";
|
||||
|
||||
.documents-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
@@ -5,8 +7,7 @@
|
||||
align-items: baseline;
|
||||
}
|
||||
|
||||
@media (max-width: 31.25em) {
|
||||
.documents-block {
|
||||
margin: 1em 0 0;
|
||||
@media (max-width: $mobile-width) {
|
||||
.documents-container {
|
||||
}
|
||||
}
|
||||
@@ -4,10 +4,10 @@
|
||||
margin-bottom: $double-margin;
|
||||
|
||||
&__head {
|
||||
margin-bottom: $small-margin;
|
||||
margin-bottom: 1.25em;
|
||||
|
||||
h3 {
|
||||
font-size: 1.75em;
|
||||
font-size: $big-font-size;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@@ -25,9 +25,27 @@
|
||||
&__body{
|
||||
img {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
//max-height: 100%;
|
||||
|
||||
max-height: 40em;
|
||||
|
||||
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;
|
||||
$percentage: 25%;
|
||||
|
||||
gallery-item {
|
||||
width: $percentage;
|
||||
padding: 0 $double-margin-half;
|
||||
.gallery-item {
|
||||
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%;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: $mobile-width) {
|
||||
.gallery-item {
|
||||
margin: 0 0 1em;
|
||||
margin: 0 0 $double-margin;
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@
|
||||
position: fixed;
|
||||
top: 0;
|
||||
white-space: nowrap;
|
||||
background-color: $darker-color;
|
||||
background-color: rgba(255, 255, 255, 0.95);
|
||||
|
||||
font-size: 1.1em;
|
||||
color: $menu-inactive-item-color;
|
||||
@@ -29,13 +29,15 @@
|
||||
a {
|
||||
text-decoration: none;
|
||||
|
||||
color: $light-color;
|
||||
border-bottom: 1px solid darken($light-color, 50%);
|
||||
color: $dark-color;
|
||||
//border-bottom: 1px solid darken($light-color, 50%);
|
||||
border-bottom: 1px solid lighten($dark-color, 60%);
|
||||
|
||||
&:hover {
|
||||
color: $lighter-color;
|
||||
border-bottom: 1px solid darken($lighter-color, 50%);
|
||||
}
|
||||
//&:hover {
|
||||
// color: $dark-color;
|
||||
//
|
||||
// border-bottom: 1px solid darken($lighter-color, 50%);
|
||||
//}
|
||||
}
|
||||
|
||||
.selected {
|
||||
@@ -43,7 +45,7 @@
|
||||
border-top: $menu-colored-mark-thickness solid $light-color;
|
||||
|
||||
a:link, a:visited {
|
||||
color: $lighter-color;
|
||||
color: $dark-color;
|
||||
text-decoration: none;
|
||||
border-bottom: none;
|
||||
}
|
||||
@@ -74,8 +76,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: $mobile-width) {
|
||||
@media (max-width: $mobile-width) {
|
||||
header{
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.main-menu{
|
||||
background-color: white;
|
||||
}
|
||||
}
|
||||
@@ -19,20 +19,28 @@
|
||||
.navigation__right {
|
||||
color: $light-color;
|
||||
margin-right: 3em;
|
||||
|
||||
z-index:1000;
|
||||
}
|
||||
|
||||
@media (max-width: $mobile-width) {
|
||||
.navigation {
|
||||
overflow: hidden;
|
||||
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
z-index: 100;
|
||||
position: relative;
|
||||
top: 0;
|
||||
|
||||
display: block;
|
||||
//display: flex;
|
||||
//justify-content: flex-start;
|
||||
//align-items: center;
|
||||
}
|
||||
|
||||
.navigation__right {
|
||||
//display: none;
|
||||
margin-right: 0;
|
||||
//margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,4 +8,18 @@
|
||||
&.ng-enter {
|
||||
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 {
|
||||
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;
|
||||
|
||||
h3 {
|
||||
font-size: $big-font-size;
|
||||
font-weight: 200;
|
||||
|
||||
strong {
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
.info {
|
||||
margin-bottom: $single-margin;
|
||||
}
|
||||
a {
|
||||
color: $dark-color;
|
||||
|
||||
.biography {
|
||||
margin-top: $single-margin;
|
||||
|
||||
p{
|
||||
margin-bottom: $single-margin;
|
||||
&:hover{
|
||||
border-bottom-color: lighten($dark-color, 40%);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__position {
|
||||
font-size: $bigger-font-size;
|
||||
}
|
||||
|
||||
&__biography {
|
||||
margin-top: $double-margin;
|
||||
|
||||
p {
|
||||
margin-bottom: $single-margin;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: $mobile-width) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
@import "components/album-collection";
|
||||
@import "components/gallery-item";
|
||||
@import "components/document";
|
||||
@import "components/documents-container";
|
||||
@import "components/teacher-proifile";
|
||||
@import "components/main-menu";
|
||||
@import "components/navigation";
|
||||
@@ -12,6 +13,8 @@
|
||||
@import "components/schedule-table";
|
||||
@import "components/footer-links";
|
||||
@import "components/event-post";
|
||||
@import "components/album";
|
||||
@import "components/parallax";
|
||||
|
||||
@import "components/page-school";
|
||||
@import "components/page-schedule";
|
||||
@@ -23,8 +26,6 @@
|
||||
@import "content";
|
||||
@import "page-animation";
|
||||
|
||||
@import "documents";
|
||||
@import "album";
|
||||
@import "schedule-selector";
|
||||
@import "schedule-mobile";
|
||||
@import "error-404";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="album-collection">
|
||||
<h2 class="album-collection__title">{{$ctrl.title}}</h2>
|
||||
<h2 class="album-collection__title">{{$.title}}</h2>
|
||||
<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>
|
||||
@@ -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">
|
||||
<a href="{{$ctrl.document.thumbs.original.url}}" target="_blank">
|
||||
<img ng-src="{{$ctrl.document.thumbs.medium.url}}">
|
||||
</a>
|
||||
<div class="document__image">
|
||||
<a href="{{$.document.url}}" target="_blank" class="invisible">
|
||||
<img ng-src="{{$.document.preview.data.small.url}}">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,8 +1,8 @@
|
||||
<div class="event-post">
|
||||
<div class="event-post__head">
|
||||
<article class="event-post">
|
||||
<header class="event-post__head">
|
||||
<a href="{{$.url}}"><h3>{{$.post.title}}</h3></a>
|
||||
<p class="date">{{$.post.date | date : "dd.MM.yyyy"}}</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="event-post__body" ng-bind-html="$.message"></div>
|
||||
</div>
|
||||
</article>
|
||||
@@ -1,9 +1,6 @@
|
||||
<div class="gallery-item">
|
||||
<h3>
|
||||
<a href="{{$ctrl.record.url}}">{{$ctrl.record.title}}</a>
|
||||
</h3>
|
||||
<a href="{{$ctrl.record.url}}" class="invisible">
|
||||
<img ng-src="{{$ctrl.record.preview_url}}" alt="{{$ctrl.record.title}}"/>
|
||||
<a href="{{$.record.url}}">
|
||||
<h3>{{$.record.title}}</h3>
|
||||
<img ng-src="{{$.previewImage}}" alt="{{$.record.title}}"/>
|
||||
</a>
|
||||
<p>{{$ctrl.record.course}}</p>
|
||||
</div>
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="navigation">
|
||||
<main-menu items="$ctrl.menu"></main-menu>
|
||||
<main-menu items="$.menu"></main-menu>
|
||||
|
||||
<div class="navigation__right">
|
||||
<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">
|
||||
<!--<img ng-style="$ctrl.imageStyle" class="collective-image" src="https://static.shlisselburg.org/art/collective/collective.jpg" alt="">-->
|
||||
<!--<div class="page-collective__body content content_semi-wide content_down-screen content_padding">-->
|
||||
<div class="content content_semi-wide">
|
||||
<teacher-profile ng-repeat="person in $ctrl.members track by $index" member="person"></teacher-profile>
|
||||
<img class="page-collective__collective-image"
|
||||
width="100%"
|
||||
src="https://static.shlisselburg.org/art/graphics/collective.jpg">
|
||||
|
||||
<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>
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="content content_wide">
|
||||
<div ng-repeat="c in $ctrl.collections">
|
||||
<div class="content content_wide content--padding-top--menu">
|
||||
<div ng-repeat="c in $.collections">
|
||||
<h2>{{c.name}}</h2>
|
||||
|
||||
<div class="documents-container">
|
||||
@@ -9,6 +9,6 @@
|
||||
|
||||
<h2>Награды</h2>
|
||||
<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>
|
||||
@@ -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>
|
||||
</div>
|
||||
</section>
|
||||
@@ -1,3 +1,3 @@
|
||||
<div class="content content_thin content--padding-top--double">
|
||||
<event-post ng-repeat="i in $.posts" post="i"></event-post>
|
||||
</div>
|
||||
<section class="content content_thin content--padding-top--menu">
|
||||
<event-post ng-repeat="i in $.events" post="i"></event-post>
|
||||
</section>
|
||||
@@ -1,5 +1,7 @@
|
||||
<div class="content content_wide">
|
||||
<album-collection ng-repeat="i in $ctrl.years"
|
||||
title="{{i.year}}" albums="i.albums"
|
||||
<div class="content content_wide content--padding-top--menu">
|
||||
<album-collection
|
||||
ng-repeat="i in $.collections"
|
||||
title="{{i.title}}"
|
||||
albums="i.albums"
|
||||
></album-collection>
|
||||
</div>
|
||||
@@ -1,13 +1,13 @@
|
||||
<div class="content content_wide">
|
||||
<div class="content content_wide content--padding-top--menu">
|
||||
<div class="schedule-selector">
|
||||
<label> Семестр
|
||||
<select
|
||||
ng-model="$ctrl.currentSchedule"
|
||||
ng-change="$ctrl.loadSchedule($ctrl.currentSchedule, true)"
|
||||
ng-options="s.text for s in $ctrl.schedules">
|
||||
ng-model="$ctrl.currentSchedule"
|
||||
ng-change="$ctrl.loadSchedule($ctrl.currentSchedule, true)"
|
||||
ng-options="s.text for s in $ctrl.schedules">
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<schedule schedule="$ctrl.schedule"></schedule>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,8 +1,14 @@
|
||||
<div class="content content_full">
|
||||
<img src="https://static.shlisselburg.org/art/graphics/entrance.jpg" width="100%">
|
||||
<div class="content content_full" ng-switch="$.helloBlock">
|
||||
<img ng-switch-when="mobile-image"
|
||||
src="https://static.shlisselburg.org/art/graphics/entrance.jpg" width="100%">
|
||||
<parallax ng-switch-default></parallax>
|
||||
</div>
|
||||
|
||||
<div class="content content_thin">
|
||||
<div class="hudozka-title">
|
||||
<p>МБОУДОД</p>
|
||||
<h1>Шлиссельбургская детская художественная школа</h1>
|
||||
</div>
|
||||
<!--<div class="main-block">-->
|
||||
<!--<div>-->
|
||||
<!--<!–<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__main">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
@@ -28,17 +28,22 @@
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<p class="name">{{group.name}}</p>
|
||||
<p class="time">{{group.time}}</p>
|
||||
<p class="name">{{i.group}}</p>
|
||||
<p class="time">{{i.time}}</p>
|
||||
</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="teacher"><a href="">{{day.teacher}}</a></p>
|
||||
<p class="time">{{day.time[0] | join: '—'}}</p>
|
||||
<p class="time">{{day.time[1] | join: '—'}}</p>
|
||||
<p class="teacher"><a href="{{day.teacher.url}}">{{day.teacher.name}}</a></p>
|
||||
<p class="time" ng-repeat="time in day.time">{{time}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
<div class="teacher-profile">
|
||||
<div class="teacher-profile__picture">
|
||||
<img ng-src="{{$ctrl.image.url}}" >
|
||||
<img ng-src="{{$.image.url}}" >
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<p><strong>{{$ctrl.member.position}}</strong></p>
|
||||
<p>{{$ctrl.member.status}}</p>
|
||||
<p>Образование: {{$ctrl.member.edu}}</p>
|
||||
<p>Диплом: {{$ctrl.member.diploma}}</p>
|
||||
<div>
|
||||
<p class="teacher-profile__position"><i><strong>{{$.profile.position}}</strong></i></p>
|
||||
<p>{{$.profile.status}}</p>
|
||||
<p>Образование: {{$.profile.edu}}</p>
|
||||
<p>Диплом: <i>{{$.profile.diploma}}</i></p>
|
||||
</div>
|
||||
|
||||
<div class="biography" ng-bind-html="$ctrl.biography"></div>
|
||||
<div class="teacher-profile__biography" ng-bind-html="$.biography"></div>
|
||||
</div>
|
||||
</div>
|
||||
+10
-3
@@ -46,13 +46,20 @@
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-wrapper" ng-controller="AppController">
|
||||
<header>
|
||||
<header ng-switch="navigation">
|
||||
<main-menu items="menuProvider"></main-menu>
|
||||
<!--<navigation menu="menuProvider"></navigation>-->
|
||||
</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="page {{pageClass}}" ng-view autoscroll="true"></div>
|
||||
<ng-view class="page" autoscroll></ng-view>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
|
||||
Reference in new issue
Block a user