Skip to content

Commit a018b9c

Browse files
committed
fix: side filter
1 parent 85ce00c commit a018b9c

File tree

7 files changed

+23
-14
lines changed

7 files changed

+23
-14
lines changed

components/scaffold/filters/filters.templ

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
icons "github.com/iota-uz/icons/phosphor"
66
"github.com/iota-uz/iota-sdk/components/base"
77
"github.com/iota-uz/iota-sdk/components/base/input"
8+
"github.com/iota-uz/iota-sdk/pkg/composables"
89
)
910

1011
type DropdownProps struct {
@@ -137,10 +138,11 @@ templ (t *TableFilter) Component() {
137138
}
138139

139140
templ (t *TableFilter) AsSideFilter() {
141+
{{ pageCtx := composables.UsePageCtx(ctx) }}
140142
<div class="space-y-3">
141143
<div>
142144
@input.Checkbox(&input.CheckboxProps{
143-
Label: "Select All",
145+
Label: pageCtx.T("Scaffold.Filters.SelectAll"),
144146
ID: "all-users-checkbox",
145147
Attrs: templ.Attributes{
146148
"class": "parent",
@@ -153,7 +155,8 @@ templ (t *TableFilter) AsSideFilter() {
153155
<div class="space-y-3">
154156
for _, opt := range t.options {
155157
@input.Checkbox(&input.CheckboxProps{
156-
Label: opt.Label,
158+
Label: opt.Label,
159+
Checked: isOptionChecked(ctx, t.Name, opt),
157160
Attrs: templ.Attributes{
158161
"name": t.Name,
159162
"value": opt.Value,

components/scaffold/filters/filters_templ.go

Lines changed: 8 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/scaffold/scaffold.templ

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ templ TableSection(config *TableConfig) {
7979
hx-target="#table-body"
8080
hx-swap="innerHTML"
8181
hx-indicator="#table-body"
82-
class="flex flex-col md:flex-row gap-5"
82+
class="flex gap-5"
8383
x-data="checkboxes"
8484
x-init="init"
8585
>
@@ -94,7 +94,7 @@ templ TableSection(config *TableConfig) {
9494
<!-- Main content area with search, filters, and table -->
9595
<div class="flex-1">
9696
<div class="bg-surface-600 border border-primary rounded-lg">
97-
<div class="p-4 flex flex-col md:flex-row md:items-center gap-3">
97+
<div class="p-4 flex flex-row md:items-center gap-3">
9898
<div class="flex-1">
9999
@input.Text(&input.Props{
100100
AddonLeft: &input.Addon{

components/scaffold/scaffold_templ.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/core/presentation/locales/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"NoDataDescription": "There is no data available for this table."
2626
},
2727
"Filters": {
28-
"Title": "Filters"
28+
"Title": "Filters",
29+
"SelectAll": "Select All"
2930
}
3031
},
3132
"Spotlight": {

modules/core/presentation/locales/ru.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"NoDataDescription": "Для этой таблицы нет доступных данных."
2626
},
2727
"Filters": {
28-
"Title": "Фильтры"
28+
"Title": "Фильтры",
29+
"SelectAll": "Выбрать все"
2930
}
3031
},
3132
"Spotlight": {

modules/core/presentation/locales/uz.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"NoDataDescription": "Bu jadvaldagi ma'lumotlar mavjud emas."
2626
},
2727
"Filters": {
28-
"Title": "Filtrlar"
28+
"Title": "Filtrlar",
29+
"SelectAll": "Barchasini tanlash"
2930
}
3031
},
3132
"Spotlight": {

0 commit comments

Comments
 (0)