+ PageGalleryAlbum component
This commit is contained in:
1 parent
c3d0ab56bc
commit
bbd4987359
5 files changed
+51
-49
No files matched your search
+2
-6
@@ -20,9 +20,9 @@ import PageSchool from './components/PageSchool';
|
||||
import PageSchedule from './components/PageSchedule';
|
||||
import PageCollective from './components/PageCollective';
|
||||
import PageGallery from './components/PageGallery';
|
||||
import PageGalleryAlbum from './components/PageGalleryAlbum';
|
||||
|
||||
import AppController from './controllers/AppController';
|
||||
import AlbumController from './controllers/AlbumController';
|
||||
import DocumentsController from './controllers/DocumentsController';
|
||||
import CopyrightController from './controllers/CopyrightController';
|
||||
import ContactsController from './controllers/ContactsController';
|
||||
@@ -94,8 +94,8 @@ app.run(($location, $rootScope, $http) => {
|
||||
PageSchedule,
|
||||
PageCollective,
|
||||
PageGallery,
|
||||
PageGalleryAlbum,
|
||||
AppController,
|
||||
AlbumController,
|
||||
DocumentsController,
|
||||
CopyrightController,
|
||||
ContactsController,
|
||||
@@ -106,10 +106,6 @@ app.run(($location, $rootScope, $http) => {
|
||||
ScheduleRecord,
|
||||
FooterLinks,
|
||||
function (app) {
|
||||
app.controller('AlbumPageController', ($scope) => {
|
||||
$scope.pageClass = 'page-album';
|
||||
});
|
||||
|
||||
app.controller('DocumentsPageController', ($scope) => {
|
||||
$scope.pageClass = 'page-documents';
|
||||
});
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
import template from '../../templates/components/page-gallery.html';
|
||||
|
||||
export default function (app) {
|
||||
app.component('pageGalleryAlbum', {
|
||||
template: template,
|
||||
controller: function ($rootScope, $routeParams, api, menu) {
|
||||
this.pageClass = 'page-gallery-album';
|
||||
|
||||
menu.activate('/gallery');
|
||||
|
||||
let year_uri = $routeParams.year;
|
||||
let course_uri = $routeParams.course;
|
||||
let album_uri = $routeParams.album;
|
||||
|
||||
api.gallery.album(year_uri, course_uri, album_uri)
|
||||
.success(album => {
|
||||
//album.teacherName = team.name(album['teacher']);
|
||||
album.teacherName = album['teacher'];
|
||||
|
||||
this.album = album;
|
||||
this.crumbs = [
|
||||
{
|
||||
url: '/gallery',
|
||||
name: 'Галерея'
|
||||
},
|
||||
{
|
||||
name: year_uri
|
||||
},
|
||||
{
|
||||
name: album.course
|
||||
},
|
||||
{
|
||||
name: album.title
|
||||
}
|
||||
];
|
||||
$rootScope.title = album.title;
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -42,8 +42,7 @@ export let routes = [
|
||||
},
|
||||
{
|
||||
name: '/gallery/:year/:course/:album',
|
||||
templateUrl: '/views/gallery-album.html',
|
||||
controller: 'AlbumPageController'
|
||||
template: '<page-gallery-album></page-gallery-album>'
|
||||
},
|
||||
{
|
||||
name: '/documents',
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
export default function (app) {
|
||||
app.controller('AlbumController', ($scope, $rootScope, $http, $routeParams, api, menu) => {
|
||||
menu.activate('/gallery');
|
||||
|
||||
let year_uri = $routeParams.year;
|
||||
let course_uri = $routeParams.course;
|
||||
let album_uri = $routeParams.album;
|
||||
|
||||
api.gallery.album(year_uri, course_uri, album_uri)
|
||||
.success(album => {
|
||||
//album.teacherName = team.name(album['teacher']);
|
||||
album.teacherName = album['teacher'];
|
||||
|
||||
$scope.album = album;
|
||||
$scope.crumbs = [
|
||||
{
|
||||
url: '/gallery',
|
||||
name: 'Галерея'
|
||||
},
|
||||
{
|
||||
name: year_uri
|
||||
},
|
||||
{
|
||||
name: album.course
|
||||
},
|
||||
{
|
||||
name: album.title
|
||||
}
|
||||
];
|
||||
$rootScope.title = album.title;
|
||||
});
|
||||
});
|
||||
};
|
||||
Reference in new issue
Block a user