Skip to content

Commit

Permalink
Minor visual adjustment to make TopCustomers and ProductTop widge…
Browse files Browse the repository at this point in the history
…ts the same styling
  • Loading branch information
bymayo committed Sep 10, 2019
1 parent 953bdcc commit 427d587
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Commerce Widgets Changelog

## 2.0.19 - 2019-09-10

### Changed
- Minor visual adjustment to make `TopCustomers` and `ProductTop` widgets the same styling

## 2.0.18 - 2019-08-09

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "bymayo/commerce-widgets",
"description": "Insightful dashboard widgets for your Craft Commerce 2 store.",
"type": "craft-plugin",
"version": "2.0.18",
"version": "2.0.19",
"keywords": [
"craft",
"cms",
Expand Down
12 changes: 8 additions & 4 deletions src/templates/widgets/ProductsTop/body.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

{% block widget %}

{% set rankClasses = ['-first', '-second', '-third'] %}

<table class="data fullwidth collapsible">
<thead>
<tr>
Expand All @@ -15,11 +17,13 @@
{% set element = craft.products.id(product.id).status(null).one() %}
<tr{% if loop.first %} class="rank-background -first"{% endif %}>
<td class="rank-column">
{% if loop.first %}
<span class="rank -first">
<span class="rank {{ rankClasses[loop.index0] is defined ? rankClasses[loop.index0] }}">
{% if loop.first %}
<i class="fas fa-crown"></i>
</span>
{% endif %}
{% else %}
{{ loop.index}}
{% endif %}
</span>
</td>
<td>
<div class="element hasstatus">
Expand Down
10 changes: 8 additions & 2 deletions src/templates/widgets/TopCustomers/body.twig
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,15 @@
<tbody>
{% for customer in customers %}
{% set userId = craft.commercewidgets.userIdByCustomerId(customer.customerId).userId %}
<tr>
<tr{% if loop.first %} class="rank-background -first"{% endif %}>
<td class="rank-column">
<span class="rank {{ rankClasses[loop.index0] is defined ? rankClasses[loop.index0] }}">{{ loop.index}}</span>
<span class="rank {{ rankClasses[loop.index0] is defined ? rankClasses[loop.index0] }}">
{% if loop.first %}
<i class="fas fa-crown"></i>
{% else %}
{{ loop.index}}
{% endif %}
</span>
</td>
<td>
{% if userId|length %}
Expand Down

0 comments on commit 427d587

Please sign in to comment.