diff --git a/src/client/app.js b/src/client/app.js
index 73cf88a1..dab66fb4 100644
--- a/src/client/app.js
+++ b/src/client/app.js
@@ -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';
});
diff --git a/src/client/components/PageGalleryAlbum.js b/src/client/components/PageGalleryAlbum.js
new file mode 100644
index 00000000..320c70cc
--- /dev/null
+++ b/src/client/components/PageGalleryAlbum.js
@@ -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;
+ });
+ }
+ });
+};
\ No newline at end of file
diff --git a/src/client/config.js b/src/client/config.js
index ddabb0a1..080a9bbd 100644
--- a/src/client/config.js
+++ b/src/client/config.js
@@ -42,8 +42,7 @@ export let routes = [
},
{
name: '/gallery/:year/:course/:album',
- templateUrl: '/views/gallery-album.html',
- controller: 'AlbumPageController'
+ template: '
Предмет: {{album.course}}
-Преподаватель: {{album.teacherName}}
-{{album.description}}
+Предмет: {{$ctrl.album.course}}
+Преподаватель: {{$ctrl.album.teacherName}}
+{{$ctrl.album.description}}