2016-02-27 04:40:45 +01:00
< form class = "track-editor" novalidate ng-submit = "updateTrack(track)" >
2016-02-05 21:44:56 +01:00
< ul class = "toolbar" >
< li >
2016-05-20 01:08:57 +02:00
< button type = "submit" class = "btn btn-default" ng-class = "{disabled: (track.is_published && !isDirty) || isSaving, 'btn-primary': !track.is_published || isDirty}" >
2016-02-05 21:44:56 +01:00
< span ng-show = "track.is_published" >
Save Changes
< / span >
< span ng-hide = "track.is_published" >
Publish Track
< / span >
2016-05-20 17:46:44 +02:00
< i ng-show = "isSaving" class = "fa fa-cog fa-spin fa-lg" > < / i >
2016-02-05 21:44:56 +01:00
< / button >
< / li >
2016-02-14 02:38:45 +01:00
< li class = "delete" > < a ng-class = "{disabled: isSaving}" class = "btn btn-danger" href = "#" ng-click = "deleteTrack()" pfm-eat-click > Delete Track< / a > < / li >
2016-02-05 21:44:56 +01:00
< / 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 = "Track Title" type = "text" id = "title" ng-model = "track.title" / >
< div class = "error" > {{errors.title}}< / div >
< / div >
2016-05-20 16:15:10 +02:00
< div class = "row" >
2016-05-20 01:08:57 +02:00
< div class = "col-md-6 form-row" ng-class = "{'has-error': errors.description != null}" >
2016-02-05 21:44:56 +01:00
< label for = "description" class = "strong" > Description:< / label >
< textarea ng-disabled = "isSaving" ng-change = "touchModel()" placeholder = "Description (optional)" id = "description" ng-model = "track.description" > < / textarea >
< div class = "error" > {{errors.description}}< / div >
< / div >
2016-05-20 01:08:57 +02:00
< div class = "col-md-6 form-row" ng-class = "{'has-error': errors.lyrics != null}" >
2016-02-05 21:44:56 +01:00
< label for = "is_vocal" class = "strong" > < input ng-disabled = "isSaving" ng-change = "touchModel(); updateIsVocal()" id = "is_vocal" type = "checkbox" ng-model = "track.is_vocal" / > Is Vocal< / label >
2016-04-03 18:57:00 +02:00
< textarea ng-disabled = "isSaving" ng-change = "touchModel()" ng-show = "track.is_vocal" ng-animate = "'fade'" placeholder = "Lyrics (optional)" id = "lyrics" ng-model = "track.lyrics" > < / textarea >
2016-02-05 21:44:56 +01:00
< div class = "error" > {{errors.lyrics}}< / div >
< / div >
< / div >
2016-05-20 16:15:10 +02:00
< div class = "row" >
2016-05-20 01:08:57 +02:00
< div class = "form-row col-md-6" ng-class = "{'has-error': errors.genre_id != null}" >
2016-02-05 21:44:56 +01:00
< label for = "genre" class = "strong" > Genre:< / label >
< select ng-disabled = "isSaving" id = "genre" ng-change = "touchModel()" ng-model = "track.genre_id" ng-options = "genre.id as genre.name for genre in taxonomies.genres" >
< option value = "" > Please select a genre...< / option >
< / select >
< div class = "error" > {{errors.genre_id}}< / div >
< / div >
2016-05-20 01:08:57 +02:00
< div class = "form-row col-md-6" ng-class = "{'has-error': errors.track_type_id != null}" >
2016-02-05 21:44:56 +01:00
< label for = "track_type" class = "strong" > This track is...< / label >
< select ng-disabled = "isSaving" id = "track_type" ng-change = "touchModel()" ng-model = "track.track_type_id" ng-options = "type.id as type.editor_title for type in taxonomies.trackTypes" >
< option value = "" > Please select a type...< / option >
< / select >
< div class = "error" > {{errors.track_type_id}}< / div >
< / div >
< / div >
2016-05-20 16:15:10 +02:00
< div class = "row" >
2016-05-20 01:08:57 +02:00
< div class = "form-row album-selector col-md-6" ng-class = "{'has-error': errors.album_id != null}" >
2016-05-20 16:15:10 +02:00
< a pfm-popup = "album-selector" pfm-popup-close-on-click href = "#" class = "btn btn-default" >
2016-02-05 21:44:56 +01:00
Album:
< strong ng-show = "selectedAlbum" > {{selectedAlbum.title}}< / strong >
< strong ng-hide = "selectedAlbum" > None< / strong >
< / a >
< div id = "album-selector" class = "pfm-popup" >
< ul >
< li ng-class = "{selected: selectedAlbum == null}" >
< a pfm-eat-click href = "#" ng-click = "selectAlbum(null);" > None< / a >
< / li >
2016-02-14 12:12:13 +01:00
< li ng-repeat = "album in albums track by album.id" ng-class = "{selected: selectedAlbum.id == album.id}" >
< a pfm-eat-click href = "#" ng-click = "selectAlbum(album);" > {{::album.title}}< / a >
2016-02-05 21:44:56 +01:00
< / li >
< / ul >
< / div >
< div class = "error" > {{errors.album_id}}< / div >
< / div >
2016-05-20 01:08:57 +02:00
< div class = "form-row show-songs-selector col-md-6" ng-show = "track.track_type_id == 2" ng-class = "{'has-error': errors.show_song_ids != null}" >
2016-05-20 16:15:10 +02:00
< a pfm-popup = "song-selector" pfm-popup-close-on-click href = "#" class = "btn btn-default" > Show Songs: < strong > {{selectedSongsTitle}}< / strong > < / a >
2016-02-05 21:44:56 +01:00
< div id = "song-selector" class = "pfm-popup" >
< ul >
2016-02-25 20:00:12 +01:00
< li ng-repeat = "song in taxonomies.showSongs track by song.id" ng-class = "{selected: selectedSongs[song.id]}" >
2016-02-14 12:12:13 +01:00
< a pfm-eat-click href = "#" ng-click = "toggleSong(song); $event.stopPropagation();" > {{::song.title}}< / a >
2016-02-05 21:44:56 +01:00
< / li >
< / ul >
< / div >
< div class = "error" > {{errors.show_song_ids}}< / div >
< / div >
< / div >
2016-05-20 16:15:10 +02:00
< div class = "row" >
2016-05-20 01:08:57 +02:00
< div class = "form-row col-md-6" ng-class = "{'has-error': errors.cover != null}" >
2016-02-05 21:44:56 +01:00
< label class = "strong" > Track Cover: < / label >
2016-03-06 13:27:53 +01:00
< pfm-image-upload set-image = "setCover" image = "track.cover_url" user-id = "track.user_id" > < / pfm-image-upload >
2016-02-05 21:44:56 +01:00
< / div >
2016-05-20 01:08:57 +02:00
< div class = "form-row col-md-6" ng-class = "{'has-error': errors.released_at != null}" >
2016-02-05 21:44:56 +01:00
< label for = "released_at" class = "strong" > Release Date:< / label >
2016-02-14 10:29:02 +01:00
< input
id="released_at"
type="text"
ui-date
ng-disabled="isSaving"
ng-model="track.released_at"
ng-change="touchModel()"
/>
2016-02-05 21:44:56 +01:00
< div class = "error" > {{errors.released_at}}< / div >
< / div >
< / div >
2016-05-20 16:15:10 +02:00
< div class = "row" >
2016-05-20 01:08:57 +02:00
< div class = "col-md-4 form-row" >
2016-02-05 21:44:56 +01:00
< label for = "is_explicit" > < input ng-disabled = "isSaving" ng-change = "touchModel()" id = "is_explicit" type = "checkbox" ng-model = "track.is_explicit" / > Contains Explicit Content< / label >
< / div >
2016-05-20 01:08:57 +02:00
< div class = "col-md-4 form-row" >
2016-02-05 21:44:56 +01:00
< label for = "is_downloadable" > < input ng-disabled = "isSaving" ng-change = "touchModel()" id = "is_downloadable" type = "checkbox" ng-model = "track.is_downloadable" / > Is Downloadable< / label >
< / div >
2016-05-20 01:08:57 +02:00
< div class = "col-md-4 form-row" >
2016-02-05 21:44:56 +01:00
< label for = "is_listed" > < input ng-disabled = "isSaving" ng-change = "touchModel()" id = "is_listed" type = "checkbox" ng-model = "track.is_listed" / > Is Listed< / label >
< / div >
< / div >
2016-05-20 16:15:10 +02:00
< div class = "row" ng-show = "isAdmin" >
2016-05-20 01:08:57 +02:00
< div class = "col-md-6 form-row" ng-class = "{'has-error': errors.username != null}" >
2016-05-18 02:27:59 +02:00
< label for = "title" class = "strong" > User:< / label >
< input ng-disabled = "isSaving" ng-change = "touchModel()" placeholder = "Username" type = "text" id = "username" ng-model = "track.username" / >
< div class = "error" > {{errors.username}}< / div >
< / div >
2016-05-16 00:03:49 +02:00
< / div >
2016-02-05 21:44:56 +01:00
< div class = "form-row" >
< label class = "strong" > Choose a License:< / label >
< ul class = "license-grid" >
2016-02-14 04:11:32 +01:00
< li ng-repeat = "license in taxonomies.licenses track by license.id" ng-class = "{selected: track.license_id == license.id}" >
2016-02-05 21:44:56 +01:00
< div ng-click = "track.license_id = license.id; touchModel()" >
2016-02-14 12:12:13 +01:00
< strong > {{::license.title}}< / strong >
< p > {{::license.description}}< / p >
2016-05-20 01:08:57 +02:00
< a href = "#" pfm-eat-click class = "btn btn-default" ng-class = "{'btn-primary': track.license_id == license.id, 'disabled': isSaving}" >
2016-02-05 21:44:56 +01:00
< span ng-hide = "track.license_id == license.id" > Select< / span >
< span ng-show = "track.license_id == license.id" > Selected< / span >
< / a >
< / div >
< / li >
< / ul >
< / div >
< / div >
< / form >