Skip to content

Commit

Permalink
add-new-component
Browse files Browse the repository at this point in the history
  • Loading branch information
sachinchauhan2889 committed Oct 27, 2020
1 parent 0157cea commit e2d14b9
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 20 deletions.
5 changes: 5 additions & 0 deletions app/components/orders/ticket-price.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import classic from 'ember-classic-decorator';
import Component from '@ember/component';

@classic
export default class TicketPrice extends Component {}
20 changes: 10 additions & 10 deletions app/templates/components/orders/order-summary.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@
</div>
</td>
<td>
{{#if (eq ticket.type 'free')}}
{{t "Free"}}
{{else}}
{{currency-symbol this.eventCurrency}} {{format-money ticket.price}}
{{/if}}
<Orders::TicketPrice
@ticket-type={{ticket.type}}
@display-symbol={{currency-symbol this.eventCurrency}}
@display-price={{format-money ticket.price}}
/>
</td>
{{#if this.data.discountCode}}
<td>{{currency-symbol this.eventCurrency}} {{format-money ticket.discount}}</td>
Expand All @@ -113,11 +113,11 @@
</td>
{{/if}}
<td>
{{#if (eq ticket.type 'free')}}
{{t "Free"}}
{{else}}
{{currency-symbol this.eventCurrency}} {{format-money (mult (sub ticket.price ticket.discount) (ticket-attendees this.data.attendees ticket.attendees))}}
{{/if}}
<Orders::TicketPrice
@ticket-type={{ticket.type}}
@display-symbol={{currency-symbol this.eventCurrency}}
@display-price={{format-money (mult (sub ticket.price ticket.discount) (ticket-attendees this.data.attendees ticket.attendees))}}
/>
</td>
{{/if}}

Expand Down
5 changes: 5 additions & 0 deletions app/templates/components/orders/ticket-price.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{#if (eq ticket-type 'free')}}
{{t "Free"}}
{{else}}
{{display-symbol}} {{display-price}}
{{/if}}
20 changes: 10 additions & 10 deletions app/templates/components/public/ticket-list.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@
</div>
{{else}}
<div class="{{if ticket.discount 'strike text'}}">
{{#if (eq ticket.type 'free')}}
{{t "Free"}}
{{else}}
{{currency-symbol this.eventCurrency}} {{format-money ticket.price}}
{{/if}}
<Orders::TicketPrice
@ticket-type={{ticket.type}}
@display-symbol={{currency-symbol this.eventCurrency}}
@display-price={{format-money ticket.price}}
/>
</div>
{{#if ticket.discount}}
<div>
Expand Down Expand Up @@ -100,11 +100,11 @@
</div>
</td>
<td id='{{ticket.id}}_subtotal' class="ui right aligned">
{{#if (eq ticket.type 'free')}}
{{t "Free"}}
{{else}}
{{currency-symbol this.eventCurrency}} {{format-money ticket.subTotal}}
{{/if}}
<Orders::TicketPrice
@ticket-type={{ticket.type}}
@display-symbol={{currency-symbol this.eventCurrency}}
@display-price={{format-money ticket.subTotal}}
/>
</td>
</tr>
{{/unless}}
Expand Down

0 comments on commit e2d14b9

Please sign in to comment.