Skip to content

Commit

Permalink
fix BS classes for checkbox/radio
Browse files Browse the repository at this point in the history
  • Loading branch information
petschki committed Aug 29, 2024
1 parent 4a390f3 commit 16e6c49
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 44 deletions.
42 changes: 19 additions & 23 deletions src/collective/collectionfilter/portlets/collectionfilter.pt
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,26 @@
<ul>
<tal:items repeat="item results">
<li class="${item/css_class} ${input_type}">
<div class="form-check">
<input class="form-check-input"
name="${view/filter_id}"
type="${input_type}"
value="${item/value}"
data-url="${item/url}"
id="${view/filterClassName}-${item/value}"
checked="${python:'checked' if item['selected'] else None}"
/>

<input class="form-check-input"
name="${view/filter_id}"
type="${input_type}"
value="${item/value}"
data-url="${item/url}"
tal:attributes="
checked python:'checked' if item['selected'] else None;
id string:${view/filterClassName}-${item/value};
"
/>

<label class="form-label"
tal:attributes="
for string:${view/filterClassName}-${item/value};
"
>
<span class="indicator"></span>
<span class="filterLabel">
<span tal:replace="python:item['title'].replace('/', u'/\u00AD')">Item</span>
<tal:show_count condition="view/settings/show_count">(<span tal:replace="item/count"></span>)</tal:show_count>
</span>
</label>

<label class="form-check-label"
for="${view/filterClassName}-${item/value}"
>
<span class="indicator"></span>
<span class="filterLabel">
<span tal:replace="python:item['title'].replace('/', u'/\u00AD')">Item</span>
<tal:show_count condition="view/settings/show_count">(<span tal:replace="item/count"></span>)</tal:show_count>
</span>
</label>
</div>
</li>
</tal:items>
</ul>
Expand Down
35 changes: 17 additions & 18 deletions src/collective/collectionfilter/tiles/filter.pt
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,23 @@
<ul>
<tal:items repeat="item results">
<li class="${item/css_class}">
<input checked="${python:'checked' if item['selected'] else None}"
name="${view/filter_id}"
type="${input_type}"
value="${item/value}"
data-url="${item/url}"
tal:attributes="
id string:${view/filterClassName}-${item/value};
"
/>
<label tal:attributes="
for string:${view/filterClassName}-${item/value};
">
<span class="filterLabel">
<span tal:replace="python:item['title'].replace('/', u'/\u00AD')">Item</span>
<tal:show_count condition="view/settings/show_count">(<span tal:replace="item/count"></span>)</tal:show_count>
</span>

</label>
<div class="form-check">
<input checked="${python:'checked' if item['selected'] else None}"
name="${view/filter_id}"
type="${input_type}"
value="${item/value}"
data-url="${item/url}"
id="${view/filterClassName}-${item/value}"
class="form-check-input"
/>
<label for="${view/filterClassName}-${item/value}"
class="form-check-label">
<span class="filterLabel">
<span tal:replace="python:item['title'].replace('/', u'/\u00AD')">Item</span>
<tal:show_count condition="view/settings/show_count">(<span tal:replace="item/count"></span>)</tal:show_count>
</span>
</label>
</div>
</li>
</tal:items>
</ul>
Expand Down
5 changes: 2 additions & 3 deletions src/collective/collectionfilter/tiles/sorting.pt
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
>

<tal:if condition="python:input_type == 'checkboxes_dropdowns'">
<select name="sort_on">
<option class="form-select"
value=""
<select name="sort_on" class="form-select">
<option value=""
data-url="${view/ajax_url}"
i18n:translate=""
>Select</option>
Expand Down

0 comments on commit 16e6c49

Please sign in to comment.