+ CLOUD PAGES; style updated; other changes

This commit is contained in:
tmshv committed 2016-11-12 05:17:10 +03:00
1 parent dad12f52f4
commit edf5fbf4bd
27 files changed
+339 -161

No files matched your search

+2
View File
@@ -5,6 +5,7 @@ import APITeacher from './APITeacher';
import APISchedule from './APISchedule';
import APIEvent from './APIEvent';
import APIArticle from './APIArticle';
import APIPage from './APIPage';
export default class API {
constructor(request) {
@@ -15,5 +16,6 @@ export default class API {
this.schedule = new APISchedule(request);
this.event = new APIEvent(request);
this.article = new APIArticle(request);
this.page = new APIPage(request);
}
}
+7
View File
@@ -0,0 +1,7 @@
import EndPoint from './EndPoint';
export default class APIPage extends EndPoint {
url(url) {
return this.get(url);
}
}
+19
View File
@@ -1,3 +1,4 @@
import {getInitialData} from './core/init';
import Navigation from './components/Navigation';
import MainMenu from './components/MainMenu';
import Breadcrumbs from './components/Breadcrumbs';
@@ -20,6 +21,7 @@ import ArticlePageControl from './components/ArticlePageControl';
import Album from './components/Album';
import Parallax from './components/Parallax';
import Page from './components/CloudPage';
import PageSchool from './components/PageSchool';
import PageEvents from './components/PageEvents';
import PageArticle from './components/PageArticle';
@@ -61,6 +63,21 @@ app.config(($locationProvider, $routeProvider) => {
$locationProvider.hashPrefix('!');
$locationProvider.html5Mode(true);
const pages = getInitialData().pages
.map(i => i.url)
.map(i => ({
name: i,
template: '<cloud-page data="$.data"></cloud-page>',
resolveAs: '$',
resolve: {
data: (api) => {
return api.page
.url(location.pathname)
.then(i => i.data)
}
}
}));
let routers = [
{
name: '/',
@@ -191,6 +208,7 @@ app.config(($locationProvider, $routeProvider) => {
}
}
]
.concat(pages)
.map(i => {
let path = i.name;
delete i.name;
@@ -264,6 +282,7 @@ app.run(($location, $rootScope, $http) => {
GalleryItem,
AlbumCollection,
TeacherProfile,
Page,
PageSchool,
PageArticle,
PageEvents,
+15
View File
@@ -0,0 +1,15 @@
import template from '../../templates/components/cloud-page.html';
export default function (app) {
app.component('cloudPage', {
bindings: {
page: '<data'
},
template: template,
controllerAs: '$',
controller: function ($rootScope, $sce) {
if (this.page) $rootScope.title = this.page.title;
this.content = $sce.trustAsHtml(this.page.data);
}
});
};
-32
View File
@@ -40,38 +40,6 @@ export const footer = {
{url: '/document/VAT', link: 'ИНН'},
{url: '/document/statue-2013', link: 'Устав школы'}
]
},
sites: {
title: 'Ссылки на образовательные сайты',
links: [
{
url: 'http://минобрнауки.рф',
link: 'минобрнауки.рф',
description: 'Министерство образования и науки Российской Федерации'
},
{url: 'http://edu.ru', link: 'edu.ru', description: 'Федеральный сайт «Российское образование»'},
{
url: 'http://window.edu.ru',
link: 'window.edu.ru',
description: 'Единое окно доступа к образовательным ресурсам'
},
{
url: 'http://school-collection.edu.ru',
link: 'school-collection.edu.ru',
description: 'Единая коллекция цифровых образовательных ресурсов'
},
{
url: 'http://fcior.edu.ru',
link: 'fcior.edu.ru',
description: 'Федеральный центр информационных образовательных ресурсов'
},
{url: 'http://dkhshmga.ru', link: 'dkhshmga.ru', description: 'Художественная школа Мги'},
{
url: 'http://kirovskdmh.ucoz.ru',
link: 'kirovskdmh.ucoz.ru',
description: 'Музыкальная школа Кировска'
}
]
}
}
};
+3
View File
@@ -0,0 +1,3 @@
export function getInitialData(){
return window.hudozka;
}