diff --git a/public/templates/tracks/edit.html b/public/templates/tracks/edit.html new file mode 100644 index 00000000..2ef47315 --- /dev/null +++ b/public/templates/tracks/edit.html @@ -0,0 +1,5 @@ +
+

PUT EDIT STUFF HERE

+ + Cancel +
\ No newline at end of file diff --git a/public/templates/tracks/frame.html b/public/templates/tracks/frame.html new file mode 100644 index 00000000..d7aaebd2 --- /dev/null +++ b/public/templates/tracks/frame.html @@ -0,0 +1,57 @@ +
+ + +
+ +

+

+ + from: + + + by: +

+
+ +
+
diff --git a/public/templates/tracks/show.html b/public/templates/tracks/show.html index fc931f06..2b3de699 100644 --- a/public/templates/tracks/show.html +++ b/public/templates/tracks/show.html @@ -1,94 +1,44 @@ -
- +
+
+ -
- -

-

- - from: - - - by: -

-
- -
-
- - - - -
    -
  • Published:
  • -
  • Views:
  • -
  • Plays:
  • -
  • Downloads:
  • -
  • Favourites:
  • -
+ -
-
-

Description

-

-
-
-

Lyrics

-
- -

+
    +
  • Published:
  • +
  • Views:
  • +
  • Plays:
  • +
  • Downloads:
  • +
  • Favourites:
  • +
+
+
+
+

Description

+

+
+ +
+

Lyrics

+ - -
+ +
diff --git a/resources/assets/scripts/app/app.coffee b/resources/assets/scripts/app/app.coffee index ac7f8fc1..e1916a55 100644 --- a/resources/assets/scripts/app/app.coffee +++ b/resources/assets/scripts/app/app.coffee @@ -183,8 +183,20 @@ module.config [ state.state 'content.track', url: '/tracks/{id:[^\-]+}-{slug}' - templateUrl: '/templates/tracks/show.html' + templateUrl: '/templates/tracks/frame.html' controller: 'track' + abstract: true + + state.state 'content.track.show', + url: '' + templateUrl: '/templates/tracks/show.html' + controller: 'track-show' + + state.state 'content.track.edit', + url: '/edit' + templateUrl: '/templates/tracks/edit.html' + controller: 'track-edit' + # Albums diff --git a/resources/assets/scripts/app/controllers/track-edit.coffee b/resources/assets/scripts/app/controllers/track-edit.coffee new file mode 100644 index 00000000..e76e139d --- /dev/null +++ b/resources/assets/scripts/app/controllers/track-edit.coffee @@ -0,0 +1,31 @@ +# Pony.fm - A community for pony fan music. +# Copyright (C) 2016 Peter Deltchev +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +window.pfm.preloaders['track-edit'] = [ + 'tracks', '$state', 'playlists' + (tracks, $state, playlists) -> + $.when.all [tracks.fetch $state.params.id, playlists.refreshOwned(true)] +] + +angular.module('ponyfm').controller "track-edit", [ + '$scope', 'tracks', '$state', 'playlists', 'auth', 'favourites', '$dialog' + ($scope, tracks, $state, playlists, auth, favourites, $dialog) -> + track = null + + tracks.fetch($state.params.id).done (trackResponse) -> + $scope.track = trackResponse.track + track = trackResponse.track +] diff --git a/resources/assets/scripts/app/controllers/track-show.coffee b/resources/assets/scripts/app/controllers/track-show.coffee new file mode 100644 index 00000000..c140bdbd --- /dev/null +++ b/resources/assets/scripts/app/controllers/track-show.coffee @@ -0,0 +1,26 @@ +# Pony.fm - A community for pony fan music. +# Copyright (C) 2016 Peter Deltchev +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +window.pfm.preloaders['track-show'] = [ + 'tracks', '$state', 'playlists' + (tracks, $state, playlists) -> + $.when.all [tracks.fetch $state.params.id, playlists.refreshOwned(true)] +] + +angular.module('ponyfm').controller "track-show", [ + '$scope', 'tracks', '$state', 'playlists', 'auth', 'favourites', '$dialog' + ($scope, tracks, $state, playlists, auth, favourites, $dialog) -> +] diff --git a/resources/assets/scripts/app/controllers/track.coffee b/resources/assets/scripts/app/controllers/track.coffee index 1b00ef11..d93e6b8f 100644 --- a/resources/assets/scripts/app/controllers/track.coffee +++ b/resources/assets/scripts/app/controllers/track.coffee @@ -14,12 +14,6 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -window.pfm.preloaders['track'] = [ - 'tracks', '$state', 'playlists' - (tracks, $state, playlists) -> - $.when.all [tracks.fetch $state.params.id, playlists.refreshOwned(true)] -] - angular.module('ponyfm').controller "track", [ '$scope', '$rootScope', 'tracks', '$state', 'playlists', 'auth', 'favourites', '$dialog', 'download-cached', '$window', '$timeout' ($scope, $rootScope, tracks, $state, playlists, auth, favourites, $dialog, cachedTrack, $window, $timeout) ->