Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

36 - Single product template #39

Merged
merged 29 commits into from
Apr 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e4f82c1
36 - Single product HTML
mehigh Apr 15, 2018
9d60672
Start adding theme implementation for single-adventure.php
miina Apr 16, 2018
dcb8d4b
Fix phpcs.
miina Apr 16, 2018
4157d49
Fix CS.
miina Apr 16, 2018
a1f0c89
Add method comment.
miina Apr 16, 2018
2b9645a
Merge develop & resolve conflicts.
miina Apr 17, 2018
e2ea438
Add functionality for comments. Refactor templates.
miina Apr 17, 2018
ae3ac4d
Add nonce based on default comments saving. Show rating empty by defa…
miina Apr 17, 2018
c5efef8
Add ampState for price.
miina Apr 17, 2018
0d6065f
Merge in develop, delete editor-blocks.js.
kienstra Apr 18, 2018
fced3dc
36 - top hero carousel
mehigh Apr 18, 2018
2e29d94
36 - Product details adjustments for responsiveness
mehigh Apr 18, 2018
b656c60
36 - Sticky call to action
mehigh Apr 18, 2018
7877b24
36 - updated CSS for single product
mehigh Apr 18, 2018
338e9a6
36 - copied images from ampstart travel template
mehigh Apr 18, 2018
820e9d5
36 - fixed validation error
mehigh Apr 18, 2018
6c468a9
Template updates.
miina Apr 18, 2018
fac3f4a
Merge branch 'feature/36-adventure-single' of github.com:xwp/travel i…
miina Apr 18, 2018
f3a1fcb
Add sticky CTA.
miina Apr 18, 2018
57868cf
Fixes from review.
miina Apr 18, 2018
6057eba
Fix popular posts.
miina Apr 18, 2018
0c4e472
Fix popular posts.
miina Apr 18, 2018
98ec3ee
Fix phpcs.
miina Apr 18, 2018
6194fd3
36 - Added a class to work around the calc
mehigh Apr 18, 2018
808d91f
36 - added workaround to failing calc styles
mehigh Apr 18, 2018
3ea4b0a
Merge branch 'feature/36-adventure-single' of github.com:xwp/travel i…
mehigh Apr 18, 2018
6c9617d
Add esc_html to address Travis issue.
kienstra Apr 18, 2018
bc3970c
Style fixes.
miina Apr 18, 2018
b945550
Merge branch 'feature/36-adventure-single' of github.com:xwp/travel i…
miina Apr 18, 2018
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
5 changes: 5 additions & 0 deletions assets/css/adventure.css

Large diffs are not rendered by default.

487 changes: 487 additions & 0 deletions assets/html/product.html

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions comments.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php
/**
* Comments template.
*
* @package WPAMPTheme
*/

/*
* If the current post is protected by a password and
* the visitor has not yet entered the password we will
* return early without loading the comments.
*/
if ( post_password_required() ) {
return;
}

Copy link
Contributor

@kienstra kienstra Apr 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is outside this PR's diff, but could you please add 'comments' to the 'adventure' CPT 'supports' argument? I think this is blocking the "Popular Adventures" block from displaying, as you can't add ratings (comments) to the 'adventure' post type.

$reviews = wp_count_comments( get_the_ID() );
?>

<div class="product-reviews">

<h2 class="mb3"><?php esc_html_e( 'Reviews', 'travel' ); ?></h2>

<div class="comments wrap__item">

<?php $sort_attr = ( 'asc' === get_option( 'comment_order' ) ) ? ' sort="ascending" ' : ''; ?>
<amp-live-list id="amp-live-comments-list-<?php the_ID(); ?>" class="live-list" layout="container" <?php echo $sort_attr; // WPCS: XSS OK. ?> data-poll-interval="<?php echo esc_attr( AMP_TRAVEL_LIVE_LIST_POLL_INTERVAL ); ?>" data-max-items-per-page="<?php echo esc_attr( get_option( 'page_comments' ) ? get_option( 'comments_per_page' ) : 10000 ); ?>">
<ol items class="comments__list">
<?php
wp_list_comments( array(
'style' => 'ol',
'short_ping' => true,
) );
?>
</ol><!-- .comment-list -->
<div update class="live-list__button">
<button class="button" on="tap:amp-live-comments-list-<?php the_ID(); ?>.update"><?php esc_html_e( 'New review(s)', 'travel' ); ?></button>
</div>
<nav pagination>
<?php the_comments_navigation(); ?>
</nav>
</amp-live-list>

<?php if ( ! comments_open() ) : ?>
<p class="no-comments"><?php esc_html_e( 'Reviews are closed.', 'travel' ); ?></p>
<?php endif; ?>

<?php
// Warning: If you supply title_reply_before/title_reply_after here then the comment_form_defaults filter won't be able to inject the necessary markup for AMP.
comment_form();
?>

</div>

</div>
<!-- / product-reviews -->
81 changes: 81 additions & 0 deletions footer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?php
/**
* Theme footer template.
*
* @todo Create proper footer template(s).
* @package WPAMPTheme
*/

// Ignore the issues of this file since that's just a copied HTML placeholder.
Copy link
Contributor

@kienstra kienstra Apr 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though this footer.php is only a placeholder, it looks good. We could work on dynamic data later, at least after the screencast this Thursday.

// @codingStandardsIgnoreFile
?>
<!-- Footer -->
<footer class="travel-footer overflow-hidden">

<div class="relative bg-black">

<!-- Angle -->
<div class="travel-footer-angle-block absolute top-0 bottom-0 right-0 xs-hide sm-hide"></div>
<div class="travel-footer-angle absolute xs-hide sm-hide"></div>
<!--/ Angle -->

<!-- Right column -->
<div class="travel-newsletter-signup">
<header class="max-width-3 mx-auto px1 md-px2">
<h4 class="travel-footer-right-column-heading travel-spacing-none h2 mb3 blue">Want travel deals<br>straight to your inbox?</h4>
<div class="h4 bold mb1">Sign up to our newsletter</div>
</header>
<div class="relative">
<div class="travel-footer-input-bg bg-black absolute right-0 left-0 md-hide lg-hide"></div>
<div class="max-width-3 mx-auto px1 md-px2 relative">
<div class="travel-input-group flex items-center col-12 rounded travel-shadow">
<input class="travel-input travel-input-big block col-12 flex-auto rounded-left" type="text" name="email" placeholder="Enter your email">
<span class="travel-input-group-sep travel-border-gray relative z1 block"></span>
<button type="button" class="travel-link travel-input-big nowrap rounded-right">
Sign up now
</button>
</div>
</div>
</div>
</div>
<!--/ Right column -->

<!-- Left column -->
<div class="max-width-3 mx-auto px1 md-px2">
<div class="flex pt3 md-pt4 col-12 md-col-6 pr3">
<div class="col-2">
<a href="travel.amp" class="inline-block h2 line-height-1 circle white">
<svg class="travel-icon travel-icon-logo h2" viewBox="0 0 100 100"><g fill="none" fill-rule="evenodd" stroke="currentColor" stroke-width="7.5"><circle cx="50" cy="50" r="45"></circle><path d="M20.395 83.158c-2.37-10.263-.79-18.553 4.737-24.87 8.29-9.472 17.763-1.183 26.052-9.472 8.29-8.29 2.37-18.948 10.658-26.053 5.526-4.737 12.237-6.316 20.132-4.737M39.084 95c-2.788-10.2-1.912-17.304 2.627-21.316 6.808-6.017 14.956-.68 24.088-9.623 9.13-8.94 3.062-17.133 10.255-23.534 4.795-4.267 10.282-5.668 16.46-4.203"></path></g></svg> </a>
</div>
<div class="col-5">
<h4 class="travel-spacing-none mb2 h3 gray bold">Company</h4>
<div class="line-height-4 mb4">
<a href="#" class="travel-link block gray">About</a>
<a href="#" class="travel-link block gray">Careers</a>
<a href="#" class="travel-link block gray">Contact</a>
</div>
</div>
<div class="col-5">
<h4 class="travel-spacing-none mb2 h3 gray bold">Discover</h4>
<div class="line-height-4 mb4">
<a href="#" class="travel-link block gray">Activities</a>
<a href="#" class="travel-link block gray">Tours</a>
<a href="#" class="travel-link block gray">Experiences</a>
<a href="#" class="travel-link block gray">Featured Adventures</a>
<a href="#" class="travel-link block gray">Search</a>
</div>
</div>
</div>
<div class="py3 gray">
&copy; Copyright 2018
</div>
</div>
<!--/ Left column -->
</div>
</footer>
<!--/ Footer -->
<?php wp_footer(); ?>

</section>
</body>
</html>
45 changes: 45 additions & 0 deletions header.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php
/**
* Theme header template.
*
* @todo Create proper header template(s).
* @package WPAMPTheme
*/

?>
<!doctype html>
<html amp <?php language_attributes(); ?>>
<head>
<?php wp_head(); ?>
<link rel="profile" href="http://gmpg.org/xfn/11">
</head>
<body <?php body_class(); ?>>

<amp-state id="search_query">
<script type="application/json">
{
"search": ""
}
</script>
</amp-state>

<?php
echo '<amp-state id="adventure_price"><script type="application/json">"' . esc_html( get_post_meta( get_the_ID(), 'amp_travel_price', true ) ) . '"</script></amp-state>
<amp-state id="adventure_current_price"><script type="application/json">"' . esc_html( get_post_meta( get_the_ID(), 'amp_travel_price', true ) ) . '"</script></amp-state>';
?>

<amp-state id="fields_query"><script type="application/json">""</script></amp-state>
<amp-state id="query_query"><script type="application/json">""</script></amp-state>

<section class="travel-main-wrapper overflow-hidden" role="main">

<!-- Results Navbar -->
<header class="travel-results-navbar pt4 pr4 pl4">
<div class="px1 md-px2 flex justify-between items-stretch">
<div class="flex items-stretch">
<a href="travel.amp" class="travel-results-navbar-icon h2 circle my1 md-my2">
<svg class="travel-icon travel-icon-logo h2" viewBox="0 0 100 100"><g fill="none" fill-rule="evenodd" stroke="currentColor" stroke-width="7.5"><circle cx="50" cy="50" r="45"></circle><path d="M20.395 83.158c-2.37-10.263-.79-18.553 4.737-24.87 8.29-9.472 17.763-1.183 26.052-9.472 8.29-8.29 2.37-18.948 10.658-26.053 5.526-4.737 12.237-6.316 20.132-4.737M39.084 95c-2.788-10.2-1.912-17.304 2.627-21.316 6.808-6.017 14.956-.68 24.088-9.623 9.13-8.94 3.062-17.133 10.255-23.534 4.795-4.267 10.282-5.668 16.46-4.203"></path></g></svg> </a>
</div>
</div>
</header>
<!--/ Results Navbar -->
Binary file added img/travel/activity/authentic-tapas.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/travel/activity/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/travel/activity/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/travel/activity/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/travel/activity/best-coffee-mexico.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/travel/activity/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/travel/activity/bike-around-volcano.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/travel/activity/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/travel/activity/dinner-in-sky.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/travel/activity/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/travel/activity/discover-electronic-scene.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/travel/activity/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/travel/activity/golfing-with-pro.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/travel/activity/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/travel/activity/kait-loggins-294474.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/travel/activity/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/travel/activity/learn-photography.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/travel/activity/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/travel/activity/mexican-meat-market.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/travel/activity/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/travel/activity/motorcycle-coast.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/travel/activity/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/travel/activity/[email protected]
Binary file added img/travel/activity/parque-zoologico.jpg
Binary file added img/travel/activity/[email protected]
Binary file added img/travel/activity/roads-of-city.jpg
Binary file added img/travel/activity/[email protected]
Binary file added img/travel/activity/run-through-mexico.jpg
Binary file added img/travel/activity/[email protected]
Binary file added img/travel/activity/sail-around-coast.jpg
Binary file added img/travel/activity/[email protected]
Binary file added img/travel/activity/skateboard-around-city.jpg
Binary file added img/travel/activity/[email protected]
Binary file added img/travel/activity/surf-day.jpg
Binary file added img/travel/activity/[email protected]
Binary file added img/travel/activity/swim-with-dolphins.jpg
Binary file added img/travel/activity/[email protected]
Binary file added img/travel/activity/top-fashion-instagram.jpg
Binary file added img/travel/activity/[email protected]
Binary file added img/travel/activity/tour-beaches-cancun.jpg
Binary file added img/travel/activity/[email protected]
Binary file added img/travel/blogpost-thumbnail.jpg
Binary file added img/travel/city/barcelona.jpg
Binary file added img/travel/city/cancun.jpg
Binary file added img/travel/city/chicago.jpg
Binary file added img/travel/city/la-paz.jpg
Binary file added img/travel/city/mexico-city.jpg
Binary file added img/travel/city/new-york.jpg
Binary file added img/travel/city/oaxaca.jpg
Binary file added img/travel/city/paris.jpg
Binary file added img/travel/city/reykjavik.jpg
Binary file added img/travel/city/tijuana.jpg
Binary file added img/travel/city/tokyo.jpg
Binary file added img/travel/hero-1-preview.jpg
Binary file added img/travel/hero-1.jpg
Binary file added img/travel/hero-2-preview.jpg
Binary file added img/travel/hero-2.jpg
Binary file added img/travel/hero-3-preview.jpg
Binary file added img/travel/hero-3.jpg
1 change: 1 addition & 0 deletions img/travel/icon/boat.svg
1 change: 1 addition & 0 deletions img/travel/icon/bus.svg
1 change: 1 addition & 0 deletions img/travel/icon/calendar.svg
1 change: 1 addition & 0 deletions img/travel/icon/caret-down-small.svg
Binary file added img/travel/icon/checkmark-purple.png
1 change: 1 addition & 0 deletions img/travel/icon/checkmark.svg
1 change: 1 addition & 0 deletions img/travel/icon/cocktail.svg
1 change: 1 addition & 0 deletions img/travel/icon/cutlery.svg
1 change: 1 addition & 0 deletions img/travel/icon/filters.svg
1 change: 1 addition & 0 deletions img/travel/icon/guitar.svg
1 change: 1 addition & 0 deletions img/travel/icon/heart.svg
1 change: 1 addition & 0 deletions img/travel/icon/jacket.svg
1 change: 1 addition & 0 deletions img/travel/icon/logo.svg
Binary file added img/travel/icon/map-pin-outline-gray.png
1 change: 1 addition & 0 deletions img/travel/icon/map-pin-outline.svg
Binary file added img/travel/icon/map-pin-transparent.png
1 change: 1 addition & 0 deletions img/travel/icon/map-pin.svg
1 change: 1 addition & 0 deletions img/travel/icon/menu.svg
1 change: 1 addition & 0 deletions img/travel/icon/moon.svg
1 change: 1 addition & 0 deletions img/travel/icon/paintbrush.svg
Loading