-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/2100/components-name-not-matching-macros…
…-name
- Loading branch information
Showing
38 changed files
with
177 additions
and
149 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
...st__components_image_example-image-for-regular-screens_0_document_0_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...est__components_image_example-image-for-regular-screens_0_document_1_tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...est__components_image_example-image-for-regular-screens_0_document_2_mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...est__components_image_example-image-for-retina-screens_0_document_0_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...test__components_image_example-image-for-retina-screens_0_document_1_tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...test__components_image_example-image-for-retina-screens_0_document_2_mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...t__components_image_example-images-for-regular-screens_0_document_0_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...st__components_image_example-images-for-regular-screens_0_document_1_tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...st__components_image_example-images-for-regular-screens_0_document_2_mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...st__components_image_example-images-for-retina-screens_0_document_0_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...est__components_image_example-images-for-retina-screens_0_document_1_tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...est__components_image_example-images-for-retina-screens_0_document_2_mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
"icon": { | ||
"macroName": "onsIcon" | ||
}, | ||
"images": { | ||
"image": { | ||
"macroName": "onsImage" | ||
}, | ||
"list": { | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...es/example-images-for-regular-screens.njk → ...age/example-image-for-regular-screens.njk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ges/example-images-for-retina-screens.njk → ...mage/example-image-for-retina-screens.njk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,68 @@ | ||
{% macro onsPagination(params) %} | ||
{% set currentPageIndex = "" %} | ||
{% for page in params.pages %} | ||
{% if page.current %} | ||
{% set currentPageIndex = loop.index %} | ||
{% endif %} | ||
{% endfor %} | ||
{% set currentPageIndex = params.currentPageNumber|int %} | ||
{% set totalPages = params.pages | length|int %} | ||
{% set position = "Page " ~ currentPageIndex ~ " of " ~ totalPages %} | ||
{% set lastPage = params.pages | last %} | ||
{% set firstPage = params.pages | first %} | ||
{% set prevPageIndex = currentPageIndex - 1 %} | ||
{% set nextPageIndex = currentPageIndex + 1 %} | ||
|
||
{% set totalPages = params.pages | length %} | ||
{% set position = "Page " + currentPageIndex + " of " + totalPages %} | ||
{% set lastPage = params.pages | last %} | ||
{% set firstPage = params.pages | first %} | ||
|
||
<nav class="ons-pagination {{ params.classes }}{% if params.hideRangeIndicator %} ons-pagination--no-indicator{% endif %}" aria-label="Pagination ({{ position }})"> | ||
<div class="ons-pagination__position">{{ position }}</div> | ||
<ul class="ons-pagination__items"> | ||
{% if currentPageIndex != 1 %} | ||
{% set prevPageIndex = currentPageIndex - 2 %} | ||
<li class="ons-pagination__item ons-pagination__item--previous"> | ||
<a href="{{ params.pages[prevPageIndex].url }}" class="ons-pagination__link" rel="prev" aria-label="Go to the previous page (Page {{ currentPageIndex - 1 }})">{{ params.previous }}</a> | ||
</li> | ||
{% endif %} | ||
{% if currentPageIndex > 2 %} | ||
<li class="ons-pagination__item{% if firstPage.current == true %} ons-pagination__item--current{% endif %}"> | ||
<a href="{{ firstPage.url }}" class="ons-pagination__link" aria-label="Go to the first page (Page 1)">1</a> | ||
</li> | ||
{% endif %} | ||
{% if currentPageIndex > 4 %} | ||
<li class="ons-pagination__item ons-pagination__item--gap">…</li> | ||
{% endif %} | ||
{% for page in params.pages %} | ||
{% set showPage = false %} | ||
{# Show the current, next and previous page | ||
Show page 2 if the current page index is within the first 4 pages | ||
Show the penultimate page if the current page index is within the last 4 pages #} | ||
{% if (loop.index == currentPageIndex) or (loop.index == currentPageIndex + 1) or (loop.index == currentPageIndex - 1) or (loop.index == 2 and currentPageIndex <= 4) or ((loop.index == totalPages - 1) and (currentPageIndex > totalPages - 4)) %} | ||
{% set showPage = true %} | ||
{% endif %} | ||
{% if showPage == true %} | ||
<li class="ons-pagination__item{% if page.current == true %} ons-pagination__item--current{% endif %}"> | ||
<a href="{{ page.url }}" class="ons-pagination__link" | ||
{%- if page.current -%} | ||
aria-current="true" aria-label="Current page ({{ position }})" | ||
{%- else -%} | ||
aria-label="Go to page {{ loop.index }}" | ||
{%- endif -%} | ||
{%- if loop.index == currentPageIndex - 1 -%} | ||
rel="prev" | ||
{%- endif -%} | ||
{%- if loop.index == currentPageIndex + 1 -%} | ||
rel="next" | ||
{%- endif -%} | ||
>{{ loop.index }}</a> | ||
</li> | ||
{% endif %} | ||
{% endfor %} | ||
{% if currentPageIndex < totalPages - 3 %} | ||
<li class="ons-pagination__item ons-pagination__item--gap">…</li> | ||
{% endif %} | ||
{% if currentPageIndex < totalPages - 1 %} | ||
<li class="ons-pagination__item{% if lastPage.current == true %} ons-pagination__item--current{% endif %}"> | ||
<a href="{{ lastPage.url }}" class="ons-pagination__link" aria-label="Go to the last page (Page {{ totalPages }})">{{ totalPages }}</a> | ||
</li> | ||
{% endif %} | ||
{% if totalPages > 1 and totalPages != currentPageIndex %} | ||
<li class="ons-pagination__item ons-pagination__item--next"> | ||
<a href="{{ params.pages[currentPageIndex].url }}" class="ons-pagination__link" rel="next" aria-label="Go to the next page (Page {{ currentPageIndex + 1 }})">{{ params.next }}</a> | ||
</li> | ||
{% endif %} | ||
</ul> | ||
</nav> | ||
<nav class="ons-pagination {{ params.classes }}{% if params.hideRangeIndicator %} ons-pagination--no-indicator{% endif %}" aria-label="Pagination ({{ position }})"> | ||
<div class="ons-pagination__position">{{ position }}</div> | ||
<ul class="ons-pagination__items"> | ||
{% if currentPageIndex != 1 %} | ||
{% set prevPageIndex = currentPageIndex - 2 %} | ||
<li class="ons-pagination__item ons-pagination__item--previous"> | ||
<a href="{{ params.pages[prevPageIndex].url }}" class="ons-pagination__link" rel="prev" aria-label="Go to the previous page (Page {{ currentPageIndex - 1 }})">{{ params.previous }}</a> | ||
</li> | ||
{% endif %} | ||
{% if currentPageIndex > 2 %} | ||
<li class="ons-pagination__item{% if (currentPageIndex == 1) %} ons-pagination__item--current{% endif %}"> | ||
<a href="{{ firstPage.url }}" class="ons-pagination__link" aria-label="Go to the first page (Page 1)">1</a> | ||
</li> | ||
{% endif %} | ||
{% if currentPageIndex > 4 %} | ||
<li class="ons-pagination__item ons-pagination__item--gap">…</li> | ||
{% endif %} | ||
{% for page in params.pages %} | ||
{% set showPage = false %} | ||
{# Show the current, next and previous page | ||
Show page 2 if the current page index is within the first 4 pages | ||
Show the penultimate page if the current page index is within the last 4 pages #} | ||
{% if (loop.index == currentPageIndex) or (loop.index == currentPageIndex + 1) or (loop.index == currentPageIndex - 1) or (loop.index == 2 and currentPageIndex <= 4) or ((loop.index == totalPages - 1) and (currentPageIndex > totalPages - 4)) %} | ||
{% set showPage = true %} | ||
{% endif %} | ||
{% if showPage == true %} | ||
<li class="ons-pagination__item{% if loop.index == currentPageIndex %} ons-pagination__item--current{% endif %}"> | ||
<a href="{{ page.url }}" class="ons-pagination__link" | ||
{%- if loop.index == currentPageIndex -%} | ||
aria-current="true" aria-label="Current page ({{ position }})" | ||
{%- else -%} | ||
aria-label="Go to page {{ loop.index }}" | ||
{%- endif -%} | ||
{%- if loop.index == currentPageIndex - 1 -%} | ||
rel="prev" | ||
{%- endif -%} | ||
{%- if loop.index == currentPageIndex + 1 -%} | ||
rel="next" | ||
{%- endif -%} | ||
>{{ loop.index }}</a> | ||
</li> | ||
{% endif %} | ||
{% endfor %} | ||
{% if currentPageIndex < totalPages - 3 %} | ||
<li class="ons-pagination__item ons-pagination__item--gap">…</li> | ||
{% endif %} | ||
{% if currentPageIndex < totalPages - 1 %} | ||
<li class="ons-pagination__item{% if currentPageIndex == totalPages %} ons-pagination__item--current{% endif %}"> | ||
<a href="{{ lastPage.url }}" class="ons-pagination__link" aria-label="Go to the last page (Page {{ totalPages }})">{{ totalPages }}</a> | ||
</li> | ||
{% endif %} | ||
{% if totalPages > 1 and totalPages != currentPageIndex %} | ||
<li class="ons-pagination__item ons-pagination__item--next"> | ||
<a href="{{ params.pages[currentPageIndex].url }}" class="ons-pagination__link" rel="next" aria-label="Go to the next page (Page {{ currentPageIndex + 1 }})">{{ params.next }}</a> | ||
</li> | ||
{% endif %} | ||
</ul> | ||
</nav> | ||
{% endmacro %} |
Oops, something went wrong.