diff --git a/app/Models/Track.php b/app/Models/Track.php
index 3dafea24..d0fdfdf0 100644
--- a/app/Models/Track.php
+++ b/app/Models/Track.php
@@ -439,6 +439,7 @@ class Track extends Model implements Searchable
$returnValue = self::mapPrivateTrackSummary($track);
$returnValue['album_id'] = $track->album_id;
$returnValue['show_songs'] = $showSongs;
+ $returnValue['cover_id'] = $track->cover_id;
$returnValue['real_cover_url'] = $track->getCoverUrl(Image::NORMAL);
$returnValue['cover_url'] = $track->hasCover() ? $track->getCoverUrl(Image::NORMAL) : null;
$returnValue['released_at'] = $track->released_at ? $track->released_at->toDateString() : null;
diff --git a/public/templates/albums/show.html b/public/templates/albums/show.html
index c8da28a0..2e41b3c5 100644
--- a/public/templates/albums/show.html
+++ b/public/templates/albums/show.html
@@ -1,64 +1,66 @@
-
+
-
Downloads
-
-
![]()
+
+
+
- - Published:
- - Views:
- - Downloads:
- - Favourites:
+ - Published: {{::album.created_at | date:'medium'}}
+ - Views: {{::album.stats.views}}
+ - Downloads: {{::album.stats.downloads}}
+ - Favourites: {{::album.stats.favourites}}
diff --git a/public/templates/artists/_show_layout.html b/public/templates/artists/_show_layout.html
index 9b5fd832..3f4c9913 100644
--- a/public/templates/artists/_show_layout.html
+++ b/public/templates/artists/_show_layout.html
@@ -1,18 +1,20 @@
-
+
diff --git a/public/templates/artists/content.html b/public/templates/artists/content.html
index 85134e00..4e99af09 100644
--- a/public/templates/artists/content.html
+++ b/public/templates/artists/content.html
@@ -1,14 +1,14 @@
-
+
-
+
-
+
diff --git a/public/templates/artists/profile.html b/public/templates/artists/profile.html
index 4efdc9e2..b27638d3 100644
--- a/public/templates/artists/profile.html
+++ b/public/templates/artists/profile.html
@@ -1,23 +1,23 @@
-
+
-
+
Archived profile
This is an archived artist profile that's part of the MLP
Music Archive. If it's yours, email
feld0@pony.fm to claim it!
-
+
diff --git a/public/templates/directives/albums-list.html b/public/templates/directives/albums-list.html
index 149004cd..d541c419 100644
--- a/public/templates/directives/albums-list.html
+++ b/public/templates/directives/albums-list.html
@@ -1,16 +1,16 @@
-
All Comments ({{resource.comments.length}})
---
-
-
+
+-
+
+
-
+ {{::playlist.title}}
- by
+ by {{::playlist.user.name}}
-
-
-
+ {{::playlist.stats.favourites}}
+ {{::playlist.stats.comments}}
+ {{::playlist.stats.downloads}}
diff --git a/public/templates/directives/track-editor.html b/public/templates/directives/track-editor.html
index f2bf656e..2f0a60d2 100644
--- a/public/templates/directives/track-editor.html
+++ b/public/templates/directives/track-editor.html
@@ -82,7 +82,7 @@
-
+
diff --git a/public/templates/directives/track-player.html b/public/templates/directives/track-player.html
index aadf3ecf..39be2738 100644
--- a/public/templates/directives/track-player.html
+++ b/public/templates/directives/track-player.html
@@ -3,5 +3,5 @@
-
+
diff --git a/public/templates/directives/tracks-list.html b/public/templates/directives/tracks-list.html
index 0173ec9b..5c626e2b 100644
--- a/public/templates/directives/tracks-list.html
+++ b/public/templates/directives/tracks-list.html
@@ -1,5 +1,5 @@
--
+
-
@@ -8,17 +8,19 @@
-
-
+
+
+
+
-
-
-
- f
- c
- p
+
+ {{::track.title}}
+
+ {{::track.stats.favourites}}f
+ {{::track.stats.comments}}c
+ {{::track.stats.plays}}p
-
+ {{::track.user.name}} / {{::track.genre.name}}
-
diff --git a/public/templates/directives/users-list.html b/public/templates/directives/users-list.html
index 7fac5a81..10335144 100644
--- a/public/templates/directives/users-list.html
+++ b/public/templates/directives/users-list.html
@@ -1,13 +1,13 @@
--
-
+
-
+
-
+ {{::user.name}}
- joined
+ joined {{::user.created_at.date | momentFromNow}}
-
+
archived artist
diff --git a/public/templates/playlists/show.html b/public/templates/playlists/show.html
index cd6c7112..84df2af8 100644
--- a/public/templates/playlists/show.html
+++ b/public/templates/playlists/show.html
@@ -1,63 +1,65 @@
-
+
-
Downloads
- Share
-
+
-
+
-
+
+
+
-
-
-
+
+
+
-
+
+
-
+
diff --git a/public/templates/tracks/edit.html b/public/templates/tracks/edit.html
index 2ef47315..ffba7410 100644
--- a/public/templates/tracks/edit.html
+++ b/public/templates/tracks/edit.html
@@ -1,5 +1,5 @@
\ No newline at end of file
+ Cancel
+
diff --git a/public/templates/tracks/frame.html b/public/templates/tracks/frame.html
index d7aaebd2..70b4ed61 100644
--- a/public/templates/tracks/frame.html
+++ b/public/templates/tracks/frame.html
@@ -1,34 +1,34 @@
-
+
-
-
+
Downloads
-
-
-
+
+
diff --git a/public/templates/tracks/index.html b/public/templates/tracks/index.html
index a0047f34..a8426255 100644
--- a/public/templates/tracks/index.html
+++ b/public/templates/tracks/index.html
@@ -5,11 +5,11 @@
@@ -19,11 +19,11 @@
- Prev
- -
-
+
-
+ {{::page}}
- Next
-
diff --git a/public/templates/tracks/show.html b/public/templates/tracks/show.html
index 35ea9238..89dbf8e1 100644
--- a/public/templates/tracks/show.html
+++ b/public/templates/tracks/show.html
@@ -5,38 +5,38 @@
-
-
-
+
-
+
- Click to reveal full lyrics...
+ Click to reveal full lyrics…
-
+
diff --git a/resources/assets/scripts/app/app.coffee b/resources/assets/scripts/app/app.coffee
index e1916a55..d896d146 100644
--- a/resources/assets/scripts/app/app.coffee
+++ b/resources/assets/scripts/app/app.coffee
@@ -16,7 +16,7 @@
window.pfm.preloaders = {}
-module = angular.module 'ponyfm', ['ui.bootstrap', 'ui.state', 'ui.date', 'ui.sortable', 'pasvaz.bindonce', 'angularytics', 'ngSanitize', 'hc.marked']
+module = angular.module 'ponyfm', ['ui.bootstrap', 'ui.state', 'ui.date', 'ui.sortable', 'angularytics', 'ngSanitize', 'hc.marked']
if window.pfm.environment == 'production'
module.run [
@@ -48,7 +48,9 @@ module.config [
# This fixes resource loading on IE
$sceDelegateProvider.resourceUrlWhitelist [
'self',
- '/templates/directives/*'
+ '/templates/directives/*',
+ # Used for the "Tweet" button on content item pages
+ 'https://platform.twitter.com/widgets/tweet_button.html**'
]
if window.pfm.environment == 'production'
diff --git a/resources/assets/scripts/app/directives/image-upload.coffee b/resources/assets/scripts/app/directives/image-upload.coffee
index 69410209..923165f8 100644
--- a/resources/assets/scripts/app/directives/image-upload.coffee
+++ b/resources/assets/scripts/app/directives/image-upload.coffee
@@ -64,6 +64,7 @@ angular.module('ponyfm').directive 'pfmImageUpload', () ->
$scope.uploadImage = () ->
$uploader.trigger 'click'
+ return
$scope.clearImage = () ->
$scope.imageObject = $scope.imageFile = $scope.imageUrl = null
diff --git a/resources/assets/scripts/app/directives/track-editor.coffee b/resources/assets/scripts/app/directives/track-editor.coffee
index d7b00e07..53c33cff 100644
--- a/resources/assets/scripts/app/directives/track-editor.coffee
+++ b/resources/assets/scripts/app/directives/track-editor.coffee
@@ -161,7 +161,8 @@ angular.module('ponyfm').directive 'pfmTrackEditor', () ->
track_type_id: track.track_type_id
released_at: utc_release_date
remove_cover: false
- cover: track.cover_url
+ cover_id: track.cover_id
+ cover_url: track.cover_url
album_id: track.album_id
is_published: track.is_published
is_listed: track.is_listed
diff --git a/resources/assets/scripts/base/bindonce.js b/resources/assets/scripts/base/bindonce.js
deleted file mode 100644
index 8742d891..00000000
--- a/resources/assets/scripts/base/bindonce.js
+++ /dev/null
@@ -1,325 +0,0 @@
-(function () {
- "use strict";
- /**
- * Bindonce - Zero watches binding for AngularJs
- * @version v0.3.3
- * @link https://github.com/Pasvaz/bindonce
- * @author Pasquale Vazzana
- * @license MIT License, http://www.opensource.org/licenses/MIT
- */
-
- var bindonceModule = angular.module('pasvaz.bindonce', []);
-
- bindonceModule.directive('bindonce', function ()
- {
- var toBoolean = function (value)
- {
- if (value && value.length !== 0)
- {
- var v = angular.lowercase("" + value);
- value = !(v === 'f' || v === '0' || v === 'false' || v === 'no' || v === 'n' || v === '[]');
- }
- else
- {
- value = false;
- }
- return value;
- };
-
- var msie = parseInt((/msie (\d+)/.exec(angular.lowercase(navigator.userAgent)) || [])[1], 10);
- if (isNaN(msie))
- {
- msie = parseInt((/trident\/.*; rv:(\d+)/.exec(angular.lowercase(navigator.userAgent)) || [])[1], 10);
- }
-
- var bindonceDirective =
- {
- restrict: "AM",
- controller: ['$scope', '$element', '$attrs', '$interpolate', function ($scope, $element, $attrs, $interpolate)
- {
- var showHideBinder = function (elm, attr, value)
- {
- var show = (attr === 'show') ? '' : 'none';
- var hide = (attr === 'hide') ? '' : 'none';
- elm.css('display', toBoolean(value) ? show : hide);
- };
- var classBinder = function (elm, value)
- {
- if (angular.isObject(value) && !angular.isArray(value))
- {
- var results = [];
- angular.forEach(value, function (value, index)
- {
- if (value) results.push(index);
- });
- value = results;
- }
- if (value)
- {
- elm.addClass(angular.isArray(value) ? value.join(' ') : value);
- }
- };
- var transclude = function (transcluder, scope)
- {
- transcluder.transclude(scope, function (clone)
- {
- var parent = transcluder.element.parent();
- var afterNode = transcluder.element && transcluder.element[transcluder.element.length - 1];
- var parentNode = parent && parent[0] || afterNode && afterNode.parentNode;
- var afterNextSibling = (afterNode && afterNode.nextSibling) || null;
- angular.forEach(clone, function (node)
- {
- parentNode.insertBefore(node, afterNextSibling);
- });
- });
- };
-
- var ctrl =
- {
- watcherRemover: undefined,
- binders: [],
- group: $attrs.boName,
- element: $element,
- ran: false,
-
- addBinder: function (binder)
- {
- this.binders.push(binder);
-
- // In case of late binding (when using the directive bo-name/bo-parent)
- // it happens only when you use nested bindonce, if the bo-children
- // are not dom children the linking can follow another order
- if (this.ran)
- {
- this.runBinders();
- }
- },
-
- setupWatcher: function (bindonceValue)
- {
- var that = this;
- this.watcherRemover = $scope.$watch(bindonceValue, function (newValue)
- {
- if (newValue === undefined) return;
- that.removeWatcher();
- that.checkBindonce(newValue);
- }, true);
- },
-
- checkBindonce: function (value)
- {
- var that = this, promise = (value.$promise) ? value.$promise.then : value.then;
- // since Angular 1.2 promises are no longer
- // undefined until they don't get resolved
- if (typeof promise === 'function')
- {
- promise(function ()
- {
- that.runBinders();
- });
- }
- else
- {
- that.runBinders();
- }
- },
-
- removeWatcher: function ()
- {
- if (this.watcherRemover !== undefined)
- {
- this.watcherRemover();
- this.watcherRemover = undefined;
- }
- },
-
- runBinders: function ()
- {
- while (this.binders.length > 0)
- {
- var binder = this.binders.shift();
- if (this.group && this.group != binder.group) continue;
- var value = binder.scope.$eval((binder.interpolate) ? $interpolate(binder.value) : binder.value);
- switch (binder.attr)
- {
- case 'boIf':
- if (toBoolean(value))
- {
- transclude(binder, binder.scope.$new());
- }
- break;
- case 'boSwitch':
- var selectedTranscludes, switchCtrl = binder.controller[0];
- if ((selectedTranscludes = switchCtrl.cases['!' + value] || switchCtrl.cases['?']))
- {
- binder.scope.$eval(binder.attrs.change);
- angular.forEach(selectedTranscludes, function (selectedTransclude)
- {
- transclude(selectedTransclude, binder.scope.$new());
- });
- }
- break;
- case 'boSwitchWhen':
- var ctrl = binder.controller[0];
- ctrl.cases['!' + binder.attrs.boSwitchWhen] = (ctrl.cases['!' + binder.attrs.boSwitchWhen] || []);
- ctrl.cases['!' + binder.attrs.boSwitchWhen].push({ transclude: binder.transclude, element: binder.element });
- break;
- case 'boSwitchDefault':
- var ctrl = binder.controller[0];
- ctrl.cases['?'] = (ctrl.cases['?'] || []);
- ctrl.cases['?'].push({ transclude: binder.transclude, element: binder.element });
- break;
- case 'hide':
- case 'show':
- showHideBinder(binder.element, binder.attr, value);
- break;
- case 'class':
- classBinder(binder.element, value);
- break;
- case 'text':
- binder.element.text(value);
- break;
- case 'html':
- binder.element.html(value);
- break;
- case 'style':
- binder.element.css(value);
- break;
- case 'disabled':
- binder.element.prop('disabled', value);
- break;
- case 'src':
- binder.element.attr(binder.attr, value);
- if (msie) binder.element.prop('src', value);
- break;
- case 'attr':
- angular.forEach(binder.attrs, function (attrValue, attrKey)
- {
- var newAttr, newValue;
- if (attrKey.match(/^boAttr./) && binder.attrs[attrKey])
- {
- newAttr = attrKey.replace(/^boAttr/, '').replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
- newValue = binder.scope.$eval(binder.attrs[attrKey]);
- binder.element.attr(newAttr, newValue);
- }
- });
- break;
- case 'href':
- case 'alt':
- case 'title':
- case 'id':
- case 'value':
- binder.element.attr(binder.attr, value);
- break;
- }
- }
- this.ran = true;
- }
- };
-
- angular.extend(this, ctrl);
- }],
-
- link: function (scope, elm, attrs, bindonceController)
- {
- var value = attrs.bindonce && scope.$eval(attrs.bindonce);
- if (value !== undefined)
- {
- bindonceController.checkBindonce(value);
- }
- else
- {
- bindonceController.setupWatcher(attrs.bindonce);
- elm.bind("$destroy", bindonceController.removeWatcher);
- }
- }
- };
-
- return bindonceDirective;
- });
-
- angular.forEach(
- [
- { directiveName: 'boShow', attribute: 'show' },
- { directiveName: 'boHide', attribute: 'hide' },
- { directiveName: 'boClass', attribute: 'class' },
- { directiveName: 'boText', attribute: 'text' },
- { directiveName: 'boBind', attribute: 'text' },
- { directiveName: 'boHtml', attribute: 'html' },
- { directiveName: 'boSrcI', attribute: 'src', interpolate: true },
- { directiveName: 'boSrc', attribute: 'src' },
- { directiveName: 'boHrefI', attribute: 'href', interpolate: true },
- { directiveName: 'boHref', attribute: 'href' },
- { directiveName: 'boAlt', attribute: 'alt' },
- { directiveName: 'boTitle', attribute: 'title' },
- { directiveName: 'boId', attribute: 'id' },
- { directiveName: 'boStyle', attribute: 'style' },
- { directiveName: 'boDisabled', attribute: 'disabled' },
- { directiveName: 'boValue', attribute: 'value' },
- { directiveName: 'boAttr', attribute: 'attr' },
-
- { directiveName: 'boIf', transclude: 'element', terminal: true, priority: 1000 },
- { directiveName: 'boSwitch', require: 'boSwitch', controller: function () { this.cases = {}; } },
- { directiveName: 'boSwitchWhen', transclude: 'element', priority: 800, require: '^boSwitch' },
- { directiveName: 'boSwitchDefault', transclude: 'element', priority: 800, require: '^boSwitch' }
- ],
- function (boDirective)
- {
- var childPriority = 200;
- return bindonceModule.directive(boDirective.directiveName, function ()
- {
- var bindonceDirective =
- {
- priority: boDirective.priority || childPriority,
- transclude: boDirective.transclude || false,
- terminal: boDirective.terminal || false,
- require: ['^bindonce'].concat(boDirective.require || []),
- controller: boDirective.controller,
- compile: function (tElement, tAttrs, transclude)
- {
- return function (scope, elm, attrs, controllers)
- {
- var bindonceController = controllers[0];
- var name = attrs.boParent;
- if (name && bindonceController.group !== name)
- {
- var element = bindonceController.element.parent();
- bindonceController = undefined;
- var parentValue;
-
- while (element[0].nodeType !== 9 && element.length)
- {
- if ((parentValue = element.data('$bindonceController'))
- && parentValue.group === name)
- {
- bindonceController = parentValue;
- break;
- }
- element = element.parent();
- }
- if (!bindonceController)
- {
- throw new Error("No bindonce controller: " + name);
- }
- }
-
- bindonceController.addBinder(
- {
- element: elm,
- attr: boDirective.attribute || boDirective.directiveName,
- attrs: attrs,
- value: attrs[boDirective.directiveName],
- interpolate: boDirective.interpolate,
- group: name,
- transclude: transclude,
- controller: controllers.slice(1),
- scope: scope
- });
- };
- }
- };
-
- return bindonceDirective;
- });
- })
-})();
--
-
-
-
+
-
+
+ {{::format.name}}
+ ({{::format.size}})
-
-
-
+
+ {{::format.name}}
+ ({{::format.size}})

- - We're getting your download ready! This may take up to a few minutes.
+ - We're getting your download ready! This may take a few minutes.
{{::playlist.title}}
- created by: + curated by: {{::playlist.user.name}}
-- Created:
- - Views:
- - Downloads:
- - Favourites:
+ - Created: {{::playlist.created_at | date:'medium'}}
+ - Views: {{::playlist.stats.views}}
+ - Downloads: {{::playlist.stats.downloads}}
+ - Favourites: {{::playlist.stats.favourites}}
Description
- +Tracks
-PUT EDIT STUFF HERE
- Cancel ---
-
-
-
+
-
- Add to Playlist
+ Add to Playlist
- Share or Embed
-
- - Edit
+
+ - Edit
+-
+
+ {{::format.name}}
+ ({{::format.size}})
-
-
+ {{::format.name}}
+ ({{::format.size}})

- - We're getting your download ready! This'll take a few seconds.
+ - We're getting your download ready! This'll take a few seconds.
--
+
-
-
+ {{::playlist.title}}
{{playlist.message}}
@@ -37,19 +37,19 @@
{{::track.title}}
- - from: + + from: - by: + by: {{::track.user.name}}
--
-
+ {{::type.title}}
--
-
+ {{::song.title}}
@@ -33,9 +33,9 @@--
+
-
-
+ {{::genre.title}}
@@ -45,10 +45,10 @@--
-
+ {{::item.title}}
@@ -58,8 +58,8 @@--
-
+
-
+ {{::filter.title}}
@@ -68,8 +68,8 @@-- Published:
- - Views:
- - Plays:
- - Downloads:
- - Favourites:
+ - Published: {{::track.published_at}}
+ - Views: {{::track.stats.views}}
+ - Plays: {{::track.stats.plays}}
+ - Downloads: {{::track.stats.downloads}}
+ - Favourites: {{::track.stats.favourites}}
Description
Lyrics