Deleting stuff actually can be undone.

This commit is contained in:
Peter Deltchev 2016-01-05 07:53:01 -08:00
parent eaa1cc39a9
commit 96be3224e4
8 changed files with 23 additions and 7 deletions

View file

@ -21,17 +21,20 @@
namespace Poniverse\Ponyfm\Commands; namespace Poniverse\Ponyfm\Commands;
use Poniverse\Ponyfm\Models\Album; use Poniverse\Ponyfm\Models\Album;
use Illuminate\Support\Facades\Auth; use Auth;
class DeleteAlbumCommand extends CommandBase class DeleteAlbumCommand extends CommandBase
{ {
/** @var int */
private $_albumId; private $_albumId;
/** @var Album */
private $_album; private $_album;
function __construct($albumId) function __construct($albumId)
{ {
$this->_albumId = $albumId; $this->_albumId = $albumId;
$this->_album = ALbum::find($albumId); $this->_album = Album::find($albumId);
} }
/** /**

View file

@ -21,11 +21,14 @@
namespace Poniverse\Ponyfm\Commands; namespace Poniverse\Ponyfm\Commands;
use Poniverse\Ponyfm\Models\Playlist; use Poniverse\Ponyfm\Models\Playlist;
use Illuminate\Support\Facades\Auth; use Auth;
class DeletePlaylistCommand extends CommandBase class DeletePlaylistCommand extends CommandBase
{ {
/** @var int */
private $_playlistId; private $_playlistId;
/** @var Playlist */
private $_playlist; private $_playlist;
function __construct($playlistId) function __construct($playlistId)

View file

@ -24,7 +24,10 @@ use Poniverse\Ponyfm\Models\Track;
class DeleteTrackCommand extends CommandBase class DeleteTrackCommand extends CommandBase
{ {
/** @var int */
private $_trackId; private $_trackId;
/** @var Track */
private $_track; private $_track;
function __construct($trackId) function __construct($trackId)

View file

@ -7,6 +7,13 @@
</div> </div>
</div> </div>
<div bo-show="artist.is_archived">
<h2>Archived profile</h2>
<p>This is an archived artist profile that&#39;s part of the MLP
Music Archive. If it&#39;s yours, email
<a href="mailto:feld0@pony.fm" target="_blank">feld0@pony.fm</a> to claim it!</p>
</div>
<pfm-comments type="user" resource="artist"></pfm-comments> <pfm-comments type="user" resource="artist"></pfm-comments>
</div> </div>
<div class="span6 cover-image"> <div class="span6 cover-image">

View file

@ -113,7 +113,7 @@ angular.module('ponyfm').controller "account-albums-edit", [
xhr.send formData xhr.send formData
$scope.deleteAlbum = () -> $scope.deleteAlbum = () ->
$dialog.messageBox('Delete ' + $scope.album.title, 'Are you sure you want to delete "' + $scope.album.title + '"? This cannot be undone.', [ $dialog.messageBox('Delete ' + $scope.album.title, 'Are you sure you want to delete "' + $scope.album.title + '"?', [
{result: 'ok', label: 'Yes', cssClass: 'btn-danger'}, {result: 'cancel', label: 'No', cssClass: 'btn-primary'} {result: 'ok', label: 'Yes', cssClass: 'btn-danger'}, {result: 'cancel', label: 'No', cssClass: 'btn-primary'}
]).open().then (res) -> ]).open().then (res) ->
return if res == 'cancel' return if res == 'cancel'

View file

@ -44,7 +44,7 @@ angular.module('ponyfm').controller "account-playlists", [
playlists.editPlaylist playlist playlists.editPlaylist playlist
$scope.deletePlaylist = (playlist) -> $scope.deletePlaylist = (playlist) ->
$dialog.messageBox('Delete ' + playlist.title, 'Are you sure you want to delete "' + playlist.title + '"? This cannot be undone.', [ $dialog.messageBox('Delete ' + playlist.title, 'Are you sure you want to delete "' + playlist.title + '"?', [
{result: 'ok', label: 'Yes', cssClass: 'btn-danger'}, {result: 'ok', label: 'Yes', cssClass: 'btn-danger'},
{result: 'cancel', label: 'No', cssClass: 'btn-primary'} {result: 'cancel', label: 'No', cssClass: 'btn-primary'}
]).open().then (res) -> ]).open().then (res) ->

View file

@ -147,7 +147,7 @@ angular.module('ponyfm').controller "account-track", [
$scope.touchModel = -> $scope.isDirty = true $scope.touchModel = -> $scope.isDirty = true
$scope.deleteTrack = (track) -> $scope.deleteTrack = (track) ->
$dialog.messageBox('Delete ' + track.title, 'Are you sure you want to delete "' + track.title + '"? This cannot be undone.', [ $dialog.messageBox('Delete ' + track.title, 'Are you sure you want to delete "' + track.title + '"?', [
{result: 'ok', label: 'Yes', cssClass: 'btn-danger'}, {result: 'cancel', label: 'No', cssClass: 'btn-primary'} {result: 'ok', label: 'Yes', cssClass: 'btn-danger'}, {result: 'cancel', label: 'No', cssClass: 'btn-primary'}
]).open().then (res) -> ]).open().then (res) ->
return if res == 'cancel' return if res == 'cancel'

View file

@ -48,7 +48,7 @@ angular.module('ponyfm').controller "sidebar", [
playlists.editPlaylist playlist playlists.editPlaylist playlist
$scope.deletePlaylist = (playlist) -> $scope.deletePlaylist = (playlist) ->
$dialog.messageBox('Delete ' + playlist.title, 'Are you sure you want to delete "' + playlist.title + '"? This cannot be undone.', [ $dialog.messageBox('Delete ' + playlist.title, 'Are you sure you want to delete "' + playlist.title + '"?', [
{result: 'ok', label: 'Yes', cssClass: 'btn-danger'}, {result: 'ok', label: 'Yes', cssClass: 'btn-danger'},
{result: 'cancel', label: 'No', cssClass: 'btn-primary'} {result: 'cancel', label: 'No', cssClass: 'btn-primary'}
]).open().then (res) -> ]).open().then (res) ->