mix format with new version

This commit is contained in:
2022-02-17 21:24:59 -05:00
parent 39ba51fba1
commit ba2294f156
29 changed files with 239 additions and 193 deletions

View File

@ -61,7 +61,9 @@
<td class="p-2">
<%= if ammo_group.price_paid do %>
<%= gettext("$%{amount}", amount: ammo_group.price_paid |> :erlang.float_to_binary(decimals: 2)) %>
<%= gettext("$%{amount}",
amount: ammo_group.price_paid |> :erlang.float_to_binary(decimals: 2)
) %>
<% end %>
</td>
@ -143,7 +145,6 @@
current_user={@current_user}
/>
</.modal>
<% @live_action == :add_shot_group -> %>
<.modal return_to={Routes.ammo_group_index_path(Endpoint, :index)}>
<.live_component
@ -156,7 +157,6 @@
current_user={@current_user}
/>
</.modal>
<% @live_action == :move -> %>
<.modal return_to={Routes.ammo_group_index_path(Endpoint, :index)}>
<.live_component
@ -169,6 +169,5 @@
current_user={@current_user}
/>
</.modal>
<% true -> %>
<% end %>
<% end %>

View File

@ -19,7 +19,9 @@
<%= if @ammo_group.price_paid do %>
<span class="rounded-lg title text-lg">
<%= gettext("Price paid:") %>
<%= gettext("$%{amount}", amount: @ammo_group.price_paid |> :erlang.float_to_binary(decimals: 2)) %>
<%= gettext("$%{amount}",
amount: @ammo_group.price_paid |> :erlang.float_to_binary(decimals: 2)
) %>
</span>
<% end %>
</div>
@ -51,7 +53,9 @@
<div class="flex flex-wrap justify-center items-center text-primary-500">
<button type="button" class="mx-4 my-2 btn btn-primary" phx-click="toggle_staged">
<%= if @ammo_group.staged, do: gettext("Unstage from range"), else: gettext("Stage for range") %>
<%= if @ammo_group.staged,
do: gettext("Unstage from range"),
else: gettext("Stage for range") %>
</button>
<%= live_patch(dgettext("actions", "Move containers"),
@ -67,7 +71,7 @@
</div>
</div>
<hr class="mb-4 w-full">
<hr class="mb-4 w-full" />
<div>
<%= if @ammo_group.container do %>
@ -95,7 +99,6 @@
current_user={@current_user}
/>
</.modal>
<% :add_shot_group -> %>
<.modal return_to={Routes.ammo_group_show_path(Endpoint, :show, @ammo_group)}>
<.live_component
@ -108,7 +111,6 @@
current_user={@current_user}
/>
</.modal>
<% :move -> %>
<.modal return_to={Routes.ammo_group_show_path(Endpoint, :show, @ammo_group)}>
<.live_component
@ -121,6 +123,5 @@
current_user={@current_user}
/>
</.modal>
<% _show -> %>
<% end %>
<% end %>

View File

@ -34,14 +34,18 @@
>
<%= gettext("Example bullet type abbreviations") %>
</a>
<%= label(f, :bullet_type, gettext("Bullet type"), class: "mr-4 title text-lg text-primary-500") %>
<%= label(f, :bullet_type, gettext("Bullet type"),
class: "mr-4 title text-lg text-primary-500"
) %>
<%= text_input(f, :bullet_type,
class: "text-center col-span-2 input input-primary",
placeholder: gettext("FMJ")
) %>
<%= error_tag(f, :bullet_type, "col-span-3 text-center") %>
<%= label(f, :bullet_core, gettext("Bullet core"), class: "mr-4 title text-lg text-primary-500") %>
<%= label(f, :bullet_core, gettext("Bullet core"),
class: "mr-4 title text-lg text-primary-500"
) %>
<%= text_input(f, :bullet_core,
class: "text-center col-span-2 input input-primary",
placeholder: gettext("Steel")
@ -62,14 +66,18 @@
) %>
<%= error_tag(f, :caliber, "col-span-3 text-center") %>
<%= label(f, :case_material, gettext("Case material"), class: "mr-4 title text-lg text-primary-500") %>
<%= label(f, :case_material, gettext("Case material"),
class: "mr-4 title text-lg text-primary-500"
) %>
<%= text_input(f, :case_material,
class: "text-center col-span-2 input input-primary",
placeholder: gettext("Brass")
) %>
<%= error_tag(f, :case_material, "col-span-3 text-center") %>
<%= label(f, :jacket_type, gettext("Jacket type"), class: "mr-4 title text-lg text-primary-500") %>
<%= label(f, :jacket_type, gettext("Jacket type"),
class: "mr-4 title text-lg text-primary-500"
) %>
<%= text_input(f, :jacket_type,
class: "text-center col-span-2 input input-primary",
placeholder: gettext("Bimetal")
@ -86,7 +94,9 @@
) %>
<%= error_tag(f, :muzzle_velocity, "col-span-3 text-center") %>
<%= label(f, :powder_type, gettext("Powder type"), class: "mr-4 title text-lg text-primary-500") %>
<%= label(f, :powder_type, gettext("Powder type"),
class: "mr-4 title text-lg text-primary-500"
) %>
<%= text_input(f, :powder_type,
class: "text-center col-span-2 input input-primary",
placeholder: gettext("Brass")
@ -118,14 +128,18 @@
) %>
<%= error_tag(f, :pressure, "col-span-3 text-center") %>
<%= label(f, :primer_type, gettext("Primer type"), class: "mr-4 title text-lg text-primary-500") %>
<%= label(f, :primer_type, gettext("Primer type"),
class: "mr-4 title text-lg text-primary-500"
) %>
<%= text_input(f, :primer_type,
class: "text-center col-span-2 input input-primary",
placeholder: "Boxer"
) %>
<%= error_tag(f, :primer_type, "col-span-3 text-center") %>
<%= label(f, :firing_type, gettext("Firing type"), class: "mr-4 title text-lg text-primary-500") %>
<%= label(f, :firing_type, gettext("Firing type"),
class: "mr-4 title text-lg text-primary-500"
) %>
<%= text_input(f, :firing_type,
class: "text-center col-span-2 input input-primary",
placeholder: "Centerfire"
@ -148,7 +162,9 @@
<%= checkbox(f, :corrosive, class: "text-center col-span-2 checkbox") %>
<%= error_tag(f, :corrosive, "col-span-3 text-center") %>
<%= label(f, :manufacturer, gettext("Manufacturer"), class: "mr-4 title text-lg text-primary-500") %>
<%= label(f, :manufacturer, gettext("Manufacturer"),
class: "mr-4 title text-lg text-primary-500"
) %>
<%= text_input(f, :manufacturer, class: "text-center col-span-2 input input-primary") %>
<%= error_tag(f, :manufacturer, "col-span-3 text-center") %>

View File

@ -5,9 +5,11 @@
</h1>
<%= if @ammo_type.desc do %>
<span class="max-w-2xl w-full px-8 py-4 rounded-lg
<span
class="max-w-2xl w-full px-8 py-4 rounded-lg
text-center title text-lg
border border-primary-600">
border border-primary-600"
>
<%= @ammo_type.desc %>
</span>
<% end %>
@ -31,7 +33,7 @@
<% end %>
</div>
<hr class="hr">
<hr class="hr" />
<div class="grid sm:grid-cols-2 text-center justify-center items-center">
<%= for {field_name, field} <- [
@ -50,7 +52,7 @@
] do %>
<%= if @ammo_type |> Map.get(field) do %>
<h3 class="mb-2 sm:mr-4 title text-lg">
<%= field_name %> :
<%= field_name %>:
</h3>
<span class="mb-4 sm:mb-2 text-primary-600">
@ -67,7 +69,7 @@
{"Corrosive", :corrosive}
] do %>
<h3 class="mb-2 sm:mr-4 title text-lg">
<%= field_name %> :
<%= field_name %>:
</h3>
<span class="mb-4 sm:mb-2 text-primary-600">
@ -78,7 +80,7 @@
<%= for {field_name, field} <- [{"Manufacturer", :manufacturer}, {"UPC", :upc}] do %>
<%= if @ammo_type |> Map.get(field) do %>
<h3 class="mb-2 sm:mr-4 title text-lg">
<%= field_name %> :
<%= field_name %>:
</h3>
<span class="mb-4 sm:mb-2 text-primary-600">
@ -89,16 +91,18 @@
<%= if @avg_cost_per_round do %>
<h3 class="mb-2 sm:mr-4 title text-lg">
<%= gettext("Average Price paid") %> :
<%= gettext("Average Price paid") %>:
</h3>
<span class="mb-4 sm:mb-2 text-primary-600">
<%= gettext("$%{amount}", amount: @avg_cost_per_round |> :erlang.float_to_binary(decimals: 2)) %>
<%= gettext("$%{amount}",
amount: @avg_cost_per_round |> :erlang.float_to_binary(decimals: 2)
) %>
</span>
<% end %>
</div>
<hr class="hr">
<hr class="hr" />
<div>
<%= if @ammo_groups |> Enum.empty?() do %>

View File

@ -41,7 +41,7 @@
<% end %>
</div>
<hr class="mb-4 hr">
<hr class="mb-4 hr" />
<%= if @container.tags |> Enum.empty?() do %>
<div class="flex flex-row justify-center items-center space-x-4">
@ -81,7 +81,7 @@
<% end %>
<% end %>
<hr class="mb-4 hr">
<hr class="mb-4 hr" />
<p>
<%= if @container.ammo_groups |> Enum.empty?() do %>

View File

@ -34,7 +34,9 @@ defmodule CanneryWeb.HomeLive do
@impl true
def render(assigns) do
~H"""
<div class="mx-auto px-8 sm:px-16 flex flex-col justify-center items-center text-center space-y-4 max-w-3xl">
<div
class="mx-auto px-8 sm:px-16 flex flex-col justify-center items-center text-center space-y-4 max-w-3xl"
>
<h1 class="title text-primary-500 text-2xl">
<%= gettext("Welcome to %{name}", name: "Cannery") %>
</h1>
@ -52,7 +54,8 @@ defmodule CanneryWeb.HomeLive do
<%= gettext("Easy to Use:") %>
</b>
<p>
<%= gettext("%{name} lets you easily keep an eye on your ammo levels before and after range day",
<%= gettext(
"%{name} lets you easily keep an eye on your ammo levels before and after range day",
name: "Cannery"
) %>
</p>
@ -78,7 +81,7 @@ defmodule CanneryWeb.HomeLive do
</li>
</ul>
<hr class="hr">
<hr class="hr" />
<ul class="flex flex-col space-y-2 text-center justify-center">
<h2 class="title text-primary-500 text-lg">

View File

@ -71,7 +71,11 @@
class="btn btn-primary"
phx-click="set_unlimited"
phx-value-id={invite.id}
data-confirm={dgettext("prompts", "Are you sure you want to make %{name} unlimited?", name: invite.name)}
data-confirm={
dgettext("prompts", "Are you sure you want to make %{name} unlimited?",
name: invite.name
)
}
>
<%= gettext("Set Unlimited") %>
</a>
@ -81,7 +85,7 @@
</div>
<%= unless @admins |> Enum.empty?() do %>
<hr class="hr">
<hr class="hr" />
<h1 class="title text-2xl text-primary-500">
<%= gettext("Admins") %>
@ -110,7 +114,7 @@
<% end %>
<%= unless @users |> Enum.empty?() do %>
<hr class="hr">
<hr class="hr" />
<h1 class="title text-2xl text-primary-500">
<%= gettext("Users") %>

View File

@ -28,7 +28,9 @@
phx-value-ammo_group_id={ammo_group.id}
data-confirm={"#{dgettext("prompts", "Are you sure you want to unstage this ammo?")}"}
>
<%= if ammo_group.staged, do: gettext("Unstage from range"), else: gettext("Stage for range") %>
<%= if ammo_group.staged,
do: gettext("Unstage from range"),
else: gettext("Stage for range") %>
</button>
<%= live_patch(dgettext("actions", "Record shots"),
@ -39,7 +41,7 @@
<% end %>
<% end %>
<hr class="hr">
<hr class="hr" />
<%= if @shot_groups |> Enum.empty?() do %>
<h1 class="title text-xl text-primary-500">