diff --git a/public/templates/partials/announcements/hwc/winners.html b/public/templates/partials/announcements/hwc/winners.html
new file mode 100644
index 00000000..2869dc41
--- /dev/null
+++ b/public/templates/partials/announcements/hwc/winners.html
@@ -0,0 +1,26 @@
+
+
{{ ::announcement.title }}
+
+
+
+
+
diff --git a/resources/assets/scripts/app/controllers/dashboard.coffee b/resources/assets/scripts/app/controllers/dashboard.coffee
index fba76779..12db31fa 100644
--- a/resources/assets/scripts/app/controllers/dashboard.coffee
+++ b/resources/assets/scripts/app/controllers/dashboard.coffee
@@ -20,18 +20,29 @@ window.pfm.preloaders['dashboard'] = [
]
module.exports = angular.module('ponyfm').controller "dashboard", [
- '$scope', 'dashboard', 'auth', '$http', 'announcements', '$compile'
- ($scope, dashboard, auth, $http, announcements, $compile) ->
+ '$scope', 'dashboard', 'auth', '$http', 'announcements', '$compile', 'tracks', 'player'
+ ($scope, dashboard, auth, $http, announcements, $compile, tracks, player) ->
$scope.recentTracks = null
$scope.popularTracks = null
$scope.announcementClass = 'disabled'
$scope.announceWrapperClass = 'disabled'
+ $scope.play = (track) ->
+ index = _.indexOf $scope.announcement.parsedTracks, (t) -> t.id == track.id
+ player.playTracks $scope.announcement.parsedTracks, index
+
$scope.loadAnnouncementTemplate = (url) ->
$http.get('/templates/' + url).success (templateContent) ->
compiledHtml = $compile(templateContent)($scope)
$('#announcement').append(compiledHtml)
+ if $scope.announcement.tracks.length > 0
+ console.log($scope.announcement.tracks)
+ $scope.announcement.parsedTracks = []
+ for track in $scope.announcement.tracks
+ tracks.fetch(track, false).done (trackResponse) ->
+ $scope.announcement.parsedTracks.push(trackResponse.track)
+ console.log(trackResponse)
dashboard.refresh().done (res) ->
$scope.recentTracks = res.recent_tracks
diff --git a/resources/assets/styles/dashboard.less b/resources/assets/styles/dashboard.less
index 5874a8d2..6fa3acc7 100644
--- a/resources/assets/styles/dashboard.less
+++ b/resources/assets/styles/dashboard.less
@@ -200,7 +200,7 @@
}
&.hwc-announce {
- height: 150px;
+ height: 160px;
background-color: #68a1ee;
background-image: url(/images/hwc/hwc-announcement.jpg);
background-size: 300px;
@@ -216,13 +216,36 @@
background: none;
}
- .announce-actions, .announce-content {
+ .announce-actions, .announce-content, .announce-tracks {
padding-left: 300px;
@media (max-width: 1200px) {
padding-left: 15px;
}
}
+
+ .announce-tracks {
+ li {
+ width: 33%;
+ float: left;
+
+ .title {
+ color: #fff;
+ }
+
+ .artist {
+ color: #eee;
+ }
+
+ &:hover {
+ background: rgba(0,0,0,0.2);
+ }
+
+ &.is-playing {
+ background: rgba(0,0,0,0.1);
+ }
+ }
+ }
}
&.secret-santa-announce {