@@ -33,25 +31,28 @@
- <%= live_patch to: Routes.invite_index_path(Endpoint, :edit, invite),
- class: "text-primary-600 link",
- data: [qa: "edit-#{invite.id}"] do %>
+ <.link
+ patch={Routes.invite_index_path(Endpoint, :edit, invite)}
+ class="text-primary-600 link"
+ data-qa={"edit-#{invite.id}"}
+ >
- <% end %>
+
- <%= link to: "#",
- class: "text-primary-600 link",
- phx_click: "delete_invite",
- phx_value_id: invite.id,
- data: [
- confirm:
- dgettext("prompts", "Are you sure you want to delete the invite for %{invite_name}?",
- invite_name: invite.name
- ),
- qa: "delete-#{invite.id}"
- ] do %>
+ <.link
+ href="#"
+ class="text-primary-600 link"
+ phx-click="delete_invite"
+ phx-value-id={invite.id}
+ data-confirm={
+ dgettext("prompts", "Are you sure you want to delete the invite for %{invite_name}?",
+ invite_name: invite.name
+ )
+ }
+ data-qa={"delete-#{invite.id}"}
+ >
- <% end %>
+
<%= if invite.disabled_at |> is_nil() do %>
@@ -92,20 +93,21 @@
<%= for admin <- @admins do %>
<.user_card user={admin}>
- <%= link to: "#",
- class: "text-primary-600 link",
- phx_click: "delete_user",
- phx_value_id: admin.id,
- data: [
- confirm:
- dgettext(
- "prompts",
- "Are you sure you want to delete %{email}? This action is permanent!",
- email: admin.email
- )
- ] do %>
+ <.link
+ href="#"
+ class="text-primary-600 link"
+ phx-click="delete_user"
+ phx-value-id={admin.id}
+ data-confirm={
+ dgettext(
+ "prompts",
+ "Are you sure you want to delete %{email}? This action is permanent!",
+ email: admin.email
+ )
+ }
+ >
- <% end %>
+
<% end %>
@@ -121,20 +123,21 @@
<%= for user <- @users do %>
<.user_card user={user}>
- <%= link to: "#",
- class: "text-primary-600 link",
- phx_click: "delete_user",
- phx_value_id: user.id,
- data: [
- confirm:
- dgettext(
- "prompts",
- "Are you sure you want to delete %{email}? This action is permanent!",
- email: user.email
- )
- ] do %>
+ <.link
+ href="#"
+ class="text-primary-600 link"
+ phx-click="delete_user"
+ phx-value-id={user.id}
+ data-confirm={
+ dgettext(
+ "prompts",
+ "Are you sure you want to delete %{email}? This action is permanent!",
+ email: user.email
+ )
+ }
+ >
- <% end %>
+
<% end %>
diff --git a/lib/lokal_web/live/live_helpers.ex b/lib/lokal_web/live/live_helpers.ex
index 19fdbedc..d3c1371e 100644
--- a/lib/lokal_web/live/live_helpers.ex
+++ b/lib/lokal_web/live/live_helpers.ex
@@ -3,7 +3,7 @@ defmodule LokalWeb.LiveHelpers do
Contains resuable methods for all liveviews
"""
- import Phoenix.LiveView.Helpers
+ import Phoenix.Component
alias Phoenix.LiveView.JS
@doc """
@@ -27,17 +27,17 @@ defmodule LokalWeb.LiveHelpers do
"""
def modal(assigns) do
~H"""
- <%= live_patch to: @return_to,
- id: "modal-bg",
- class:
- "fade-in fixed z-10 left-0 top-0
+ <.link
+ id="modal-bg"
+ patch={@return_to}
+ class="fade-in fixed z-10 left-0 top-0
w-full h-full overflow-hidden
- p-8 flex flex-col justify-center items-center cursor-auto",
- style: "background-color: rgba(0,0,0,0.4);",
- phx_remove: hide_modal()
- do %>
+ p-8 flex flex-col justify-center items-center cursor-auto"
+ style="background-color: rgba(0,0,0,0.4);"
+ phx_remove={hide_modal()}
+ >
- <% end %>
+
- <%= live_patch to: @return_to,
- id: "close",
- class:
- "absolute top-8 right-10
+ <.link
+ id="close"
+ href={@return_to}
+ class="absolute top-8 right-10
text-gray-500 hover:text-gray-800
- transition-all duration-500 ease-in-out",
- phx_remove: hide_modal() do %>
+ transition-all duration-500 ease-in-out"
+ phx_remove={hide_modal()}
+ >
- <% end %>
+
<%= render_slot(@inner_block) %>
diff --git a/lib/lokal_web/templates/layout/root.html.heex b/lib/lokal_web/templates/layout/root.html.heex
index 144f4b24..1b6e98fc 100644
--- a/lib/lokal_web/templates/layout/root.html.heex
+++ b/lib/lokal_web/templates/layout/root.html.heex
@@ -5,8 +5,9 @@
<%= csrf_meta_tag() %>
- <%= if(assigns |> Map.has_key?(:page_title), do: @page_title, else: "Lokal")
- |> live_title_tag(suffix: " | Lokal") %>
+ <.live_title suffix={" | #{gettext("Lokal")}"}>
+ <%= assigns[:page_title] || gettext("Lokal") %>
+