Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions controllers.csv
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,4 @@ sitemap,show
product_categories,index
product_categories,show
vouchers,show
voucher_activations,create
2 changes: 1 addition & 1 deletion templates/blocks/slideshow.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{%- if children_content != blank %}
{%- require "scripts/slider.js" -%}

<div class="Slider" data-slideshow="{{ content_block.identifier }}">
<div class="SC-Slider" data-slideshow="{{ content_block.identifier }}">
{{ children_content }}
</div>
{%- else %}
Expand Down
4 changes: 2 additions & 2 deletions templates/pages/product_category.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
{%- render "search/filters/sort_dropdown" %}
</menu>

{%- if current_product_category.introduction_content %}
{%- if current_product_category.introduction_content != blank %}
<div class="SC-ProductCategoryIntroduction sc-rich-text">
{{ current_product_category.introduction_content }}
</div>
Expand All @@ -41,7 +41,7 @@
{%- render "products/results", allow_comparisons: true %}
</div>

{%- if current_product_category.information_content %}
{%- if current_product_category.information_content != blank %}
<div class="SC-ProductCategoryInformation sc-rich-text">
{{ current_product_category.information_content }}
</div>
Expand Down
97 changes: 65 additions & 32 deletions templates/pages/voucher.liquid
Original file line number Diff line number Diff line change
@@ -1,56 +1,89 @@
{%- default voucher: nil %}

<div class="sc-container sc-container-spacious">
{%- render "shared/page_header", heading: "t.vouchers.show.heading", sub_heading: current_request.params["code"] %}

{%- if voucher == blank %}
{% if current_request.params.code != blank %}
<div class="sc-mt-large sc-mb-large">
{{ "vouchers.show.not_found" | t }}
</div>
{%- endif %}
{%- else %}
<table class="sc-compact sc-mb-large">
<tr>
<th>{{ "vouchers.show.balance" | t }}</th>
<th>{{ "vouchers.show.expires" | t }}</th>
</tr>
<tr>
<td data-th="{{ "vouchers.show.balance" | t }}">{{ voucher.current_balance | money }}</td>
<td data-th="{{ "vouchers.show.expires" | t }}">
{%- if voucher.expires_at == blank %}
{{ "vouchers.show.no_expiry" | t }}
{%- else %}
{% render "shared/date", timestamp: voucher.expires_at %}
{%- endif %}
</td>
</tr>
</table>
{%- if voucher.orders.size > 0 %}
<h2>{{ "vouchers.show.orders.heading" | t }}</h2>
<table class="sc-compact sc-mb-spacious">
{%- if voucher.requires_activation? %}
{%- render "shared/page_header", heading: "t.vouchers.show.activation_form.heading", sub_heading: current_request.params["code"] %}
{%- else %}
{%- render "shared/page_header", heading: "t.vouchers.show.heading", sub_heading: current_request.params["code"] %}
{%- endif %}

{%- if voucher.requires_activation? %}
<div class="sc-mt-large">
{% form "activate-voucher", voucher: voucher %}
<span>
<input
type="text"
name="activation_code"
placeholder="{{ 'vouchers.show.activation_form.activation_code' | t }}"
class="SC-Field_input"
>
</span>
<span class="sc-pl-medium">
<input
type="submit"
name="commit"
value="{{ 'vouchers.show.activation_form.submit' | t }}"
class="SC-Button SC-Button-small SC-Button-primary sc-font-small"
data-disable-with="{{ 'vouchers.show.activation_form.submit'| t }}"
>
</span>
{% endform %}
</div>
{%- else %}
<table class="sc-compact sc-mb-large sc-mt-large">
<tr>
<th>{{ "vouchers.show.balance" | t }}</th>
<th>{{ "vouchers.show.expires" | t }}</th>
</tr>
<tr>
<th>{{ "vouchers.show.orders.reference" | t }}</th>
<th>{{ "vouchers.show.orders.date" | t }}</th>
<th>{{ "vouchers.show.orders.total" | t }}</th>
<td data-th="{{ "vouchers.show.balance" | t }}"><p class="sc-mt-small">{{ voucher.current_balance | money }}</p></td>
<td data-th="{{ "vouchers.show.expires" | t }}">
<p class="sc-mt-small">
{%- if voucher.expires_at == blank %}
{{ "vouchers.show.no_expiry" | t }}
{%- else %}
{% render "shared/date", timestamp: voucher.expires_at %}
{%- endif %}
</p>
</td>
</tr>
{% for order in voucher.orders %}
</table>
{%- if voucher.orders.size > 0 %}
<h2>{{ "vouchers.show.orders.heading" | t }}</h2>
<table class="sc-compact sc-mb-spacious">
<tr>
<td data-th="{{ "vouchers.show.orders.reference" | t }}"><a href="{{ order.path }}">{{ order.reference }}</a></td>
<td data-th="{{ "vouchers.show.orders.date" | t }}">{% render "shared/date", timestamp: order.ordered_at %}</td>
<td data-th="{{ "vouchers.show.orders.total" | t }}">
{% if order.quotable? %}-{% else %}{{ order.total | money }}{% endif %}
</td>
<th>{{ "vouchers.show.orders.reference" | t }}</th>
<th>{{ "vouchers.show.orders.date" | t }}</th>
<th>{{ "vouchers.show.orders.total" | t }}</th>
</tr>
{%- endfor %}
</table>
{% for order in voucher.orders %}
<tr>
<td data-th="{{ "vouchers.show.orders.reference" | t }}"><a href="{{ order.path }}">{{ order.reference }}</a></td>
<td data-th="{{ "vouchers.show.orders.date" | t }}">{% render "shared/date", timestamp: order.ordered_at %}</td>
<td data-th="{{ "vouchers.show.orders.total" | t }}">
{% if order.quotable? %}-{% else %}{{ order.total | money }}{% endif %}
</td>
</tr>
{%- endfor %}
</table>
{%- endif %}
{%- endif %}
{%- endif %}

{%- if current_request.params["code"] != blank %}
<hr>
<h3 class="sc-mt-large">{{ "vouchers.show.form.heading" | t }}</h3>
{%- else %}
<h1 class="sc-mt-large">{{ "vouchers.show.check_voucher_heading" | t }}</h1>
{%- endif %}

<form>
<div class="SC-Field SC-Field-expand">
<input type="text" name="code" value="{{ current_request.params["code"] }}" placeholder="{{ "vouchers.show.form.code" | t }}" class="SC-Field_input sc-expand">
Expand Down
Loading