mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-25 14:37:59 +01:00
#20: Tweaked the genre merging UI to be less tedious.
This commit is contained in:
parent
96be3224e4
commit
4b51ff9c84
2 changed files with 8 additions and 9 deletions
|
@ -24,9 +24,9 @@
|
||||||
<td><i ng-show="genre.isSaving" class="icon-cog icon-spin icon-large"></i></td>
|
<td><i ng-show="genre.isSaving" class="icon-cog icon-spin icon-large"></i></td>
|
||||||
<td><a ng-href="{{ genre.url }}">{{ genre.track_count }}</a></td>
|
<td><a ng-href="{{ genre.url }}">{{ genre.track_count }}</a></td>
|
||||||
<td class="-actions">
|
<td class="-actions">
|
||||||
<button class="btn btn-warning" ng-hide="mergeInProgress" ng-click="startMerge(genre)">Merge…</button>
|
<button class="btn btn-warning" ng-hide="mergeInProgress" ng-click="startMerge(genre)">Merge genres in…</button>
|
||||||
<button class="btn btn-danger" ng-show="mergeInProgress && genreToDelete.id != genre.id" ng-click="finishMerge(genre)">Merge in <em>{{ genreToDelete.name }}</em>…</button>
|
<button class="btn btn-danger" ng-show="mergeInProgress && destinationGenre.id != genre.id" ng-click="finishMerge(genre)">Merge into <em>{{ destinationGenre.name }}</em>…</button>
|
||||||
<button class="btn btn-warning" ng-show="mergeInProgress && genreToDelete.id == genre.id" ng-click="cancelMerge()">Cancel merge</button>
|
<button class="btn btn-warning" ng-show="mergeInProgress && destinationGenre.id == genre.id" ng-click="cancelMerge()">Cancel merge</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -50,17 +50,16 @@ angular.module('ponyfm').controller 'admin-genres', [
|
||||||
genre.isSaving = false
|
genre.isSaving = false
|
||||||
|
|
||||||
|
|
||||||
$scope.startMerge = (genreToDelete) ->
|
$scope.startMerge = (destinationGenre) ->
|
||||||
$scope.genreToDelete = genreToDelete
|
$scope.destinationGenre = destinationGenre
|
||||||
$scope.mergeInProgress = true
|
$scope.mergeInProgress = true
|
||||||
|
|
||||||
$scope.cancelMerge = () ->
|
$scope.cancelMerge = () ->
|
||||||
$scope.genreToDelete = null
|
$scope.destinationGenre = null
|
||||||
$scope.mergeInProgress = false
|
$scope.mergeInProgress = false
|
||||||
|
|
||||||
$scope.finishMerge = (destinationGenre) ->
|
$scope.finishMerge = (genreToDelete) ->
|
||||||
$scope.mergeInProgress = false
|
genres.merge(genreToDelete.id, $scope.destinationGenre.id)
|
||||||
genres.merge($scope.genreToDelete.id, destinationGenre.id)
|
|
||||||
.done (response) ->
|
.done (response) ->
|
||||||
loadGenres()
|
loadGenres()
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue