Skip to content

Commit 46da495

Browse files
author
roadiz-ci
committed
fix: fix onQuickAddClick for nodes/tree and update filters template
1 parent b3d17fc commit 46da495

4 files changed

Lines changed: 12 additions & 10 deletions

File tree

templates/macros/rz_page_header.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
{% macro translations_bar(available_translations, path, pathParams, current, pathAddTranslations, pathAddTranslationsTitle) %}
8383
{% import '@RoadizRozier/macros/rz_link.html.twig' as rz_link %}
8484
{% if available_translations %}
85-
<div class="rz-button-group rz-button-group--sm rz-button-group--collapsed">
85+
<div class="rz-page-header__translations rz-button-group rz-button-group--sm rz-button-group--collapsed">
8686
{%- for translation in available_translations -%}
8787
{% set class = 'rz-button rz-button-group__button' %}
8888
{% if current == translation.getId %}
@@ -95,7 +95,7 @@
9595
'locale': translation.locale
9696
})) %}
9797

98-
{% set attr = { href: href } %}
98+
{% set attr = { href: href, 'data-translation-id': translation.id } %}
9999
{% if current == translation.getId %}
100100
{% set attr = attr|merge({ 'aria-current': 'page' }) %}
101101
{% endif %}

templates/nodes/head.html.twig

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@
5454
<div class="stack-tree-quick-creation rz-button-group rz-button-group--gap-md rz-page-header__item--right">
5555
{% for stackType in node.stackTypes %}
5656
{% set nodeType = getNodeType(stackType) %}
57-
<button type="button"
58-
class="rz-button rz-button--primary rz-button-group__button"
59-
data-children-node-type="{{ nodeType.name }}"
60-
data-children-parent-node="{{ node.id }}"
61-
{% if specificNodeTree is defined and specificNodeTree.tag is defined %}data-filter-tag="{{ specificNodeTree.tag.id }}"{% endif %}
57+
<button
58+
type="button"
59+
class="rz-button rz-button--primary rz-button-group__button"
60+
data-children-node-type="{{ nodeType.name }}"
61+
data-children-parent-node="{{ node.id }}"
62+
{% if specificNodeTree is defined and specificNodeTree.tag is defined %}data-filter-tag="{{ specificNodeTree.tag.id }}"{% endif %}
6263
>
6364
<span class="rz-button__label">{{ nodeType.displayName }}</span>
6465
<span class="rz-button__icon rz-icon-ri--add-line"></span>

templates/nodes/tree.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
{% endif %}
4949

5050
{% include '@RoadizRozier/nodes/filtersBar.html.twig' with {
51-
filters: filters,
51+
filters: specificNodeTree.filters,
5252
tags: tags,
5353
} only %}
5454

templates/widgets/rz_filters_bar.html.twig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,12 @@
5050
</form>
5151
{% endif %}
5252

53-
{% if filters.itemCount > filters.itemPerPage %}
53+
{% set hasItemPerPageParams = app.request.get('item_per_page') is not same as("20") %}
54+
{% if (filters.itemCount > filters.itemPerPage) or hasItemPerPageParams %}
5455
<div class="rz-filters-bar__group rz-filters-bar__group--right">
5556
{{ rz_filters_bar.pagination(filters) }}
5657

57-
{% if filters.itemPerPage and filters.itemCount > 10 %}
58+
{% if (filters.itemPerPage and filters.itemCount > 10) or hasItemPerPageParams %}
5859
{{ rz_filters_bar.item_per_page(filters.itemPerPage) }}
5960
{% endif %}
6061
</div>

0 commit comments

Comments
 (0)