Disable publish checkbox for disconnected sources
This commit is contained in:
parent
0951afcbb3
commit
ea887dd8f6
3 changed files with 7 additions and 6 deletions
|
@ -78,11 +78,12 @@ class Application_Service_PublishService {
|
|||
* @param int $fileId the ID of the file to check
|
||||
*
|
||||
* @return int 1 if the file has been published to SoundCloud,
|
||||
* 0 if the file has yet to be published, or -1 if the
|
||||
* file is in a pending state
|
||||
* 0 if the file has yet to be published,
|
||||
* -1 if the file is in a pending state
|
||||
*/
|
||||
private static function getSoundCloudPublishStatus($fileId) {
|
||||
$soundcloudService = new Application_Service_SoundcloudService();
|
||||
if (!$soundcloudService->hasAccessToken()) { return 2; }
|
||||
return ($soundcloudService->referenceExists($fileId));
|
||||
}
|
||||
|
||||
|
|
|
@ -19,8 +19,9 @@
|
|||
<fieldset>
|
||||
<legend><?php echo _("Publish to:"); ?></legend>
|
||||
<div class="publish-sources" ng-repeat="source in sources.toPublish">
|
||||
<input ng-model="publishData[source.source]" type="checkbox" name="publish_sources" id="{{source.source}}">
|
||||
<label class="source-name" for="{{source.source}}">{{source.label}}</label><br/>
|
||||
<input ng-disabled="{{source.status == 2}}" ng-model="publishData[source.source]" type="checkbox" name="publish_sources" id="{{source.source}}">
|
||||
<label class="source-name" for="{{source.source}}">{{source.label}}</label>
|
||||
<span ng-if="source.status == 2" style="margin: auto"><?php echo _("You aren't connected to this source.") ?></span>
|
||||
</div>
|
||||
<div ng-if="sources.toPublish.length == 0">
|
||||
<?php echo _("You have already published this track to all available sources!") . "<br/>"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue