Skip to content

Commit

Permalink
Merge pull request #371 from 10up/fix/346
Browse files Browse the repository at this point in the history
Move playlist notice  and add check for other notices
  • Loading branch information
MARQAS authored Feb 21, 2024
2 parents ebbc296 + 3054350 commit 16a58aa
Showing 1 changed file with 40 additions and 24 deletions.
64 changes: 40 additions & 24 deletions includes/admin/class-bc-templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,24 @@ public function __construct() {
* Adds all templates for Backbone application
*/
public function add_templates() {
global $pagenow;
?>

<?php /* Used by views/media-manager.js */ ?>
<script type="text/html" id="tmpl-brightcove-media">
<div id="brightcove-media-frame-router" class="brightcove media-frame-router"></div>
<?php if ( 'admin.php' === $pagenow ) : ?>
<div class="brightcove brightcove-notices">
<# if( data.mediaType === 'playlists' ) { #>
<div class="notice notice-warning">
<p>
<?php esc_html_e( 'Please note that you can create new playlists only from Brightcove.', 'brightcove' ); ?>
</p>
</div>
<# } #>
</div>
<?php endif; ?>
<div id="brightcove-media-frame-router" class="brightcove media-frame-router">
</div>
<div class="brightcove-message message hidden"></div>
<div id="brightcove-media-frame-content" class="brightcove media-frame-content">
<span id="js-media-loading" class="spinner"></span>
Expand Down Expand Up @@ -1275,34 +1288,37 @@ class="brightcove-datetime brightcove-end-date"
<# }); #>
</select>
<# }#>
<?php if ( in_array( $pagenow, array( 'post.php', 'post-new.php' ), true ) ) : ?>
<# if( data.mediaType === 'videoexperience' ) { #>
<div class="notice notice-warning">
<p>
<?php esc_html_e( 'Please note that you can create new Experiences only from Brightcove.', 'brightcove' ); ?>
</p>
</div>
<div class="notice notice-warning">
<p>
<?php esc_html_e( 'Leave videos unselected for default Experience behavior.', 'brightcove' ); ?>
</p>
</div>
<# } #>

<# if( data.mediaType === 'videoexperience' ) { #>
<div class="notice notice-warning">
<p>
<?php esc_html_e( 'Please note that you can create new Experiences only from Brightcove.', 'brightcove' ); ?>
</p>
</div>
<div class="notice notice-warning">
<p>
<?php esc_html_e( 'Leave videos unselected for default Experience behavior.', 'brightcove' ); ?>
</p>
</div>
<# } #>

<# if ( data.mediaType === 'playlistexperience' ) { #>
<div class="notice notice-warning">
<p>
<?php esc_html_e( 'Please note that you can create new Experiences only from Brightcove.', 'brightcove' ); ?>
</p>
</div>
<# } #>

<# if( data.mediaType === 'playlists' || data.mediaType === 'playlistexperience' ) { #>
<# if ( data.mediaType === 'playlistexperience' ) { #>
<div class="notice notice-warning">
<p>
<?php esc_html_e( 'Please note that you can create new playlists only from Brightcove.', 'brightcove' ); ?>
<?php esc_html_e( 'Please note that you can create new Experiences only from Brightcove.', 'brightcove' ); ?>
</p>
</div>
<# } #>

<# if( data.mediaType === 'playlists' ) { #>
<div class="notice notice-warning">
<p>
<?php esc_html_e( 'Please note that you can create new playlists only from Brightcove.', 'brightcove' ); ?>
</p>
</div>
<# } #>
<?php endif; ?>
<# if( data.mediaType === 'playlists' || data.mediaType === 'playlistexperience' ) { #>
<p>
<input type="checkbox" name="brightcove-empty-playlists" id="brightcove-empty-playlists" class="brightcove-empty-playlists attachment-filters">
<label for="brightcove-empty-playlists"><?php esc_html_e( 'Hide Empty Playlists', 'brightcove' ); ?></label>
Expand Down

0 comments on commit 16a58aa

Please sign in to comment.