Merge pull request #73 from Poniverse/feature/optional_lyrics

Make lyrics optional, fixes #72
This commit is contained in:
Kelvin Zhang 2016-04-03 18:12:20 +01:00
commit 8a96945de9
2 changed files with 1 additions and 5 deletions

View file

@ -74,10 +74,6 @@ class EditTrackCommand extends CommandBase
'album_id' => 'exists:albums,id' 'album_id' => 'exists:albums,id'
]; ];
if ($isVocal) {
$rules['lyrics'] = 'required';
}
if (isset($this->_input['track_type_id']) && $this->_input['track_type_id'] == 2) { if (isset($this->_input['track_type_id']) && $this->_input['track_type_id'] == 2) {
$rules['show_song_ids'] = 'required|exists:show_songs,id'; $rules['show_song_ids'] = 'required|exists:show_songs,id';
} }

View file

@ -27,7 +27,7 @@
</div> </div>
<div class="span6 form-row" ng-class="{'has-error': errors.lyrics != null}"> <div class="span6 form-row" ng-class="{'has-error': errors.lyrics != null}">
<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> <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>
<textarea ng-disabled="isSaving" ng-change="touchModel()" ng-show="track.is_vocal" ng-animate="'fade'" placeholder="Lyrics (required)" id="lyrics" ng-model="track.lyrics"></textarea> <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>
<div class="error">{{errors.lyrics}}</div> <div class="error">{{errors.lyrics}}</div>
</div> </div>
</div> </div>