phoenix_html doesn't like booleans in data tags

This commit is contained in:
Luna D 2023-02-20 17:26:00 +01:00
parent f954ce2951
commit 59029c24e2
No known key found for this signature in database
GPG key ID: 4B1C63448394F688
6 changed files with 9 additions and 9 deletions

View file

@ -1,5 +1,5 @@
.block
= form_for @changeset, Routes.image_source_path(@conn, :update, @image), [method: "put", class: "hidden", id: "source-form", data: [remote: true]], fn f ->
= form_for @changeset, Routes.image_source_path(@conn, :update, @image), [method: "put", class: "hidden", id: "source-form", data: [remote: "true"]], fn f ->
= if can?(@conn, :edit_metadata, @image) and !@conn.assigns.current_ban do
= if @changeset.action do

View file

@ -12,7 +12,7 @@
' The following tags have been restricted on this image:
code= Enum.map_join(@image.locked_tags, ", ", & &1.name)
= form_for @changeset, Routes.image_tag_path(@conn, :update, @image), [id: "tags-form", method: "put", data: [remote: true]], fn f ->
= form_for @changeset, Routes.image_tag_path(@conn, :update, @image), [id: "tags-form", method: "put", data: [remote: "true"]], fn f ->
= if @changeset.action do
.alert.alert-danger
p Oops, something went wrong! Please check the errors below.

View file

@ -1,4 +1,4 @@
= form_for @changeset, Routes.image_description_path(@conn, :update, @image), [class: "block hidden", id: "description-form", data: [remote: true]], fn f ->
= form_for @changeset, Routes.image_description_path(@conn, :update, @image), [class: "block hidden", id: "description-form", data: [remote: "true"]], fn f ->
= if @changeset.action do
.alert.alert-danger
p Oops, something went wrong! Please check the errors below.

View file

@ -55,4 +55,4 @@
= link "Edit item", to: Routes.profile_commission_item_path(@conn, :edit, @user, item)
br
br
= link "Delete item", to: Routes.profile_commission_item_path(@conn, :delete, @user, item), data: [confirm: "Are you really, really sure?", method: :delete]
= link "Delete item", to: Routes.profile_commission_item_path(@conn, :delete, @user, item), data: [confirm: "Are you really, really sure?", method: "delete"]

View file

@ -73,7 +73,7 @@
= if can?(@conn, :edit, @commission) do
= link "Edit this listing", to: Routes.profile_commission_path(@conn, :edit, @user)
br
= link "Delete this listing", to: Routes.profile_commission_path(@conn, :delete, @user), data: [confirm: "Are you really, really sure about that?", method: :delete]
= link "Delete this listing", to: Routes.profile_commission_path(@conn, :delete, @user), data: [confirm: "Are you really, really sure about that?", method: "delete"]
br
= link "Report this listing", to: Routes.profile_commission_report_path(@conn, :new, @user)

View file

@ -44,12 +44,12 @@ defmodule PhilomenaWeb.LayoutView do
user_id: if(user, do: user.id, else: nil),
user_name: if(user, do: user.name, else: nil),
user_slug: if(user, do: user.slug, else: nil),
user_is_signed_in: !!user,
user_can_edit_filter: if(user, do: filter.user_id == user.id, else: false),
user_is_signed_in: if(user, do: "true", else: "false"),
user_can_edit_filter: if(user, do: filter.user_id == user.id, else: "false"),
spoiler_type: if(user, do: user.spoiler_type, else: "static"),
watched_tag_list: Jason.encode!(if(user, do: user.watched_tag_ids, else: [])),
fancy_tag_edit: if(user, do: user.fancy_tag_field_on_edit, else: true),
fancy_tag_upload: if(user, do: user.fancy_tag_field_on_upload, else: true),
fancy_tag_edit: if(user, do: user.fancy_tag_field_on_edit, else: "true"),
fancy_tag_upload: if(user, do: user.fancy_tag_field_on_upload, else: "true"),
interactions: Jason.encode!(interactions),
ignored_tag_list: Jason.encode!(ignored_tag_list(conn.assigns[:tags])),
hide_staff_tools: conn.cookies["hide_staff_tools"]