Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move playlist notice and add check for other notices #371

Merged
merged 5 commits into from
Feb 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading