Merge pull request #18921 from woocommerce/update/18389-wizard-steps-improvements

Wizard: Going back and next steps
This commit is contained in:
Mike Jolley 2018-03-05 22:07:51 +00:00 committed by GitHub
commit c2519e9d7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 414 additions and 27 deletions

File diff suppressed because one or more lines are too long

165
assets/css/jquery-ui.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -334,6 +334,18 @@ body {
position: relative;
border-bottom: 4px solid #ccc;
line-height: 1.4em;
a {
color: #a16696;
text-decoration: none;
padding: 1.5em;
margin: -1.5em;
position: relative;
z-index: 1;
&:hover, &:focus {
color: #111;
text-decoration: underline;
}
}
}
li::before {
content: '';
@ -351,6 +363,7 @@ body {
li.active {
border-color: #a16696;
color: #a16696;
font-weight: bold;
&::before {
border-color: #a16696;
}
@ -367,6 +380,7 @@ body {
.wc-setup .wc-setup-actions {
overflow: hidden;
margin: 20px 0 0;
position: relative;
.button {
font-size: 1.25em;
padding: 0.5em 1em;
@ -400,7 +414,7 @@ body {
margin-top: 0;
}
.wc-return-to-dashboard {
.wc-setup-footer-links {
font-size: 0.85em;
color: #b5b5b5;
margin: 1.18em 0;
@ -972,7 +986,7 @@ h3.jetpack-reasons {
align-items: center;
.button {
margin: 1em;
margin: 1em 1.5em;
}
}
@ -996,6 +1010,26 @@ h3.jetpack-reasons {
font-weight: 600;
}
}
.wc-wizard-additional-steps {
border-top: 1px solid #eee;
.wc-wizard-next-step-description {
margin-bottom: 0;
}
.wc-setup-actions {
margin: 0 0 1.5em 0;
.button {
font-size: 15px;
margin: 1em 0 1em 1.5em;
}
.button::last-child {
margin-right: 1.5em;
}
}
}
}
p.next-steps-help-text {

View File

@ -285,11 +285,9 @@ class WC_Admin_Setup_Wizard {
public function setup_wizard_footer() {
?>
<?php if ( 'store_setup' === $this->step ) : ?>
<a class="wc-return-to-dashboard" href="<?php echo esc_url( admin_url() ); ?>"><?php esc_html_e( 'Not right now', 'woocommerce' ); ?></a>
<?php elseif ( 'next_steps' === $this->step ) : ?>
<a class="wc-return-to-dashboard" href="<?php echo esc_url( admin_url() ); ?>"><?php esc_html_e( 'Return to your dashboard', 'woocommerce' ); ?></a>
<?php elseif ( 'activate' === $this->step || 'extras' === $this->step ) : ?>
<a class="wc-return-to-dashboard" href="<?php echo esc_url( $this->get_next_step_link() ); ?>"><?php esc_html_e( 'Skip this step', 'woocommerce' ); ?></a>
<a class="wc-setup-footer-links" href="<?php echo esc_url( admin_url() ); ?>"><?php esc_html_e( 'Not right now', 'woocommerce' ); ?></a>
<?php elseif ( 'activate' === $this->step ) : ?>
<a class="wc-setup-footer-links" href="<?php echo esc_url( $this->get_next_step_link() ); ?>"><?php esc_html_e( 'Skip this step', 'woocommerce' ); ?></a>
<?php endif; ?>
</body>
</html>
@ -300,19 +298,20 @@ class WC_Admin_Setup_Wizard {
* Output the steps.
*/
public function setup_wizard_steps() {
$output_steps = $this->steps;
?>
<ol class="wc-setup-steps">
<?php foreach ( $output_steps as $step_key => $step ) : ?>
<li class="
<?php
if ( $step_key === $this->step ) {
echo 'active';
} elseif ( array_search( $this->step, array_keys( $this->steps ), true ) > array_search( $step_key, array_keys( $this->steps ), true ) ) {
echo 'done';
}
?>
"><?php echo esc_html( $step['name'] ); ?></li>
<?php foreach ( $this->steps as $step_key => $step ) :
$is_completed = array_search( $this->step, array_keys( $this->steps ), true ) > array_search( $step_key, array_keys( $this->steps ), true );
if ( $step_key === $this->step ) : ?>
<li class="active"><?php echo esc_html( $step['name'] ); ?></li>
<?php elseif ( $is_completed ) : ?>
<li class="done">
<a href="<?php echo esc_url( add_query_arg( 'step', $step_key, remove_query_arg( 'activate_error' ) ) ) ?>"><?php echo esc_html( $step['name'] ); ?></a>
</li>
<?php else : ?>
<li><?php echo esc_html( $step['name'] ); ?></li>
<?php endif; ?>
<?php endforeach; ?>
</ol>
<?php
@ -798,14 +797,20 @@ class WC_Admin_Setup_Wizard {
$currency_code = get_woocommerce_currency();
$wcs_carrier = $this->get_wcs_shipping_carrier( $country_code, $currency_code );
$existing_zones = WC_Shipping_Zones::get_zones();
$dimension_unit = get_option( 'woocommerce_dimension_unit' );
$weight_unit = get_option( 'woocommerce_weight_unit' );
$locale_info = include WC()->plugin_path() . '/i18n/locale-info.php';
if ( isset( $locale_info[ $country_code ] ) ) {
$dimension_unit = $locale_info[ $country_code ]['dimension_unit'];
if ( ! $weight_unit && isset( $locale_info[ $country_code ] ) ) {
$weight_unit = $locale_info[ $country_code ]['weight_unit'];
} else {
$dimension_unit = 'cm';
$weight_unit = 'kg';
$weight_unit = $weight_unit ? $weight_unit : 'kg';
}
if ( ! $dimension_unit && isset( $locale_info[ $country_code ] ) ) {
$dimension_unit = $locale_info[ $country_code ]['dimension_unit'];
} else {
$dimension_unit = $dimension_unit ? $dimension_unit : 'cm';
}
if ( ! empty( $existing_zones ) ) {
@ -1940,6 +1945,24 @@ class WC_Admin_Setup_Wizard {
</p>
</div>
</li>
<li class="wc-wizard-additional-steps">
<div class="wc-wizard-next-step-description">
<p class="next-step-heading"><?php esc_html_e( 'You can also:', 'woocommerce' ); ?></p>
</div>
<div class="wc-wizard-next-step-action">
<p class="wc-setup-actions step">
<a class="button button-large" href="<?php echo esc_url( admin_url() ); ?>">
<?php esc_html_e( 'Visit Dashboard', 'woocommerce' ); ?>
</a>
<a class="button button-large" href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings' ) ); ?>">
<?php esc_html_e( 'Review Settings', 'woocommerce' ); ?>
</a>
<a class="button button-large" href="<?php echo esc_url( add_query_arg( array( 'autofocus' => array( 'panel' => 'woocommerce' ), 'url' => wc_get_page_permalink( 'shop' ) ), admin_url( 'customize.php' ) ) ); ?>">
<?php esc_html_e( 'View &amp; Customize', 'woocommerce' ); ?>
</a>
</p>
</div>
</li>
</ul>
<p class="next-steps-help-text"><?php echo wp_kses_post( $help_text ); ?></p>
<?php