mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-02-17 11:04:22 +01:00
Persist checked state of art categories across commission pages (#90)
This commit is contained in:
parent
79d8ed8a1c
commit
72f53d378d
2 changed files with 3 additions and 2 deletions
|
@ -6,8 +6,9 @@
|
|||
.field = label f, :categories, "Art Categories:"
|
||||
|
||||
= for {name, value} <- categories() do
|
||||
- checked = @conn.params["commission"]["category"] && Atom.to_string(name) in @conn.params["commission"]["category"]
|
||||
.field
|
||||
=> checkbox f, value, checked_value: name, name: "commission[category][]", class: "checkbox spacing-right", hidden_input: false
|
||||
=> checkbox f, value, checked_value: name, checked: checked, name: "commission[category][]", class: "checkbox spacing-right", hidden_input: false
|
||||
=> label f, value, name
|
||||
|
||||
br
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
.field
|
||||
=> label f, :categories, "Art Categories:"
|
||||
br
|
||||
= collection_checkboxes f, :categories, categories(), wrapper: &Phoenix.HTML.Tag.content_tag(:span, &1, class: "commission__category")
|
||||
= collection_checkboxes f, :categories, categories(), selected: f.data.categories, input_opts: [ class: 'checkbox spacing-right' ], wrapper: &Phoenix.HTML.Tag.content_tag(:span, &1, class: "commission__category")
|
||||
= error_tag f, :categories
|
||||
.field
|
||||
=> label f, :sheet_image_id, "Image ID of your commissions sheet (optional but recommended):"
|
||||
|
|
Loading…
Reference in a new issue