Merge pull request #384 from koloml/fix-missing-hide-state-of-tag-view

Fixed tags block not being hidden on submission error causing it to hide on cancel
This commit is contained in:
liamwhite 2024-12-14 19:16:54 -05:00 committed by GitHub
commit c7f715c9e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,4 +1,5 @@
- form_class = if @changeset.action, do: "", else: "hidden" - form_class = if @changeset.action, do: "", else: "hidden"
- tags_class = if @changeset.action, do: "hidden", else: ""
- tags = display_order(@image.tags) - tags = display_order(@image.tags)
- tag_input = Enum.map_join(tags, ", ", & &1.name) - tag_input = Enum.map_join(tags, ", ", & &1.name)
@ -16,7 +17,7 @@
= if @changeset.action do = if @changeset.action do
.alert.alert-danger .alert.alert-danger
p Oops, something went wrong! Please check the errors below. p Oops, something went wrong! Please check the errors below.
= hidden_input f, :old_tag_input, value: tag_input = hidden_input f, :old_tag_input, value: tag_input
.field .field
@ -56,7 +57,7 @@
p p
' You can't edit the tags on this image. ' You can't edit the tags on this image.
.block.tagsauce .block.tagsauce class=tags_class
.block__header.flex .block__header.flex
span.block__header__title span.block__header__title
i.fas.fa-tag> i.fas.fa-tag>