2013-07-28 10:35:31 +02:00
|
|
|
<form novalidate ng-submit="saveAlbum()">
|
2015-10-25 03:35:37 +01:00
|
|
|
<ul class="toolbar">
|
|
|
|
<li>
|
2016-05-20 01:08:57 +02:00
|
|
|
<button type="submit" class="btn btn-default" ng-class="{disabled: (!isDirty && !isNew) || isSaving, 'btn-primary': isDirty || isNew}">
|
2015-10-25 03:35:37 +01:00
|
|
|
<span ng-show="isNew">Create Album</span>
|
|
|
|
<span ng-hide="isNew">Save Changes</span>
|
2016-05-20 17:46:44 +02:00
|
|
|
<i ng-show="isSaving" class="fa fa-cog fa-spin fa-lg"></i>
|
2015-10-25 03:35:37 +01:00
|
|
|
</button>
|
|
|
|
</li>
|
|
|
|
<li class="delete" ng-show="!isNew"><a ng-class="{disabled: isSaving}" class="btn btn-danger" href="#" ng-click="deleteAlbum()" pfm-eat-click>Delete Album</a></li>
|
|
|
|
</ul>
|
|
|
|
<div class="stretch-to-bottom">
|
|
|
|
<div class="form-row" ng-class="{'has-error': errors.title != null}">
|
|
|
|
<label for="title" class="strong">Title:</label>
|
|
|
|
<input ng-disabled="isSaving" ng-change="touchModel()" placeholder="Album Title" type="text" id="title" ng-model="album.title" />
|
|
|
|
<div class="error">{{errors.title}}</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
|
|
<label for="description" class="strong">Description:</label>
|
|
|
|
<textarea ng-disabled="isSaving" ng-change="touchModel()" placeholder="Description (optional)" id="description" ng-model="album.description"></textarea>
|
|
|
|
<div class="error">{{errors.description}}</div>
|
|
|
|
</div>
|
2016-05-18 02:27:59 +02:00
|
|
|
<div class="form-row" ng-show="isAdmin" ng-class="{'has-error': errors.username != null}">
|
|
|
|
<label for="title" class="strong">User:</label>
|
|
|
|
<input ng-disabled="isSaving" ng-change="touchModel()" placeholder="Username" type="text" id="username" ng-model="album.username" />
|
|
|
|
<div class="error">{{errors.username}}</div>
|
|
|
|
</div>
|
2015-10-25 03:35:37 +01:00
|
|
|
<div class="form-row" ng-class="{'has-error': errors.cover != null}">
|
|
|
|
<label class="strong">Album Cover: </label>
|
2016-03-19 09:10:24 +01:00
|
|
|
<pfm-image-upload set-image="setCover" image="album.cover" user-id="album.user_id"></pfm-image-upload>
|
2015-10-25 03:35:37 +01:00
|
|
|
</div>
|
|
|
|
<div class="form-row track-selector">
|
2016-05-20 01:08:57 +02:00
|
|
|
<a pfm-popup="track-selector,right" pfm-popup-close-on-click href="#" class="btn btn-sm pull-right btn-info">Add Tracks</a>
|
2015-10-25 03:35:37 +01:00
|
|
|
<label class="strong">Album Tracks</label>
|
|
|
|
<div id="track-selector" class="pfm-popup">
|
|
|
|
<ul>
|
2016-02-14 12:12:13 +01:00
|
|
|
<li ng-repeat="track in data.tracksDb track by track.id" ng-class="{selected: trackIds[track.id]}">
|
|
|
|
<a pfm-eat-click href="#" ng-click="toggleTrack(track); $event.stopPropagation();">{{::track.title}}</a>
|
2015-10-25 03:35:37 +01:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2013-07-28 19:45:21 +02:00
|
|
|
|
2015-10-25 03:35:37 +01:00
|
|
|
<ul class="album-track-listing" ui-sortable="{handle: '.handle', axis: 'y', forcePlaceholderSizeType: true, update: sortTracks}" ng-model="tracks">
|
2016-02-14 12:12:13 +01:00
|
|
|
<li ng-repeat="track in tracks track by track.id">
|
2015-10-25 03:35:37 +01:00
|
|
|
<div>
|
2016-07-16 02:27:05 +02:00
|
|
|
<span class="btn btn-sm pull-left handle"><i class="material-icons">swap_vert</i></span>
|
|
|
|
<a href="#" class="btn btn-sm pull-right btn-danger" ng-click="toggleTrack(track)" pfm-eat-click><i class="material-icons">reorder</i></a>
|
2016-02-14 12:12:13 +01:00
|
|
|
<span>{{::track.title}}</span>
|
2015-10-25 03:35:37 +01:00
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|