From c0179f48bd5c449b850db9c16b5fbc567206d979 Mon Sep 17 00:00:00 2001 From: shibao Date: Fri, 4 Mar 2022 23:17:53 -0500 Subject: [PATCH] mix format --- assets/js/maintain_attrs.js | 6 +++--- lib/cannery/ammo.ex | 2 +- .../live/ammo_group_live/form_component.html.heex | 1 - priv/gettext/errors.pot | 4 ++-- priv/gettext/prompts.pot | 4 ++-- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/assets/js/maintain_attrs.js b/assets/js/maintain_attrs.js index 439d263..7e4f65b 100644 --- a/assets/js/maintain_attrs.js +++ b/assets/js/maintain_attrs.js @@ -2,9 +2,9 @@ // update. https://github.com/phoenixframework/phoenix_live_view/issues/1011 export default { - attrs() { - const attrs = this.el.getAttribute('data-attrs'); - if (attrs) { return attrs.split(', '); } else { return []; } + attrs () { + const attrs = this.el.getAttribute('data-attrs') + if (attrs) { return attrs.split(', ') } else { return [] } }, beforeUpdate () { this.prevAttrs = this.attrs().map(name => [name, this.el.getAttribute(name)]) }, updated () { this.prevAttrs.forEach(([name, val]) => this.el.setAttribute(name, val)) } diff --git a/lib/cannery/ammo.ex b/lib/cannery/ammo.ex index 4b9f39a..827c848 100644 --- a/lib/cannery/ammo.ex +++ b/lib/cannery/ammo.ex @@ -6,7 +6,7 @@ defmodule Cannery.Ammo do import Ecto.Query, warn: false alias Cannery.{Accounts.User, Containers, Repo} alias Cannery.Ammo.{AmmoGroup, AmmoType} - alias Ecto.{Changeset, Multi} + alias Ecto.Changeset @ammo_group_create_limit 10_000 diff --git a/lib/cannery_web/live/ammo_group_live/form_component.html.heex b/lib/cannery_web/live/ammo_group_live/form_component.html.heex index 86b4cd1..3fe8bf2 100644 --- a/lib/cannery_web/live/ammo_group_live/form_component.html.heex +++ b/lib/cannery_web/live/ammo_group_live/form_component.html.heex @@ -69,7 +69,6 @@ ) %> <%= error_tag(f, :multiplier, "col-span-3 text-center") %> - <% :edit -> %> <%= submit(dgettext("actions", "Save"), phx_disable_with: dgettext("prompts", "Saving..."), diff --git a/priv/gettext/errors.pot b/priv/gettext/errors.pot index ec2f671..8afd1d0 100644 --- a/priv/gettext/errors.pot +++ b/priv/gettext/errors.pot @@ -159,11 +159,11 @@ msgid "Tag could not be removed" msgstr "" #, elixir-autogen, elixir-format -#: lib/cannery_web/live/ammo_group_live/form_component.ex:113 +#: lib/cannery_web/live/ammo_group_live/form_component.ex:126 msgid "Could not parse number of copies" msgstr "" #, elixir-autogen, elixir-format -#: lib/cannery_web/live/ammo_group_live/form_component.ex:98 +#: lib/cannery_web/live/ammo_group_live/form_component.ex:111 msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}" msgstr "" diff --git a/priv/gettext/prompts.pot b/priv/gettext/prompts.pot index 8127efc..ef95962 100644 --- a/priv/gettext/prompts.pot +++ b/priv/gettext/prompts.pot @@ -68,7 +68,7 @@ msgid "Ammo group deleted succesfully" msgstr "" #, elixir-autogen, elixir-format -#: lib/cannery_web/live/ammo_group_live/form_component.ex:75 +#: lib/cannery_web/live/ammo_group_live/form_component.ex:88 msgid "Ammo group updated successfully" msgstr "" @@ -253,7 +253,7 @@ msgid "Creating..." msgstr "" #, elixir-autogen, elixir-format -#: lib/cannery_web/live/ammo_group_live/form_component.ex:134 +#: lib/cannery_web/live/ammo_group_live/form_component.ex:147 msgid "Ammo group created successfully" msgid_plural "Ammo groups created successfully" msgstr[0] ""