FEATURE: New styling of product page

This commit is contained in:
Justin DiRose 2020-07-28 12:46:59 -05:00
parent 954beeb094
commit 83002fab3c
No known key found for this signature in database
GPG Key ID: 4B811FB264021800
6 changed files with 48 additions and 12 deletions

View File

@ -4,6 +4,7 @@ import { isEmpty } from "@ember/utils";
import Component from "@ember/component";
export default Component.extend({
classNames: ["product-list"],
@discourseComputed("products")
emptyProducts(products) {
return isEmpty(products);

View File

@ -5,15 +5,20 @@
<div class="product">
<h2>{{product.name}}</h2>
<p>
<p class="product-description">
{{product.description}}
</p>
{{#if isLoggedIn}}
<div class="pull-right">
{{#link-to "s.show" product.id disabled=product.subscribed class="btn btn-primary"}}
{{i18n 'discourse_subscriptions.subscribe.title'}}
{{/link-to}}
<div class="product-purchase">
{{#if product.subscribed}}
<span class="purchased">&#x2713; {{i18n 'discourse_subscriptions.subscribe.purchased'}}</span>
<a class="billing-link" href="/my/billing">{{I18n 'discourse_subscriptions.subscribe.go_to_billing'}}</a>
{{else}}
{{#link-to "s.show" product.id disabled=product.subscribed class="btn btn-primary"}}
{{i18n 'discourse_subscriptions.subscribe.title'}}
{{/link-to}}
{{/if}}
</div>
{{/if}}
</div>

View File

@ -1,4 +1 @@
<div id="product-list">
{{product-list products=model}}
</div>
{{product-list products=model}}

View File

@ -35,9 +35,32 @@
}
}
#product-list {
padding: 40px 120px;
.product-list {
display: flex;
flex-flow: row wrap;
justify-content: center;
.product {
margin-bottom: 60px;
display: flex;
flex-flow: column nowrap;
border: 1px solid $primary-low;
padding: 1.5rem;
margin: 1rem;
width: calc(50% - 240px);
.product-description {
flex-grow: 1;
}
.product-purchase {
align-self: baseline;
display: flex;
flex-flow: column nowrap;
.purchased {
color: $success;
}
.billing-link {
font-size: $font-down-1;
}
}
}
}

View File

@ -0,0 +1,8 @@
.mobile-view {
.product-list {
flex-flow: column nowrap;
.product {
width: unset;
}
}
}

View File

@ -64,6 +64,8 @@ en:
title: Customer Details
buttons:
subscribe: Subscribe
purchased: Purchased
go_to_billing: Go to Billing
billing:
name: Full name
email: Email