+ PageGalleryAlbum component

This commit is contained in:
tmshv committed 2016-02-25 19:01:34 +03:00
1 parent c3d0ab56bc
commit bbd4987359
5 files changed
+51 -49

No files matched your search

+2 -6
View File
@@ -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';
});
+40
View File
@@ -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;
});
}
});
};
+1 -2
View File
@@ -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',
-33
View File
@@ -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;
});
});
};
@@ -1,17 +1,17 @@
<div class="content content_semi-wide" ng-controller="AlbumController">
<breadcrumbs crumbs="crumbs"></breadcrumbs>
<div class="content content_semi-wide">
<breadcrumbs crumbs="$ctrl.crumbs"></breadcrumbs>
<div class="album-block">
<h3>{{album.title}}</h3>
<h3>{{$ctrl.album.title}}</h3>
<div class="album" ng-show="album">
<div class="album" ng-show="$ctrl.album">
<div class="album-info">
<p>Предмет: {{album.course}}</p>
<p>Преподаватель: {{album.teacherName}}</p>
<p class="description" ng-show="album.description">{{album.description}}</p>
<p>Предмет: {{$ctrl.album.course}}</p>
<p>Преподаватель: {{$ctrl.album.teacherName}}</p>
<p class="description" ng-show="$ctrl.album.description">{{$ctrl.album.description}}</p>
</div>
<div class="album-item" ng-repeat="product in album.content">
<div class="album-item" ng-repeat="product in $ctrl.album.content">
<img ng-src="{{product.content.big.url}}" alt=""/>
<div class="product-info">