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) {
|
||||
api.gallery.year(year)
|
||||
.success(function (albums) {
|
||||
if(albums.length) {
|
||||
if (albums.length) {
|
||||
$scope.years[year_index] = {
|
||||
year: year,
|
||||
albums: albums.map(function (album) {
|
||||
@@ -54,17 +54,39 @@ module.exports = function (app) {
|
||||
app.controller("AlbumPageController", function ($scope, $http, $routeParams, api, menu) {
|
||||
menu.activate('/gallery');
|
||||
|
||||
var year_uri = $routeParams.year;
|
||||
var course_uri = $routeParams.course;
|
||||
var album_uri = $routeParams.album;
|
||||
api.gallery.album(
|
||||
$routeParams.year,
|
||||
$routeParams.course,
|
||||
$routeParams.album
|
||||
year_uri,
|
||||
course_uri,
|
||||
album_uri
|
||||
)
|
||||
.success(function (album) {
|
||||
var preview = album.content[0];
|
||||
album.preview_url = preview.content.medium.url;
|
||||
//var preview = album.content[0];
|
||||
//album.preview_url = preview.content.medium.url;
|
||||
//album.fotorama = album.content.map(productToFotorama);
|
||||
|
||||
$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 $c = $e.find('.album-item div');
|
||||
$('<p></p>').text(product.author).appendTo($c);
|
||||
if(product['authorAge']) {
|
||||
if (product['authorAge']) {
|
||||
$('<p></p>').text(product['authorAge'] + ' лет').appendTo($c);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
<breadcrumbs crumbs="crumbs"></breadcrumbs>
|
||||
|
||||
<div class="album-block" ng-controller="AlbumPageController">
|
||||
<h3>{{album.title}}</h3>
|
||||
<!--<div g-fotorama="album.fotorama"></div>-->
|
||||
|
||||
|
||||
<div class="album">
|
||||
<div class="album-item" ng-repeat="product in album.content">
|
||||
<img ng-src="{{product.content.big.url}}" alt=""/>
|
||||
|
||||
<div class="product-info">
|
||||
<div>
|
||||
<p ng-show="product.title" class="title">{{product.title | removeNewline}}</p>
|
||||
|
||||
<p>{{product.author}}</p>
|
||||
|
||||
<p ng-show="product.authorAge">{{product.authorAge}} лет</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user