Adds a basic modal for <album> directive
This commit is contained in:
@@ -31,6 +31,10 @@ body > .container-fluid {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.album a {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
.cover-container {
|
.cover-container {
|
||||||
width:100%;
|
width:100%;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@@ -53,7 +57,30 @@ body > .container-fluid {
|
|||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cover-container .cover .rating {
|
||||||
|
position: absolute;
|
||||||
|
bottom:0px;
|
||||||
|
right:0px;
|
||||||
|
width:100%;
|
||||||
|
background-color: rgba(255,255,255,0.4);
|
||||||
|
text-align:right;
|
||||||
|
padding:5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.album-ellipsis {
|
||||||
|
}
|
||||||
|
|
||||||
|
.album .album-ellipsis p{
|
||||||
|
width:100%;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow:ellipsis;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.album .album-ellipsis p:last-child{
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
/* @media (max-width: 767px) { */
|
/* @media (max-width: 767px) { */
|
||||||
/* .album { */
|
/* .album { */
|
||||||
/* height: 50vw; */
|
/* height: 50vw; */
|
||||||
|
|||||||
10
webapp/html/albumModal.html
Normal file
10
webapp/html/albumModal.html
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<div class="modal-header">
|
||||||
|
<h3 class="modal-title" ng-if="album.serieDisplay.length > 0">{{album.serieDisplay}}: {{album.titleDisplay}}</h3>
|
||||||
|
<h3 class="modal-title" ng-if="album.serieDisplay.length == 0">{{album.titleDisplay}}</h3>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
Mais bite quoi
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button class="btn btn-primary" type="button" ng-click="ok()">OK</button>
|
||||||
|
</div>
|
||||||
@@ -1,4 +1,7 @@
|
|||||||
var directives = angular.module('satbd.satellite.bar.directives',[])
|
var directives = angular.module('satbd.satellite.bar.directives',[
|
||||||
|
'ui.bootstrap',
|
||||||
|
'ngAnimate'
|
||||||
|
])
|
||||||
|
|
||||||
directives.directive('album', function() {
|
directives.directive('album', function() {
|
||||||
return {
|
return {
|
||||||
@@ -11,11 +14,32 @@ directives.directive('album', function() {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
directives.controller('AlbumCtrl', function($scope,$http,$log,albumService) {
|
directives.controller('AlbumCtrl', function($scope,$http,$log,$uibModal,albumService) {
|
||||||
|
$scope.album = { Note:-1};
|
||||||
albumService.get($scope.id)
|
albumService.get($scope.id)
|
||||||
.then(function(data) {
|
.then(function(data) {
|
||||||
$scope.album = data;
|
$scope.album = data;
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
$log.error('Could not fetch album' + $scope.id + ' :' + err);
|
$log.error('Could not fetch album' + $scope.id + ' :' + err);
|
||||||
});
|
});
|
||||||
|
$scope.openAlbumModal = function() {
|
||||||
|
var albumModalInstance = $uibModal.open({
|
||||||
|
templateUrl: 'html/albumModal.html',
|
||||||
|
controller: 'AlbumModalInstanceCtrl',
|
||||||
|
size: 'lg',
|
||||||
|
keyboard: true,
|
||||||
|
resolve: {
|
||||||
|
album: function() {
|
||||||
|
return $scope.album;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
directives.controller('AlbumModalInstanceCtrl', function($scope,$uibModalInstance,album) {
|
||||||
|
$scope.album = album;
|
||||||
|
$scope.ok = function() {
|
||||||
|
$uibModalInstance.close('');
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,7 +1,14 @@
|
|||||||
<div class="cover-container">
|
<a href="" ng-click="openAlbumModal()">
|
||||||
<div class="cover">
|
<div class="cover-container">
|
||||||
<img class="img-responsive img-album-cover" alt="{{album.titre}}" ng-src="{{album.CoverURL}}"/>
|
<div class="cover">
|
||||||
|
<img class="img-responsive img-rounded" alt="{{album.titre}}" ng-src="{{album.CoverURL}}"/>
|
||||||
|
<div class="rating">
|
||||||
|
<uib-rating ng-model="album.Note" readonly="true"></uib-rating>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="album-ellipsis">
|
||||||
<p>{{album.serie}}</p>
|
<p>{{album.serieDisplay || '-'}}</p>
|
||||||
|
<p>{{album.titleDisplay}}</p>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<h1> Albums Récents </h1>
|
<h1> Albums Récents </h1>
|
||||||
|
|
||||||
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2" ng-repeat="id in albumIDs">
|
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2 album" ng-repeat="id in albumIDs">
|
||||||
<album album-id="id"></album>
|
<album album-id="id"> </album>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user