+ 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 PageSchedule from './components/PageSchedule';
|
||||||
import PageCollective from './components/PageCollective';
|
import PageCollective from './components/PageCollective';
|
||||||
import PageGallery from './components/PageGallery';
|
import PageGallery from './components/PageGallery';
|
||||||
|
import PageGalleryAlbum from './components/PageGalleryAlbum';
|
||||||
|
|
||||||
import AppController from './controllers/AppController';
|
import AppController from './controllers/AppController';
|
||||||
import AlbumController from './controllers/AlbumController';
|
|
||||||
import DocumentsController from './controllers/DocumentsController';
|
import DocumentsController from './controllers/DocumentsController';
|
||||||
import CopyrightController from './controllers/CopyrightController';
|
import CopyrightController from './controllers/CopyrightController';
|
||||||
import ContactsController from './controllers/ContactsController';
|
import ContactsController from './controllers/ContactsController';
|
||||||
@@ -94,8 +94,8 @@ app.run(($location, $rootScope, $http) => {
|
|||||||
PageSchedule,
|
PageSchedule,
|
||||||
PageCollective,
|
PageCollective,
|
||||||
PageGallery,
|
PageGallery,
|
||||||
|
PageGalleryAlbum,
|
||||||
AppController,
|
AppController,
|
||||||
AlbumController,
|
|
||||||
DocumentsController,
|
DocumentsController,
|
||||||
CopyrightController,
|
CopyrightController,
|
||||||
ContactsController,
|
ContactsController,
|
||||||
@@ -106,10 +106,6 @@ app.run(($location, $rootScope, $http) => {
|
|||||||
ScheduleRecord,
|
ScheduleRecord,
|
||||||
FooterLinks,
|
FooterLinks,
|
||||||
function (app) {
|
function (app) {
|
||||||
app.controller('AlbumPageController', ($scope) => {
|
|
||||||
$scope.pageClass = 'page-album';
|
|
||||||
});
|
|
||||||
|
|
||||||
app.controller('DocumentsPageController', ($scope) => {
|
app.controller('DocumentsPageController', ($scope) => {
|
||||||
$scope.pageClass = 'page-documents';
|
$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',
|
name: '/gallery/:year/:course/:album',
|
||||||
templateUrl: '/views/gallery-album.html',
|
template: '<page-gallery-album></page-gallery-album>'
|
||||||
controller: 'AlbumPageController'
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '/documents',
|
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;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
+8
-8
@@ -1,17 +1,17 @@
|
|||||||
<div class="content content_semi-wide" ng-controller="AlbumController">
|
<div class="content content_semi-wide">
|
||||||
<breadcrumbs crumbs="crumbs"></breadcrumbs>
|
<breadcrumbs crumbs="$ctrl.crumbs"></breadcrumbs>
|
||||||
|
|
||||||
<div class="album-block">
|
<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">
|
<div class="album-info">
|
||||||
<p>Предмет: {{album.course}}</p>
|
<p>Предмет: {{$ctrl.album.course}}</p>
|
||||||
<p>Преподаватель: {{album.teacherName}}</p>
|
<p>Преподаватель: {{$ctrl.album.teacherName}}</p>
|
||||||
<p class="description" ng-show="album.description">{{album.description}}</p>
|
<p class="description" ng-show="$ctrl.album.description">{{$ctrl.album.description}}</p>
|
||||||
</div>
|
</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=""/>
|
<img ng-src="{{product.content.big.url}}" alt=""/>
|
||||||
|
|
||||||
<div class="product-info">
|
<div class="product-info">
|
||||||
Reference in new issue
Block a user