diff --git a/app/models/Entities/Favourite.php b/app/models/Entities/Favourite.php
index aa66d420..8d85cb50 100644
--- a/app/models/Entities/Favourite.php
+++ b/app/models/Entities/Favourite.php
@@ -11,19 +11,19 @@
|--------------------------------------------------------------------------
*/
- public function user(){
+ public function user() {
return $this->belongsTo('Entities\User');
}
- public function track(){
+ public function track() {
return $this->belongsTo('Entities\Track');
}
- public function album(){
+ public function album() {
return $this->belongsTo('Entities\Album');
}
- public function playlist(){
+ public function playlist() {
return $this->belongsTo('Entities\Playlist');
}
diff --git a/app/views/shared/_app_layout.blade.php b/app/views/shared/_app_layout.blade.php
index 7d086eaa..2cebb864 100644
--- a/app/views/shared/_app_layout.blade.php
+++ b/app/views/shared/_app_layout.blade.php
@@ -15,7 +15,7 @@
@else
Home
@endif
-
+
Discover
@@ -34,7 +34,7 @@
no pinned playlists
-
+
diff --git a/public/scripts/app/controllers/application.coffee b/public/scripts/app/controllers/application.coffee
index 71a5a37d..98a48511 100644
--- a/public/scripts/app/controllers/application.coffee
+++ b/public/scripts/app/controllers/application.coffee
@@ -1,9 +1,10 @@
angular.module('ponyfm').controller "application", [
- '$scope', 'auth', '$location', 'upload', '$state', '$stateParams', '$injector', '$rootScope'
- ($scope, auth, $location, upload, $state, $stateParams, $injector, $rootScope) ->
+ '$scope', 'auth', '$location', 'upload', '$state', '$stateParams', '$injector', '$rootScope', 'playlists'
+ ($scope, auth, $location, upload, $state, $stateParams, $injector, $rootScope, playlists) ->
$scope.auth = auth.data
$scope.$state = $state
$scope.$stateParams = $stateParams
+ $scope.isPinnedPlaylistSelected = false
$loadingElement = null
loadingStateName = null
@@ -40,6 +41,11 @@ angular.module('ponyfm').controller "application", [
statesPreloaded = {}
$scope.$on '$stateChangeStart', (e, newState, newParams, oldState, oldParams) ->
+ $scope.isPinnedPlaylistSelected = false
+
+ if newState.name == 'content.playlist'
+ $scope.isPinnedPlaylistSelected = playlists.isPlaylistPinned newParams.id
+
return if !oldState || !newState.controller
preloader = window.pfm.preloaders[newState.controller]
diff --git a/public/scripts/app/services/playlists.coffee b/public/scripts/app/services/playlists.coffee
index ab7e2689..8b1b4fc9 100644
--- a/public/scripts/app/services/playlists.coffee
+++ b/public/scripts/app/services/playlists.coffee
@@ -16,6 +16,9 @@ angular.module('ponyfm').factory('playlists', [
playlists[id] = def.promise()
+ isPlaylistPinned: (id) ->
+ _.find(self.pinnedPlaylists, (p) -> `p.id == id`) != undefined
+
refreshOwned: (force) ->
force = force || false
return playlistDef if !force && playlistDef
diff --git a/public/styles/components.less b/public/styles/components.less
index 3332bebb..50d0f8f8 100644
--- a/public/styles/components.less
+++ b/public/styles/components.less
@@ -111,11 +111,13 @@
&:hover {
text-decoration: none;
+ background: #eee;
}
}
&.active {
a {
+ cursor: default;
background: #eee;
color: #000;
border-bottom: 4px solid @pfm-purple;
diff --git a/public/styles/layout.less b/public/styles/layout.less
index 6ab882ec..d803acd9 100644
--- a/public/styles/layout.less
+++ b/public/styles/layout.less
@@ -65,7 +65,7 @@ header {
&.selected {
background: #fff;
- > a {
+ > a, > a:hover {
cursor: default;
color: #000;
}
@@ -113,7 +113,11 @@ header {
padding: 10px 25px;
padding-right: 0px;
overflow: hidden;
- color: #fff;
+ color: fadeout(#fff, 20%);
+
+ &:hover {
+ color: #fff;
+ }
> i {
display: block;
diff --git a/public/styles/tracks.less b/public/styles/tracks.less
index 55e2cc7a..d01714d2 100644
--- a/public/styles/tracks.less
+++ b/public/styles/tracks.less
@@ -85,9 +85,10 @@
}
line-height: normal;
- margin: 5px 0px;
- padding: 0px;
+ padding: 5px 0px;
+ margin: 0px;
padding-right: 10px;
+ position: relative;
.icons {
float: right;
@@ -127,21 +128,26 @@
margin-top: 5px;
}
- .artist, .published-at, .genre {
+ .artist, .stats, .genre, .stats-expanded {
color: #777;
font-size: 80%;
}
- .published-at {
+ .stats {
float: right;
+ padding: 3px;
+
+ strong {
+ color: darken(@pfm-purple, 25%);
+ }
}
- .artist, .published-at {
+ .artist, .stats {
margin-top: 2px;
}
&:hover {
- background: #eee;
+ background: #dedede;
.image {
.play-button {
diff --git a/public/templates/content/_layout.html b/public/templates/content/_layout.html
index 917f57a1..50eb4e54 100644
--- a/public/templates/content/_layout.html
+++ b/public/templates/content/_layout.html
@@ -1,8 +1,8 @@
\ No newline at end of file
diff --git a/public/templates/directives/tracks-list.html b/public/templates/directives/tracks-list.html
index 7822f73b..17411e34 100644
--- a/public/templates/directives/tracks-list.html
+++ b/public/templates/directives/tracks-list.html
@@ -13,7 +13,7 @@
{{track.title}}
- {{track.published_at.date | momentFromNow}}
+ 5f, 2c, 10d
{{track.user.name}} / {{track.genre.name}}