forked from woocommerce/woocommerce
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LYS] Try single coming soon template (woocommerce#46508)
* Create single coming soon template * add template/template too * delete comment * Adjust redirect logic * CSS selectors * Add changefile(s) from automation for the following project(s): woocommerce * fix titles * Skip tests * lint errors --------- Co-authored-by: github-actions <[email protected]> Co-authored-by: Adrian Duffell <[email protected]>
- Loading branch information
1 parent
bed3124
commit 5e8644d
Showing
11 changed files
with
208 additions
and
23 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
plugins/woocommerce/changelog/46508-try-LYS-coming-soon-template-only
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: add | ||
Comment: Change to unreleased feature | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<?php | ||
/** | ||
* Title: Coming Soon Entire Site | ||
* Slug: woocommerce/coming-soon-entire-site | ||
* Categories: WooCommerce | ||
* | ||
* @package WooCommerce\Blocks | ||
*/ | ||
|
||
?> | ||
|
||
<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"20px","bottom":"20px"}},"color":{"background":"#bea0f2"}},"layout":{"type":"constrained"}} --> | ||
<div class="wp-block-group alignwide has-background" style="background-color:#bea0f2;padding-top:20px;padding-bottom:20px"><!-- wp:group {"align":"wide","layout":{"type":"flex","justifyContent":"space-between","flexWrap":"wrap"}} --> | ||
<div class="wp-block-group alignwide"><!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|20"},"layout":{"selfStretch":"fit","flexSize":null}},"layout":{"type":"flex"}} --> | ||
<div class="wp-block-group"><!-- wp:site-logo {"width":60} /--> | ||
|
||
<!-- wp:group {"style":{"spacing":{"blockGap":"0px"}}} --> | ||
<div class="wp-block-group"><!-- wp:site-title {"level":0} /--></div> | ||
<!-- /wp:group --></div> | ||
<!-- /wp:group --> | ||
|
||
<!-- wp:group {"style":{"spacing":{"blockGap":"48px"}},"className":"woocommerce-coming-soon-social-login","layout":{"type":"flex","flexWrap":"nowrap"}} --> | ||
<div class="wp-block-group woocommerce-coming-soon-social-login"><!-- wp:social-links {"iconColor":"contrast","iconColorValue":"#111111","style":{"layout":{"selfStretch":"fit","flexSize":null},"spacing":{"blockGap":{"left":"18px"}}},"className":"is-style-logos-only"} --> | ||
<ul class="wp-block-social-links has-icon-color is-style-logos-only"><!-- wp:social-link {"url":"https://www.linkedin.com/","service":"linkedin"} /--> | ||
|
||
<!-- wp:social-link {"url":"https://www.instagram.com","service":"instagram"} /--> | ||
|
||
<!-- wp:social-link {"url":"https://www.facebook.com","service":"facebook"} /--></ul> | ||
<!-- /wp:social-links --> | ||
|
||
<!-- wp:loginout /--></div> | ||
<!-- /wp:group --></div> | ||
<!-- /wp:group --></div> | ||
<!-- /wp:group --> | ||
<!-- wp:spacer {"height":"25px"} --> | ||
<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div> | ||
<!-- /wp:spacer --> | ||
<!-- wp:group {"className":"woocommerce-coming-soon-banner-container","layout":{"type":"constrained"}} --> | ||
<div class="wp-block-group woocommerce-coming-soon-banner-container"><!-- wp:heading {"textAlign":"center","level":1,"align":"wide","className":"woocommerce-coming-soon-banner"} --> | ||
<h1 class="wp-block-heading alignwide has-text-align-center woocommerce-coming-soon-banner"><?php echo esc_html__( 'Pardon our dust! We\'re working on something amazing -- check back soon!', 'woocommerce' ); ?></h1> | ||
<!-- /wp:heading --></div> | ||
<!-- /wp:group --> | ||
<!-- wp:group {"style":{"spacing":{"padding":{"top":"var:preset|spacing|30","bottom":"var:preset|spacing|10"}}},"className":"woocommerce-coming-soon-powered-by-woo","layout":{"type":"constrained"}} --> | ||
<div class="wp-block-group woocommerce-coming-soon-powered-by-woo" style="padding-top:var(--wp--preset--spacing--30);padding-bottom:var(--wp--preset--spacing--10)"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"var:preset|spacing|30","bottom":"0"}}}} --> | ||
<div class="wp-block-group alignwide" style="padding-top:var(--wp--preset--spacing--30);padding-bottom:0"><!-- wp:paragraph {"align":"center","style":{"elements":{"link":{"color":{"text":"var:preset|color|contrast"}}}},"textColor":"contrast-2","fontSize":"small"} --> | ||
<p class="has-text-align-center has-contrast-2-color has-text-color has-link-color has-small-font-size"> | ||
Powered by | ||
<a style="text-decoration: none;" href="https://woocommerce.com" rel="nofollow">WooCommerce</a> | ||
</p> | ||
<!-- /wp:paragraph --></div> | ||
<!-- /wp:group --></div> | ||
<!-- /wp:group --> | ||
|
||
<style> | ||
body { | ||
background-color: #bea0f2; | ||
} | ||
.wp-block-loginout { | ||
background-color: #000000; | ||
padding: 7px 17px; | ||
border-radius: 6px; | ||
} | ||
.wp-block-loginout a { | ||
color: #ffffff; | ||
text-decoration: none; | ||
line-height: 17px; | ||
font-size: 14px; | ||
font-weight: 500; | ||
} | ||
.woocommerce-coming-soon-powered-by-woo { | ||
position: fixed; | ||
bottom: 0; | ||
left: 0; | ||
width: 100%; | ||
} | ||
body .is-layout-constrained > .woocommerce-coming-soon-banner.alignwide { | ||
max-width: 820px; | ||
} | ||
.woocommerce-coming-soon-banner-container { | ||
width: 100%; | ||
position: absolute; | ||
top: 50%; | ||
transform: translateY(-50%); | ||
} | ||
.woocommerce-coming-soon-banner { | ||
font-size: 48px; | ||
font-weight: 400; | ||
line-height: 58px; | ||
} | ||
</style> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
/** | ||
* Title: Coming Soon Store Only | ||
* Slug: woocommerce/coming-soon-store-only | ||
* Categories: WooCommerce | ||
* | ||
* @package WooCommerce\Blocks | ||
*/ | ||
|
||
?> | ||
|
||
<!-- wp:template-part {"slug":"header","tagName":"header"} /--> | ||
<!-- wp:group {"layout":{"type":"constrained"}} --> | ||
<div class="wp-block-group"><!-- wp:spacer --> | ||
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div> | ||
<!-- /wp:spacer --> | ||
|
||
<!-- wp:heading {"textAlign":"center","level":1} --> | ||
<h1 class="wp-block-heading has-text-align-center"><?php echo esc_html__( 'Great things coming soon', 'woocommerce' ); ?></h1> | ||
<!-- /wp:heading --> | ||
|
||
<!-- wp:spacer {"height":"10px"} --> | ||
<div style="height:10px" aria-hidden="true" class="wp-block-spacer"></div> | ||
<!-- /wp:spacer --> | ||
|
||
<!-- wp:paragraph {"align":"center"} --> | ||
<p class="has-text-align-center"><?php echo esc_html__( 'Something big is brewing! Our store is in the works - Launching shortly!', 'woocommerce' ); ?></p> | ||
<!-- /wp:paragraph --> | ||
|
||
<!-- wp:spacer --> | ||
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div> | ||
<!-- /wp:spacer --></div> | ||
<!-- /wp:group --> | ||
<!-- wp:template-part {"slug":"footer","tagName":"footer"} /--> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
/** | ||
* Title: Coming Soon | ||
* Slug: woocommerce/coming-soon | ||
* Categories: WooCommerce | ||
* | ||
* @package WooCommerce\Blocks | ||
*/ | ||
|
||
$store_pages_only = 'yes' === get_option( 'woocommerce_store_pages_only', 'no' ); | ||
?> | ||
|
||
<!-- wp:pattern {"slug":"woocommerce/<?php echo $store_pages_only ? 'coming-soon-store-only' : 'coming-soon-entire-site'; ?>"} /--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
plugins/woocommerce/src/Blocks/Templates/ComingSoonTemplate.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
namespace Automattic\WooCommerce\Blocks\Templates; | ||
|
||
/** | ||
* ComingSoonTemplate class. | ||
* | ||
* @internal | ||
*/ | ||
class ComingSoonTemplate extends AbstractPageTemplate { | ||
|
||
/** | ||
* The slug of the template. | ||
* | ||
* @var string | ||
*/ | ||
const SLUG = 'coming-soon'; | ||
|
||
/** | ||
* Returns the title of the template. | ||
* | ||
* @return string | ||
*/ | ||
public function get_template_title() { | ||
return _x( 'Page: Coming soon', 'Template name', 'woocommerce' ); | ||
} | ||
|
||
/** | ||
* Returns the description of the template. | ||
* | ||
* @return string | ||
*/ | ||
public function get_template_description() { | ||
return __( 'Page template for Coming soon page.', 'woocommerce' ); | ||
} | ||
|
||
/** | ||
* Returns the page object assigned to this template/page. | ||
* | ||
* @return \WP_Post|null Post object or null. | ||
*/ | ||
protected function get_placeholder_page() { | ||
$page_id = get_option( 'woocommerce_coming_soon_page_id' ); | ||
return $page_id ? get_post( $page_id ) : null; | ||
} | ||
|
||
/** | ||
* True when viewing the coming soon page. | ||
* | ||
* @return boolean | ||
*/ | ||
protected function is_active_template() { | ||
global $post; | ||
$placeholder = $this->get_placeholder_page(); | ||
return null !== $placeholder && $post instanceof \WP_Post && $placeholder->post_name === $post->post_name; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
plugins/woocommerce/templates/templates/blockified/coming-soon.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!-- wp:pattern {"slug":"woocommerce/coming-soon"} /--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!-- wp:pattern {"slug":"woocommerce/coming-soon"} /--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters