gallery breadcrumbs;
This commit is contained in:
1 parent
acfecbc0b9
commit
d485ec7880
2 files changed
+35
-8
No files matched your search
+29
-7
@@ -34,7 +34,7 @@ module.exports = function (app) {
|
|||||||
years.forEach(function (year, year_index) {
|
years.forEach(function (year, year_index) {
|
||||||
api.gallery.year(year)
|
api.gallery.year(year)
|
||||||
.success(function (albums) {
|
.success(function (albums) {
|
||||||
if(albums.length) {
|
if (albums.length) {
|
||||||
$scope.years[year_index] = {
|
$scope.years[year_index] = {
|
||||||
year: year,
|
year: year,
|
||||||
albums: albums.map(function (album) {
|
albums: albums.map(function (album) {
|
||||||
@@ -54,17 +54,39 @@ module.exports = function (app) {
|
|||||||
app.controller("AlbumPageController", function ($scope, $http, $routeParams, api, menu) {
|
app.controller("AlbumPageController", function ($scope, $http, $routeParams, api, menu) {
|
||||||
menu.activate('/gallery');
|
menu.activate('/gallery');
|
||||||
|
|
||||||
|
var year_uri = $routeParams.year;
|
||||||
|
var course_uri = $routeParams.course;
|
||||||
|
var album_uri = $routeParams.album;
|
||||||
api.gallery.album(
|
api.gallery.album(
|
||||||
$routeParams.year,
|
year_uri,
|
||||||
$routeParams.course,
|
course_uri,
|
||||||
$routeParams.album
|
album_uri
|
||||||
)
|
)
|
||||||
.success(function (album) {
|
.success(function (album) {
|
||||||
var preview = album.content[0];
|
//var preview = album.content[0];
|
||||||
album.preview_url = preview.content.medium.url;
|
//album.preview_url = preview.content.medium.url;
|
||||||
//album.fotorama = album.content.map(productToFotorama);
|
//album.fotorama = album.content.map(productToFotorama);
|
||||||
|
|
||||||
$scope.album = album;
|
$scope.album = album;
|
||||||
|
$scope.crumbs = [
|
||||||
|
{
|
||||||
|
url: '/gallery',
|
||||||
|
name: 'Галерея'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: '/gallery/{year}'.replace('{year}', year_uri),
|
||||||
|
name: year_uri
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: '/gallery/{year}/{course}'
|
||||||
|
.replace('{year}', year_uri)
|
||||||
|
.replace('{course}', course_uri),
|
||||||
|
name: album.course
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: album.title
|
||||||
|
}
|
||||||
|
];
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -75,7 +97,7 @@ function productToFotorama(product) {
|
|||||||
var $e = $('<div class="album-item"><div></div></div>');
|
var $e = $('<div class="album-item"><div></div></div>');
|
||||||
var $c = $e.find('.album-item div');
|
var $c = $e.find('.album-item div');
|
||||||
$('<p></p>').text(product.author).appendTo($c);
|
$('<p></p>').text(product.author).appendTo($c);
|
||||||
if(product['authorAge']) {
|
if (product['authorAge']) {
|
||||||
$('<p></p>').text(product['authorAge'] + ' лет').appendTo($c);
|
$('<p></p>').text(product['authorAge'] + ' лет').appendTo($c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,19 @@
|
|||||||
|
<breadcrumbs crumbs="crumbs"></breadcrumbs>
|
||||||
|
|
||||||
<div class="album-block" ng-controller="AlbumPageController">
|
<div class="album-block" ng-controller="AlbumPageController">
|
||||||
<h3>{{album.title}}</h3>
|
<h3>{{album.title}}</h3>
|
||||||
<!--<div g-fotorama="album.fotorama"></div>-->
|
<!--<div g-fotorama="album.fotorama"></div>-->
|
||||||
|
|
||||||
<div class="album">
|
<div class="album">
|
||||||
<div class="album-item" ng-repeat="product in album.content">
|
<div class="album-item" ng-repeat="product in 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">
|
||||||
<div>
|
<div>
|
||||||
<p ng-show="product.title" class="title">{{product.title | removeNewline}}</p>
|
<p ng-show="product.title" class="title">{{product.title | removeNewline}}</p>
|
||||||
|
|
||||||
<p>{{product.author}}</p>
|
<p>{{product.author}}</p>
|
||||||
|
|
||||||
<p ng-show="product.authorAge">{{product.authorAge}} лет</p>
|
<p ng-show="product.authorAge">{{product.authorAge}} лет</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in new issue
Block a user