Skip to content

Commit

Permalink
Feature/7161 add new pod screen UI enhancement (#7230)
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0ttkclark authored Sep 10, 2024
2 parents add2f75 + acb09ab commit 2cc4c83
Show file tree
Hide file tree
Showing 8 changed files with 235 additions and 101 deletions.
11 changes: 11 additions & 0 deletions classes/PodsMeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -2949,6 +2949,16 @@ public function is_type_covered( $type, $object_name = null ) {
'wp_navigation' => true,
'wp_template' => true,
'wp_template_part' => true,
'wp_font_face' => true,
'wp_font_family' => true,
// Disable ACF post types.
'acf-taxonomy' => true,
'acf-post-type' => true,
'acf-field-group' => true,
'acf-field' => true,
// Disable Advanced views.
'acf_views' => true,
'acf_cards' => true,
// Disable Beaver Builder post types.
'fl-theme-layout' => true,
'fl-builder-template' => true,
Expand All @@ -2973,6 +2983,7 @@ public function is_type_covered( $type, $object_name = null ) {
'post_format' => true,
'wp_theme' => true,
'wp_template_part_area' => true,
'wp_pattern_category' => true,
// Disable Beaver Builder taxonomies.
'fl-builder-template-category' => true,
'fl-builder-template-type' => true,
Expand Down
89 changes: 49 additions & 40 deletions ui/admin/setup-add.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@
<div id="pods-wizard-heading">
<ul>
<li class="pods-wizard-menu-current" data-step="1">
<i></i> <span>1</span> <?php esc_html_e( 'Create or Extend', 'pods' ); ?>
<i></i> <span>1</span> <?php esc_html_e( 'Step 1: Create or Extend', 'pods' ); ?>
<em></em>
</li>
<li data-step="2">
<i></i> <span>2</span> <?php esc_html_e( 'Configure', 'pods' ); ?>
<i></i> <span>2</span> <?php esc_html_e( 'Step 2: Configure', 'pods' ); ?>
<em></em>
</li>
</ul>
Expand All @@ -131,51 +131,49 @@
<br /><br />
<?php _e( 'Not sure what content type you should use? Check out our <a href="https://docs.pods.io/creating-editing-pods/compare-content-types/" target="_blank" rel="noopener noreferrer">Content Type Comparison</a> to help you decide.', 'pods' ); ?>
</p>

<?php if ( ! empty( $quick_actions ) ) : ?>
<div id="pods-wizard-quick-actions"<?php echo ( $submit_from_linked ? ' class="hidden"' : '' ); ?>>
<h3><?php esc_html_e( 'One-Click Quick Actions', 'pods' ); ?></h3>

<ul class="normal">
<?php foreach ( $quick_actions as $quick_action_key => $quick_action ) : ?>
<li>
<a href="#<?php echo sanitize_title( $quick_action['create_extend'] . '-' . $quick_action['type'] . '-' . $quick_action['object'] ); ?>"
data-create-extend="<?php echo esc_attr( $quick_action['create_extend'] ); ?>"
data-object="<?php echo esc_attr( $quick_action['object'] ); ?>"
data-type="<?php echo esc_attr( $quick_action['type'] ); ?>"
class="pods-wizard-quick-action"
id="pods-wizard-quick-action-<?php echo esc_attr( $quick_action_key ); ?>"
>
<?php echo esc_html( $quick_action['label'] ); ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</div>

<div id="pods-wizard-quick-actions-saving-in-progress"<?php echo ( ! $submit_from_linked ? ' class="hidden"' : '' ); ?>>
<p><span class="pods-dfv-field__loading-indicator" role="progressbar"></span> <?php esc_html_e( 'Creating your Extended Pod', 'pods' ); ?></p>
</div>
<?php endif; ?>
</div>
<div id="pods-wizard-options">
<h3><?php esc_html_e( 'Add New Pod Wizard', 'pods' ); ?></h3>

<div class="pods-wizard-options-list">
<div class="pods-wizard-option">
<a href="#pods-wizard-create" data-opt="create">
<h2><?php esc_html_e( 'Create New', 'pods' ); ?> &raquo;</h2>

<p><?php _e( 'Create entirely new content types using <strong>Post Types</strong>, <strong>Taxonomies</strong>, or <strong>Custom Settings Pages</strong>.', 'pods' ); ?></p>
<div>
<h2><?php esc_html_e( 'Create a new Content Type', 'pods' ); ?></h2>
<p><?php _e( 'Create entirely new content types using <strong>Post Types</strong>, <strong>Taxonomies</strong>, or <strong>Custom Settings Pages</strong>.', 'pods' ); ?></p>
</div>
<span>&#10095;</span>
</a>
</div>

<div class="pods-wizard-option">
<a href="#pods-wizard-extend" data-opt="extend">
<h2><?php esc_html_e( 'Extend Existing', 'pods' ); ?> &raquo;</h2>

<p><?php _e( 'Extend any existing content type within WordPress, including <strong>Post Types</strong> (Posts, Pages, etc), <strong>Taxonomies</strong> (Categories, Tags, etc), <strong>Media</strong>, <strong>Users</strong>, or <strong>Comments</strong>.', 'pods' ); ?></p>
<div>
<h2><?php esc_html_e( 'Extend an existing Content Type', 'pods' ); ?></h2>
<p><?php _e( 'Extend any existing content type within WordPress, including <strong>Post Types</strong> (Posts, Pages, etc), <strong>Taxonomies</strong> (Categories, Tags, etc), <strong>Media</strong>, <strong>Users</strong>, or <strong>Comments</strong>.', 'pods' ); ?></p>
</div>
<span>&#10095;</span>
</a>

<?php if ( ! empty( $quick_actions ) ) : ?>
<div id="pods-wizard-quick-actions"
<?php echo( $submit_from_linked ? 'class="hidden"' : '' ); ?>>
<h2 class="pods-wizard-one-click-actions-heading"><?php esc_html_e( 'One-Click Extend', 'pods' ); ?></h2>
<ul class="pods-wizard-one-click-actions">
<?php foreach ( $quick_actions as $quick_action_key => $quick_action ) : ?>
<li class="pods-wizard-one-click-action">
<a href="#<?php echo sanitize_title( $quick_action['create_extend'] . '-' . $quick_action['type'] . '-' . $quick_action['object'] ); ?>"
data-create-extend="<?php echo esc_attr( $quick_action['create_extend'] ); ?>"
data-object="<?php echo esc_attr( $quick_action['object'] ); ?>"
data-type="<?php echo esc_attr( $quick_action['type'] ); ?>"
class="pods-wizard-quick-action"
id="pods-wizard-quick-action-<?php echo esc_attr( $quick_action_key ); ?>"
>
<?php echo esc_html( $quick_action['label'] ); ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
</div>
</div>
</div>
Expand Down Expand Up @@ -569,6 +567,14 @@ class="pods-wizard-quick-action"
</div>
</div>
</div>

<div id="pods-wizard-quick-actions-saving-in-progress"
<?php echo( ! $submit_from_linked ? 'class="hidden"' : '' ); ?>>
<p>
<span class="pods-dfv-field__loading-indicator" role="progressbar"></span>
<?php esc_html_e( 'Setting up your Extended Pod', 'pods' ); ?>
</p>
</div>
</div>

<div id="pods-wizard-actions" class="pods-wizard-button-interface">
Expand Down Expand Up @@ -601,7 +607,9 @@ class="pods-wizard-quick-action"
alert( 'Error: ' + err_msg );
if ( window.console ) console.log( err_msg );

jQuery( '#pods-wizard-quick-actions-saving-in-progress' ).hide();
jQuery( '#pods-wizard-quick-actions-saving-in-progress' ).addClass('hidden').hide();
jQuery( '#pods-wizard-start' ).click();
jQuery( '#pods-wizard-next' ).removeClass('hidden').show();
};

var pods_admin_option_select_callback = function ( $opt ) {
Expand Down Expand Up @@ -633,16 +641,17 @@ class="pods-wizard-quick-action"
jQuery( '#pods-form-ui-' + createExtend + '-pod-type' ).val( objectType );
jQuery( '#pods-form-ui-' + createExtend + '-' + objectType.replace( '_', '-' ) ).val( objectName );

jQuery( '#pods-wizard-heading li' ).removeClass().addClass('pods-wizard-menu-complete');
jQuery( '#pods-wizard-next' ).addClass('hidden').hide();
jQuery( '#pods-wizard-quick-actions-saving-in-progress' ).removeClass('hidden').show();

$action.closest( 'form' ).submit();
} );

<?php if ( $submit_from_linked ) : ?>
jQuery( '#pods-wizard-quick-action-<?php echo esc_attr( $submit_from_linked ); ?>' ).click();

$quick_actions.off( 'click' );

jQuery( '#pods-wizard-quick-actions' ).hide();
jQuery( '#pods-wizard-quick-actions-saving-in-progress' ).show();
<?php endif; ?>
}
} );
Expand Down
2 changes: 1 addition & 1 deletion ui/js/blocks/pods-blocks-api.min.asset.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"dependencies":["lodash","react","react-dom","wp-api-fetch","wp-autop","wp-block-editor","wp-blocks","wp-components","wp-compose","wp-date","wp-element","wp-i18n","wp-keycodes","wp-server-side-render","wp-url"],"version":"74e7329c36abb1a485a0"}
{"dependencies":["lodash","react","react-dom","wp-api-fetch","wp-autop","wp-block-editor","wp-blocks","wp-components","wp-compose","wp-date","wp-element","wp-i18n","wp-keycodes","wp-server-side-render","wp-url"],"version":"e4dd30ce893e9c448705"}
2 changes: 1 addition & 1 deletion ui/js/blocks/pods-blocks-api.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ui/js/dfv/pods-dfv.min.asset.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"dependencies":["lodash","moment","react","react-dom","react-jsx-runtime","regenerator-runtime","wp-api-fetch","wp-autop","wp-components","wp-compose","wp-data","wp-element","wp-hooks","wp-i18n","wp-keycodes","wp-plugins","wp-primitives","wp-url"],"version":"6c3b89ffe8da2dcd1d1f"}
{"dependencies":["lodash","moment","react","react-dom","react-jsx-runtime","regenerator-runtime","wp-api-fetch","wp-autop","wp-components","wp-compose","wp-data","wp-element","wp-hooks","wp-i18n","wp-keycodes","wp-plugins","wp-primitives","wp-url"],"version":"a5ca5125b2a394cb0bdb"}
2 changes: 1 addition & 1 deletion ui/js/dfv/pods-dfv.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ui/styles/dist/pods-wizard.css

Large diffs are not rendered by default.

Loading

0 comments on commit 2cc4c83

Please sign in to comment.