update to liveview 0.18

This commit is contained in:
shibao 2023-01-26 00:28:34 -05:00 committed by oliviasculley
parent 2c2b9fefc9
commit bbaa1dfd6b
25 changed files with 349 additions and 269 deletions

View File

@ -90,8 +90,8 @@ defmodule LokalWeb do
# Use all HTML functionality (forms, tags, etc) # Use all HTML functionality (forms, tags, etc)
use Phoenix.HTML use Phoenix.HTML
# Import LiveView and .heex helpers (live_render, live_patch, <.form>, etc) # Import LiveView and .heex helpers (live_render, link, <.form>, etc)
import Phoenix.LiveView.Helpers import Phoenix.Component
# Import basic rendering functionality (render, render_layout, etc) # Import basic rendering functionality (render, render_layout, etc)
import Phoenix.View import Phoenix.View

View File

@ -7,6 +7,8 @@ defmodule LokalWeb.Components.InviteCard do
alias LokalWeb.Endpoint alias LokalWeb.Endpoint
def invite_card(assigns) do def invite_card(assigns) do
assigns = assigns |> assign_new(:code_actions, fn -> [] end)
~H""" ~H"""
<div class="mx-4 my-2 px-8 py-4 flex flex-col justify-center items-center space-y-4 <div class="mx-4 my-2 px-8 py-4 flex flex-col justify-center items-center space-y-4
border border-gray-400 rounded-lg shadow-lg hover:shadow-md border border-gray-400 rounded-lg shadow-lg hover:shadow-md
@ -17,8 +19,14 @@ defmodule LokalWeb.Components.InviteCard do
<%= if @invite.disabled_at |> is_nil() do %> <%= if @invite.disabled_at |> is_nil() do %>
<h2 class="title text-md"> <h2 class="title text-md">
<%= gettext("Uses Left:") %> <%= if @invite.uses_left do %>
<%= @invite.uses_left || "Unlimited" %> <%= gettext(
"Uses Left: %{uses_left}",
uses_left: @invite.uses_left
) %>
<% else %>
<%= gettext("Uses Left: Unlimited") %>
<% end %>
</h2> </h2>
<% else %> <% else %>
<h2 class="title text-md"> <h2 class="title text-md">
@ -30,13 +38,9 @@ defmodule LokalWeb.Components.InviteCard do
<code <code
id={"code-#{@invite.id}"} id={"code-#{@invite.id}"}
class="mx-2 my-1 text-xs px-4 py-2 rounded-lg text-center break-all text-gray-100 bg-primary-800" class="mx-2 my-1 text-xs px-4 py-2 rounded-lg text-center break-all text-gray-100 bg-primary-800"
> phx-no-format
<%= Routes.user_registration_url(Endpoint, :new, invite: @invite.token) %> ><%= Routes.user_registration_url(Endpoint, :new, invite: @invite.token) %></code>
</code> <%= render_slot(@code_actions) %>
<%= if @code_actions do %>
<%= render_slot(@code_actions) %>
<% end %>
</div> </div>
<%= if @inner_block do %> <%= if @inner_block do %>

View File

@ -16,10 +16,12 @@ defmodule LokalWeb.Components.Topbar do
<nav role="navigation" class="mb-8 px-8 py-4 w-full bg-primary-400"> <nav role="navigation" class="mb-8 px-8 py-4 w-full bg-primary-400">
<div class="flex flex-col sm:flex-row justify-between items-center"> <div class="flex flex-col sm:flex-row justify-between items-center">
<div class="mb-4 sm:mb-0 sm:mr-8 flex flex-row justify-start items-center space-x-2"> <div class="mb-4 sm:mb-0 sm:mr-8 flex flex-row justify-start items-center space-x-2">
<%= live_redirect("Lokal", <.link
to: Routes.live_path(Endpoint, HomeLive), navigate={Routes.live_path(Endpoint, HomeLive)}
class: "mx-2 my-1 leading-5 text-xl text-white hover:underline" class="mx-2 my-1 leading-5 text-xl text-white hover:underline"
) %> >
<%= gettext("Lokal") %>
</.link>
<%= if @title_content do %> <%= if @title_content do %>
<span class="mx-2 my-1"> <span class="mx-2 my-1">
@ -53,47 +55,59 @@ defmodule LokalWeb.Components.Topbar do
</form> </form>
<%= if @current_user.role == :admin do %> <%= if @current_user.role == :admin do %>
<li class="mx-2 my-1"> <li class="mx-2 my-1">
<%= live_redirect(gettext("Invites"), <.link
to: Routes.invite_index_path(Endpoint, :index), navigate={Routes.invite_index_path(Endpoint, :index)}
class: "text-white text-white hover:underline" class="text-white text-white hover:underline"
) %> >
<%= gettext("Invites") %>
</.link>
</li> </li>
<% end %> <% end %>
<li class="mx-2 my-1"> <li class="mx-2 my-1">
<%= live_redirect(@current_user.email, <.link
to: Routes.user_settings_path(Endpoint, :edit), navigate={Routes.user_settings_path(Endpoint, :edit)}
class: "text-white text-white hover:underline truncate" class="text-white text-white hover:underline truncate"
) %> >
<%= @current_user.email %>
</.link>
</li> </li>
<li class="mx-2 my-1"> <li class="mx-2 my-1">
<%= link to: Routes.user_session_path(Endpoint, :delete), <.link
method: :delete, href={Routes.user_session_path(Endpoint, :delete)}
data: [confirm: dgettext("prompts", "Are you sure you want to log out?")] do %> method="delete"
data-confirm={dgettext("prompts", "Are you sure you want to log out?")}
>
<i class="fas fa-sign-out-alt"></i> <i class="fas fa-sign-out-alt"></i>
<% end %> </.link>
</li> </li>
<%= if @current_user.role == :admin and function_exported?(Routes, :live_dashboard_path, 2) do %> <%= if @current_user.role == :admin and function_exported?(Routes, :live_dashboard_path, 2) do %>
<li class="mx-2 my-1"> <li class="mx-2 my-1">
<%= live_redirect to: Routes.live_dashboard_path(Endpoint, :home), <.link
class: "text-white text-white hover:underline" do %> navigate={Routes.live_dashboard_path(Endpoint, :home)}
class="text-white text-white hover:underline"
>
<i class="fas fa-gauge"></i> <i class="fas fa-gauge"></i>
<% end %> </.link>
</li> </li>
<% end %> <% end %>
<% else %> <% else %>
<%= if Accounts.allow_registration?() do %> <%= if Accounts.allow_registration?() do %>
<li class="mx-2 my-1"> <li class="mx-2 my-1">
<%= live_redirect(dgettext("actions", "Register"), <.link
to: Routes.user_registration_path(Endpoint, :new), navigate={Routes.user_registration_path(Endpoint, :new)}
class: "text-white text-white hover:underline truncate" class="text-white text-white hover:underline truncate"
) %> >
<%= dgettext("actions", "Register") %>
</.link>
</li> </li>
<% end %> <% end %>
<li class="mx-2 my-1"> <li class="mx-2 my-1">
<%= live_redirect(dgettext("actions", "Log in"), <.link
to: Routes.user_session_path(Endpoint, :new), navigate={Routes.user_session_path(Endpoint, :new)}
class: "text-white text-white hover:underline truncate" class="text-white text-white hover:underline truncate"
) %> >
<%= dgettext("actions", "Log in") %>
</.link>
</li> </li>
<% end %> <% end %>
</ul> </ul>

View File

@ -19,16 +19,23 @@ defmodule LokalWeb.Components.UserCard do
<h3 class="px-4 py-2 rounded-lg title text-lg"> <h3 class="px-4 py-2 rounded-lg title text-lg">
<p> <p>
<%= if @user.confirmed_at |> is_nil() do %> <%= if @user.confirmed_at do %>
Email unconfirmed <%= gettext(
"User was confirmed at%{confirmed_datetime}",
confirmed_datetime: ""
) %>
<.datetime datetime={@user.confirmed_at} />
<% else %> <% else %>
User was confirmed at <%= @user.confirmed_at |> display_datetime() %> <%= gettext("Email unconfirmed") %>
<% end %> <% end %>
</p> </p>
<p> <p>
<%= gettext("User registered on") %> <%= gettext(
<%= @user.inserted_at |> display_datetime() %> "User registered on%{registered_datetime}",
registered_datetime: ""
) %>
<.datetime datetime={@user.inserted_at} />
</p> </p>
</h3> </h3>

View File

@ -2,7 +2,7 @@ defmodule LokalWeb.InitAssigns do
@moduledoc """ @moduledoc """
Ensures common `assigns` are applied to all LiveViews attaching this hook. Ensures common `assigns` are applied to all LiveViews attaching this hook.
""" """
import Phoenix.LiveView import Phoenix.Component
alias Lokal.Accounts alias Lokal.Accounts
def on_mount(:default, _params, %{"locale" => locale, "user_token" => user_token}, socket) do def on_mount(:default, _params, %{"locale" => locale, "user_token" => user_token}, socket) do

View File

@ -3,7 +3,7 @@
<%= @title %> <%= @title %>
</h2> </h2>
<.form <.form
let={f} :let={f}
for={@changeset} for={@changeset}
id="invite-form" id="invite-form"
class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center" class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"

View File

@ -8,15 +8,13 @@
<%= gettext("No invites 😔") %> <%= gettext("No invites 😔") %>
</h1> </h1>
<%= live_patch(dgettext("actions", "Invite someone new!"), <.link patch={Routes.invite_index_path(Endpoint, :new)} class="btn btn-primary">
to: Routes.invite_index_path(Endpoint, :new), <%= dgettext("actions", "Invite someone new!") %>
class: "btn btn-primary" </.link>
) %>
<% else %> <% else %>
<%= live_patch(dgettext("actions", "Create Invite"), <.link patch={Routes.invite_index_path(Endpoint, :new)} class="btn btn-primary">
to: Routes.invite_index_path(Endpoint, :new), <%= dgettext("actions", "Create Invite") %>
class: "btn btn-primary" </.link>
) %>
<% end %> <% end %>
<div class="w-full flex flex-row flex-wrap justify-center items-center"> <div class="w-full flex flex-row flex-wrap justify-center items-center">
@ -33,25 +31,28 @@
</button> </button>
</form> </form>
</:code_actions> </:code_actions>
<%= live_patch to: Routes.invite_index_path(Endpoint, :edit, invite), <.link
class: "text-primary-600 link", patch={Routes.invite_index_path(Endpoint, :edit, invite)}
data: [qa: "edit-#{invite.id}"] do %> class="text-primary-600 link"
data-qa={"edit-#{invite.id}"}
>
<i class="fa-fw fa-lg fas fa-edit"></i> <i class="fa-fw fa-lg fas fa-edit"></i>
<% end %> </.link>
<%= link to: "#", <.link
class: "text-primary-600 link", href="#"
phx_click: "delete_invite", class="text-primary-600 link"
phx_value_id: invite.id, phx-click="delete_invite"
data: [ phx-value-id={invite.id}
confirm: data-confirm={
dgettext("prompts", "Are you sure you want to delete the invite for %{invite_name}?", dgettext("prompts", "Are you sure you want to delete the invite for %{invite_name}?",
invite_name: invite.name invite_name: invite.name
), )
qa: "delete-#{invite.id}" }
] do %> data-qa={"delete-#{invite.id}"}
>
<i class="fa-fw fa-lg fas fa-trash"></i> <i class="fa-fw fa-lg fas fa-trash"></i>
<% end %> </.link>
<%= if invite.disabled_at |> is_nil() do %> <%= if invite.disabled_at |> is_nil() do %>
<a href="#" class="btn btn-primary" phx-click="disable_invite" phx-value-id={invite.id}> <a href="#" class="btn btn-primary" phx-click="disable_invite" phx-value-id={invite.id}>
@ -92,20 +93,21 @@
<div class="w-full flex flex-row flex-wrap justify-center items-center"> <div class="w-full flex flex-row flex-wrap justify-center items-center">
<%= for admin <- @admins do %> <%= for admin <- @admins do %>
<.user_card user={admin}> <.user_card user={admin}>
<%= link to: "#", <.link
class: "text-primary-600 link", href="#"
phx_click: "delete_user", class="text-primary-600 link"
phx_value_id: admin.id, phx-click="delete_user"
data: [ phx-value-id={admin.id}
confirm: data-confirm={
dgettext( dgettext(
"prompts", "prompts",
"Are you sure you want to delete %{email}? This action is permanent!", "Are you sure you want to delete %{email}? This action is permanent!",
email: admin.email email: admin.email
) )
] do %> }
>
<i class="fa-fw fa-lg fas fa-trash"></i> <i class="fa-fw fa-lg fas fa-trash"></i>
<% end %> </.link>
</.user_card> </.user_card>
<% end %> <% end %>
</div> </div>
@ -121,20 +123,21 @@
<div class="w-full flex flex-row flex-wrap justify-center items-center"> <div class="w-full flex flex-row flex-wrap justify-center items-center">
<%= for user <- @users do %> <%= for user <- @users do %>
<.user_card user={user}> <.user_card user={user}>
<%= link to: "#", <.link
class: "text-primary-600 link", href="#"
phx_click: "delete_user", class="text-primary-600 link"
phx_value_id: user.id, phx-click="delete_user"
data: [ phx-value-id={user.id}
confirm: data-confirm={
dgettext( dgettext(
"prompts", "prompts",
"Are you sure you want to delete %{email}? This action is permanent!", "Are you sure you want to delete %{email}? This action is permanent!",
email: user.email email: user.email
) )
] do %> }
>
<i class="fa-fw fa-lg fas fa-trash"></i> <i class="fa-fw fa-lg fas fa-trash"></i>
<% end %> </.link>
</.user_card> </.user_card>
<% end %> <% end %>
</div> </div>

View File

@ -3,7 +3,7 @@ defmodule LokalWeb.LiveHelpers do
Contains resuable methods for all liveviews Contains resuable methods for all liveviews
""" """
import Phoenix.LiveView.Helpers import Phoenix.Component
alias Phoenix.LiveView.JS alias Phoenix.LiveView.JS
@doc """ @doc """
@ -27,17 +27,17 @@ defmodule LokalWeb.LiveHelpers do
""" """
def modal(assigns) do def modal(assigns) do
~H""" ~H"""
<%= live_patch to: @return_to, <.link
id: "modal-bg", id="modal-bg"
class: patch={@return_to}
"fade-in fixed z-10 left-0 top-0 class="fade-in fixed z-10 left-0 top-0
w-full h-full overflow-hidden w-full h-full overflow-hidden
p-8 flex flex-col justify-center items-center cursor-auto", p-8 flex flex-col justify-center items-center cursor-auto"
style: "background-color: rgba(0,0,0,0.4);", style="background-color: rgba(0,0,0,0.4);"
phx_remove: hide_modal() phx_remove={hide_modal()}
do %> >
<span class="hidden"></span> <span class="hidden"></span>
<% end %> </.link>
<div <div
id="modal" id="modal"
@ -53,15 +53,16 @@ defmodule LokalWeb.LiveHelpers do
flex flex-col justify-start items-center flex flex-col justify-start items-center
bg-white border-2 rounded-lg" bg-white border-2 rounded-lg"
> >
<%= live_patch to: @return_to, <.link
id: "close", id="close"
class: href={@return_to}
"absolute top-8 right-10 class="absolute top-8 right-10
text-gray-500 hover:text-gray-800 text-gray-500 hover:text-gray-800
transition-all duration-500 ease-in-out", transition-all duration-500 ease-in-out"
phx_remove: hide_modal() do %> phx_remove={hide_modal()}
>
<i class="fa-fw fa-lg fas fa-times"></i> <i class="fa-fw fa-lg fas fa-times"></i>
<% end %> </.link>
<div class="overflow-x-hidden overflow-y-auto w-full p-8 flex flex-col space-y-4 justify-start items-center"> <div class="overflow-x-hidden overflow-y-auto w-full p-8 flex flex-col space-y-4 justify-start items-center">
<%= render_slot(@inner_block) %> <%= render_slot(@inner_block) %>

View File

@ -5,8 +5,9 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<%= csrf_meta_tag() %> <%= csrf_meta_tag() %>
<%= if(assigns |> Map.has_key?(:page_title), do: @page_title, else: "Lokal") <.live_title suffix={" | #{gettext("Lokal")}"}>
|> live_title_tag(suffix: " | Lokal") %> <%= assigns[:page_title] || gettext("Lokal") %>
</.live_title>
<link phx-track-static rel="stylesheet" href={Routes.static_path(@conn, "/css/app.css")} /> <link phx-track-static rel="stylesheet" href={Routes.static_path(@conn, "/css/app.css")} />
<script <script
defer defer

View File

@ -4,7 +4,7 @@
</h1> </h1>
<.form <.form
let={f} :let={f}
for={:user} for={:user}
action={Routes.user_confirmation_path(@conn, :create)} action={Routes.user_confirmation_path(@conn, :create)}
class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center" class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
@ -21,14 +21,12 @@
<div class="flex flex-row justify-center items-center space-x-4"> <div class="flex flex-row justify-center items-center space-x-4">
<%= if Accounts.allow_registration?() do %> <%= if Accounts.allow_registration?() do %>
<%= link(dgettext("actions", "Register"), <.link href={Routes.user_registration_path(@conn, :new)} class="btn btn-primary">
to: Routes.user_registration_path(@conn, :new), <%= dgettext("actions", "Register") %>
class: "btn btn-primary" </.link>
) %>
<% end %> <% end %>
<%= link(dgettext("actions", "Log in"), <.link href={Routes.user_session_path(@conn, :new)} class="btn btn-primary">
to: Routes.user_session_path(@conn, :new), <%= dgettext("actions", "Log in") %>
class: "btn btn-primary" </.link>
) %>
</div> </div>
</div> </div>

View File

@ -4,7 +4,7 @@
</h1> </h1>
<.form <.form
let={f} :let={f}
for={@changeset} for={@changeset}
action={Routes.user_registration_path(@conn, :create)} action={Routes.user_registration_path(@conn, :create)}
class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center" class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
@ -44,13 +44,11 @@
<hr class="hr" /> <hr class="hr" />
<div class="flex flex-row justify-center items-center space-x-4"> <div class="flex flex-row justify-center items-center space-x-4">
<%= link(dgettext("actions", "Log in"), <.link href={Routes.user_session_path(@conn, :new)} class="btn btn-primary">
to: Routes.user_session_path(@conn, :new), <%= dgettext("actions", "Log in") %>
class: "btn btn-primary" </.link>
) %> <.link href={Routes.user_reset_password_path(@conn, :new)} class="btn btn-primary">
<%= link(dgettext("actions", "Forgot your password?"), <%= dgettext("actions", "Forgot your password?") %>
to: Routes.user_reset_password_path(@conn, :new), </.link>
class: "btn btn-primary"
) %>
</div> </div>
</div> </div>

View File

@ -4,7 +4,7 @@
</h1> </h1>
<.form <.form
let={f} :let={f}
for={@changeset} for={@changeset}
action={Routes.user_reset_password_path(@conn, :update, @token)} action={Routes.user_reset_password_path(@conn, :update, @token)}
class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center" class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
@ -39,14 +39,12 @@
<div class="flex flex-row justify-center items-center space-x-4"> <div class="flex flex-row justify-center items-center space-x-4">
<%= if Accounts.allow_registration?() do %> <%= if Accounts.allow_registration?() do %>
<%= link(dgettext("actions", "Register"), <.link href={Routes.user_registration_path(@conn, :new)} class="btn btn-primary">
to: Routes.user_registration_path(@conn, :new), <%= dgettext("actions", "Register") %>
class: "btn btn-primary" </.link>
) %>
<% end %> <% end %>
<%= link(dgettext("actions", "Log in"), <.link href={Routes.user_session_path(@conn, :new)} class="btn btn-primary">
to: Routes.user_session_path(@conn, :new), <%= dgettext("actions", "Log in") %>
class: "btn btn-primary" </.link>
) %>
</div> </div>
</div> </div>

View File

@ -4,7 +4,7 @@
</h1> </h1>
<.form <.form
let={f} :let={f}
for={:user} for={:user}
action={Routes.user_reset_password_path(@conn, :create)} action={Routes.user_reset_password_path(@conn, :create)}
class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center" class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
@ -21,14 +21,12 @@
<div class="flex flex-row justify-center items-center space-x-4"> <div class="flex flex-row justify-center items-center space-x-4">
<%= if Accounts.allow_registration?() do %> <%= if Accounts.allow_registration?() do %>
<%= link(dgettext("actions", "Register"), <.link href={Routes.user_registration_path(@conn, :new)} class="btn btn-primary">
to: Routes.user_registration_path(@conn, :new), <%= dgettext("actions", "Register") %>
class: "btn btn-primary" </.link>
) %>
<% end %> <% end %>
<%= link(dgettext("actions", "Log in"), <.link href={Routes.user_session_path(@conn, :new)} class="btn btn-primary">
to: Routes.user_session_path(@conn, :new), <%= dgettext("actions", "Log in") %>
class: "btn btn-primary" </.link>
) %>
</div> </div>
</div> </div>

View File

@ -4,7 +4,7 @@
</h1> </h1>
<.form <.form
let={f} :let={f}
for={@conn} for={@conn}
action={Routes.user_session_path(@conn, :create)} action={Routes.user_session_path(@conn, :create)}
as="user" as="user"
@ -36,14 +36,12 @@
<div class="flex flex-row justify-center items-center space-x-4"> <div class="flex flex-row justify-center items-center space-x-4">
<%= if Accounts.allow_registration?() do %> <%= if Accounts.allow_registration?() do %>
<%= link(dgettext("actions", "Register"), <.link href={Routes.user_registration_path(@conn, :new)} class="btn btn-primary">
to: Routes.user_registration_path(@conn, :new), <%= dgettext("actions", "Register") %>
class: "btn btn-primary" </.link>
) %>
<% end %> <% end %>
<%= link(dgettext("actions", "Forgot your password?"), <.link href={Routes.user_reset_password_path(@conn, :new)} class="btn btn-primary">
to: Routes.user_reset_password_path(@conn, :new), <%= dgettext("actions", "Forgot your password?") %>
class: "btn btn-primary" </.link>
) %>
</div> </div>
</div> </div>

View File

@ -6,7 +6,7 @@
<hr class="hr" /> <hr class="hr" />
<.form <.form
let={f} :let={f}
for={@email_changeset} for={@email_changeset}
action={Routes.user_settings_path(@conn, :update)} action={Routes.user_settings_path(@conn, :update)}
class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center" class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
@ -49,7 +49,7 @@
<hr class="hr" /> <hr class="hr" />
<.form <.form
let={f} :let={f}
for={@password_changeset} for={@password_changeset}
action={Routes.user_settings_path(@conn, :update)} action={Routes.user_settings_path(@conn, :update)}
class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center" class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
@ -104,7 +104,7 @@
<hr class="hr" /> <hr class="hr" />
<.form <.form
let={f} :let={f}
for={@locale_changeset} for={@locale_changeset}
action={Routes.user_settings_path(@conn, :update)} action={Routes.user_settings_path(@conn, :update)}
class="flex flex-col space-y-4 justify-center items-center" class="flex flex-col space-y-4 justify-center items-center"
@ -136,10 +136,12 @@
<hr class="hr" /> <hr class="hr" />
<%= link(dgettext("actions", "Delete User"), <.link
to: Routes.user_settings_path(@conn, :delete, @current_user), href={Routes.user_settings_path(@conn, :delete, @current_user)}
method: :delete, method={:delete}
class: "btn btn-alert", class="btn btn-alert"
data: [confirm: dgettext("prompts", "Are you sure you want to delete your account?")] data-confirm={dgettext("prompts", "Are you sure you want to delete your account?")}
) %> >
<%= dgettext("actions", "Delete User") %>
</.link>
</div> </div>

View File

@ -4,7 +4,7 @@ defmodule LokalWeb.ErrorHelpers do
""" """
use Phoenix.HTML use Phoenix.HTML
import Phoenix.LiveView.Helpers import Phoenix.Component
alias Ecto.Changeset alias Ecto.Changeset
alias Phoenix.{HTML.Form, LiveView.Rendered} alias Phoenix.{HTML.Form, LiveView.Rendered}

View File

@ -5,48 +5,62 @@ defmodule LokalWeb.ViewHelpers do
:view` :view`
""" """
import Phoenix.LiveView.Helpers use Phoenix.Component
@doc """ @doc """
Returns a <time> element that renders the naivedatetime in the user's local Phoenix.Component for a <time> element that renders the naivedatetime in the
timezone with Alpine.js user's local timezone with Alpine.js
""" """
@spec display_datetime(NaiveDateTime.t() | nil) :: Phoenix.LiveView.Rendered.t()
def display_datetime(nil), do: ""
def display_datetime(datetime) do attr :datetime, :any, required: true, doc: "A `DateTime` struct or nil"
assigns = %{
datetime: datetime |> DateTime.from_naive!("Etc/UTC") |> DateTime.to_iso8601(:extended)
}
def datetime(assigns) do
~H""" ~H"""
<time datetime={@datetime} x-data={"{ <%= if @datetime do %>
date: <time
Intl.DateTimeFormat([], {dateStyle: 'short', timeStyle: 'long'}) datetime={cast_datetime(@datetime)}
.format(new Date(\"#{@datetime}\")) x-data={"{
}"} x-text="date"> datetime:
<%= @datetime %> Intl.DateTimeFormat([], {dateStyle: 'short', timeStyle: 'long'})
</time> .format(new Date(\"#{cast_datetime(@datetime)}\"))
}"}
x-text="datetime"
>
<%= cast_datetime(@datetime) %>
</time>
<% end %>
""" """
end end
@spec cast_datetime(NaiveDateTime.t() | nil) :: String.t()
defp cast_datetime(%NaiveDateTime{} = datetime) do
datetime |> DateTime.from_naive!("Etc/UTC") |> DateTime.to_iso8601(:extended)
end
defp cast_datetime(_datetime), do: ""
@doc """ @doc """
Returns a <date> element that renders the Date in the user's local Phoenix.Component for a <date> element that renders the Date in the user's
timezone with Alpine.js local timezone with Alpine.js
""" """
@spec display_date(Date.t() | nil) :: Phoenix.LiveView.Rendered.t()
def display_date(nil), do: ""
def display_date(date) do attr :date, :any, required: true, doc: "A `Date` struct or nil"
assigns = %{date: date |> Date.to_iso8601(:extended)}
def date(assigns) do
~H""" ~H"""
<time datetime={@date} x-data={"{ <%= if @date do %>
date: <time
Intl.DateTimeFormat([], {timeZone: 'Etc/UTC', dateStyle: 'short'}).format(new Date(\"#{@date}\")) datetime={@date |> Date.to_iso8601(:extended)}
}"} x-text="date"> x-data={"{
<%= @date %> date:
</time> Intl.DateTimeFormat([], {timeZone: 'Etc/UTC', dateStyle: 'short'})
.format(new Date(\"#{@date |> Date.to_iso8601(:extended)}\"))
}"}
x-text="date"
>
<%= @date |> Date.to_iso8601(:extended) %>
</time>
<% end %>
""" """
end end
end end

13
mix.exs
View File

@ -48,21 +48,22 @@ defmodule Lokal.MixProject do
defp deps do defp deps do
[ [
{:bcrypt_elixir, "~> 2.0"}, {:bcrypt_elixir, "~> 2.0"},
{:phoenix, "~> 1.6.6"}, {:phoenix, "~> 1.6.0"},
{:phoenix_ecto, "~> 4.4"}, {:phoenix_ecto, "~> 4.4"},
{:ecto_sql, "~> 3.6"},
{:postgrex, ">= 0.0.0"},
{:phoenix_html, "~> 3.0"}, {:phoenix_html, "~> 3.0"},
{:phoenix_live_reload, "~> 1.2", only: :dev}, {:phoenix_live_reload, "~> 1.2", only: :dev},
{:phoenix_live_view, "~> 0.17.5"}, {:phoenix_live_view, "~> 0.18.0"},
{:floki, ">= 0.30.0", only: :test}, {:phoenix_view, "~> 1.1"},
{:phoenix_live_dashboard, "~> 0.6"}, {:phoenix_live_dashboard, "~> 0.6"},
{:oban, "~> 2.10"}, {:ecto_sql, "~> 3.6"},
{:postgrex, ">= 0.0.0"},
{:floki, ">= 0.30.0", only: :test},
# {:esbuild, "~> 0.3", runtime: Mix.env() == :dev}, # {:esbuild, "~> 0.3", runtime: Mix.env() == :dev},
{:ex_doc, "~> 0.27", only: :dev, runtime: false}, {:ex_doc, "~> 0.27", only: :dev, runtime: false},
{:swoosh, "~> 1.6"}, {:swoosh, "~> 1.6"},
{:gen_smtp, "~> 1.0"}, {:gen_smtp, "~> 1.0"},
{:phoenix_swoosh, "~> 1.0"}, {:phoenix_swoosh, "~> 1.0"},
{:oban, "~> 2.10"},
{:telemetry_metrics, "~> 0.6"}, {:telemetry_metrics, "~> 0.6"},
{:telemetry_poller, "~> 1.0"}, {:telemetry_poller, "~> 1.0"},
{:gettext, "~> 0.18"}, {:gettext, "~> 0.18"},

View File

@ -33,13 +33,12 @@
"phoenix": {:hex, :phoenix, "1.6.15", "0a1d96bbc10747fd83525370d691953cdb6f3ccbac61aa01b4acb012474b047d", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 1.0 or ~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.2", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d70ab9fbf6b394755ea88b644d34d79d8b146e490973151f248cacd122d20672"}, "phoenix": {:hex, :phoenix, "1.6.15", "0a1d96bbc10747fd83525370d691953cdb6f3ccbac61aa01b4acb012474b047d", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 1.0 or ~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.2", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d70ab9fbf6b394755ea88b644d34d79d8b146e490973151f248cacd122d20672"},
"phoenix_ecto": {:hex, :phoenix_ecto, "4.4.0", "0672ed4e4808b3fbed494dded89958e22fb882de47a97634c0b13e7b0b5f7720", [:mix], [{:ecto, "~> 3.3", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "09864e558ed31ee00bd48fcc1d4fc58ae9678c9e81649075431e69dbabb43cc1"}, "phoenix_ecto": {:hex, :phoenix_ecto, "4.4.0", "0672ed4e4808b3fbed494dded89958e22fb882de47a97634c0b13e7b0b5f7720", [:mix], [{:ecto, "~> 3.3", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "09864e558ed31ee00bd48fcc1d4fc58ae9678c9e81649075431e69dbabb43cc1"},
"phoenix_html": {:hex, :phoenix_html, "3.2.0", "1c1219d4b6cb22ac72f12f73dc5fad6c7563104d083f711c3fcd8551a1f4ae11", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "36ec97ba56d25c0136ef1992c37957e4246b649d620958a1f9fa86165f8bc54f"}, "phoenix_html": {:hex, :phoenix_html, "3.2.0", "1c1219d4b6cb22ac72f12f73dc5fad6c7563104d083f711c3fcd8551a1f4ae11", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "36ec97ba56d25c0136ef1992c37957e4246b649d620958a1f9fa86165f8bc54f"},
"phoenix_live_dashboard": {:hex, :phoenix_live_dashboard, "0.6.5", "1495bb014be12c9a9252eca04b9af54246f6b5c1e4cd1f30210cd00ec540cf8e", [:mix], [{:ecto, "~> 3.6.2 or ~> 3.7", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_mysql_extras, "~> 0.3", [hex: :ecto_mysql_extras, repo: "hexpm", optional: true]}, {:ecto_psql_extras, "~> 0.7", [hex: :ecto_psql_extras, repo: "hexpm", optional: true]}, {:mime, "~> 1.6 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.17.7", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:telemetry_metrics, "~> 0.6.0", [hex: :telemetry_metrics, repo: "hexpm", optional: false]}], "hexpm", "ef4fa50dd78364409039c99cf6f98ab5209b4c5f8796c17f4db118324f0db852"}, "phoenix_live_dashboard": {:hex, :phoenix_live_dashboard, "0.7.1", "b0bf8f3348dec4910907a2ad1453e642f6fe4d444376c1c9b26222d63c73cf97", [:mix], [{:ecto, "~> 3.6.2 or ~> 3.7", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_mysql_extras, "~> 0.5", [hex: :ecto_mysql_extras, repo: "hexpm", optional: true]}, {:ecto_psql_extras, "~> 0.7", [hex: :ecto_psql_extras, repo: "hexpm", optional: true]}, {:mime, "~> 1.6 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.18.0", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:telemetry_metrics, "~> 0.6 or ~> 1.0", [hex: :telemetry_metrics, repo: "hexpm", optional: false]}], "hexpm", "b6c5d744bf4b40692b1b361d3608bdfd05aeab83e17c7bc217d730f007f31abf"},
"phoenix_live_reload": {:hex, :phoenix_live_reload, "1.4.1", "2aff698f5e47369decde4357ba91fc9c37c6487a512b41732818f2204a8ef1d3", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "9bffb834e7ddf08467fe54ae58b5785507aaba6255568ae22b4d46e2bb3615ab"}, "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.4.1", "2aff698f5e47369decde4357ba91fc9c37c6487a512b41732818f2204a8ef1d3", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "9bffb834e7ddf08467fe54ae58b5785507aaba6255568ae22b4d46e2bb3615ab"},
"phoenix_live_view": {:hex, :phoenix_live_view, "0.17.12", "74f4c0ad02d7deac2d04f50b52827a5efdc5c6e7fac5cede145f5f0e4183aedc", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.0 or ~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.1", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "af6dd5e0aac16ff43571f527a8e0616d62cb80b10eb87aac82170243e50d99c8"}, "phoenix_live_view": {:hex, :phoenix_live_view, "0.18.2", "635cf07de947235deb030cd6b776c71a3b790ab04cebf526aa8c879fe17c7784", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.1", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "da287a77327e996cc166e4c440c3ad5ab33ccdb151b91c793209b39ebbce5b75"},
"phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.1", "ba04e489ef03763bf28a17eb2eaddc2c20c6d217e2150a61e3298b0f4c2012b5", [:mix], [], "hexpm", "81367c6d1eea5878ad726be80808eb5a787a23dee699f96e72b1109c57cdd8d9"}, "phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.1", "ba04e489ef03763bf28a17eb2eaddc2c20c6d217e2150a61e3298b0f4c2012b5", [:mix], [], "hexpm", "81367c6d1eea5878ad726be80808eb5a787a23dee699f96e72b1109c57cdd8d9"},
"phoenix_swoosh": {:hex, :phoenix_swoosh, "1.1.0", "f8e4780705c9f254cc853f7a40e25f7198ba4d91102bcfad2226669b69766b35", [:mix], [{:finch, "~> 0.8", [hex: :finch, repo: "hexpm", optional: true]}, {:hackney, "~> 1.10", [hex: :hackney, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6", [hex: :phoenix, repo: "hexpm", optional: true]}, {:phoenix_html, "~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_view, "~> 1.0 or ~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: false]}, {:swoosh, "~> 1.5", [hex: :swoosh, repo: "hexpm", optional: false]}], "hexpm", "aa82f10afd9a4b6080fdf3274dbb9432b25b210d42b4b6b55308f6e59cd87c3d"}, "phoenix_swoosh": {:hex, :phoenix_swoosh, "1.1.0", "f8e4780705c9f254cc853f7a40e25f7198ba4d91102bcfad2226669b69766b35", [:mix], [{:finch, "~> 0.8", [hex: :finch, repo: "hexpm", optional: true]}, {:hackney, "~> 1.10", [hex: :hackney, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6", [hex: :phoenix, repo: "hexpm", optional: true]}, {:phoenix_html, "~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_view, "~> 1.0 or ~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: false]}, {:swoosh, "~> 1.5", [hex: :swoosh, repo: "hexpm", optional: false]}], "hexpm", "aa82f10afd9a4b6080fdf3274dbb9432b25b210d42b4b6b55308f6e59cd87c3d"},
"phoenix_template": {:hex, :phoenix_template, "1.0.0", "c57bc5044f25f007dc86ab21895688c098a9f846a8dda6bc40e2d0ddc146e38f", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "1b066f99a26fd22064c12b2600a9a6e56700f591bf7b20b418054ea38b4d4357"}, "phoenix_view": {:hex, :phoenix_view, "1.1.2", "1b82764a065fb41051637872c7bd07ed2fdb6f5c3bd89684d4dca6e10115c95a", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "7ae90ad27b09091266f6adbb61e1d2516a7c3d7062c6789d46a7554ec40f3a56"},
"phoenix_view": {:hex, :phoenix_view, "2.0.2", "6bd4d2fd595ef80d33b439ede6a19326b78f0f1d8d62b9a318e3d9c1af351098", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}], "hexpm", "a929e7230ea5c7ee0e149ffcf44ce7cf7f4b6d2bfe1752dd7c084cdff152d36f"},
"plug": {:hex, :plug, "1.14.0", "ba4f558468f69cbd9f6b356d25443d0b796fbdc887e03fa89001384a9cac638f", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "bf020432c7d4feb7b3af16a0c2701455cbbbb95e5b6866132cb09eb0c29adc14"}, "plug": {:hex, :plug, "1.14.0", "ba4f558468f69cbd9f6b356d25443d0b796fbdc887e03fa89001384a9cac638f", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "bf020432c7d4feb7b3af16a0c2701455cbbbb95e5b6866132cb09eb0c29adc14"},
"plug_cowboy": {:hex, :plug_cowboy, "2.6.0", "d1cf12ff96a1ca4f52207c5271a6c351a4733f413803488d75b70ccf44aebec2", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "073cf20b753ce6682ed72905cd62a2d4bd9bad1bf9f7feb02a1b8e525bd94fa6"}, "plug_cowboy": {:hex, :plug_cowboy, "2.6.0", "d1cf12ff96a1ca4f52207c5271a6c351a4733f413803488d75b70ccf44aebec2", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "073cf20b753ce6682ed72905cd62a2d4bd9bad1bf9f7feb02a1b8e525bd94fa6"},
"plug_crypto": {:hex, :plug_crypto, "1.2.3", "8f77d13aeb32bfd9e654cb68f0af517b371fb34c56c9f2b58fe3df1235c1251a", [:mix], [], "hexpm", "b5672099c6ad5c202c45f5a403f21a3411247f164e4a8fab056e5cd8a290f4a2"}, "plug_crypto": {:hex, :plug_crypto, "1.2.3", "8f77d13aeb32bfd9e654cb68f0af517b371fb34c56c9f2b58fe3df1235c1251a", [:mix], [], "hexpm", "b5672099c6ad5c202c45f5a403f21a3411247f164e4a8fab056e5cd8a290f4a2"},

View File

@ -22,7 +22,7 @@ msgstr ""
msgid "Change password" msgid "Change password"
msgstr "" msgstr ""
#: lib/lokal_web/templates/user_settings/edit.html.heex:139 #: lib/lokal_web/templates/user_settings/edit.html.heex:145
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Delete User" msgid "Delete User"
msgstr "" msgstr ""
@ -34,9 +34,9 @@ msgstr ""
msgid "Forgot your password?" msgid "Forgot your password?"
msgstr "" msgstr ""
#: lib/lokal_web/components/topbar.ex:93 #: lib/lokal_web/components/topbar.ex:109
#: lib/lokal_web/templates/user_confirmation/new.html.heex:29 #: lib/lokal_web/templates/user_confirmation/new.html.heex:29
#: lib/lokal_web/templates/user_registration/new.html.heex:47 #: lib/lokal_web/templates/user_registration/new.html.heex:48
#: lib/lokal_web/templates/user_reset_password/edit.html.heex:47 #: lib/lokal_web/templates/user_reset_password/edit.html.heex:47
#: lib/lokal_web/templates/user_reset_password/new.html.heex:29 #: lib/lokal_web/templates/user_reset_password/new.html.heex:29
#: lib/lokal_web/templates/user_session/new.html.heex:3 #: lib/lokal_web/templates/user_session/new.html.heex:3
@ -45,13 +45,13 @@ msgstr ""
msgid "Log in" msgid "Log in"
msgstr "" msgstr ""
#: lib/lokal_web/components/topbar.ex:86 #: lib/lokal_web/components/topbar.ex:100
#: lib/lokal_web/templates/user_confirmation/new.html.heex:24 #: lib/lokal_web/templates/user_confirmation/new.html.heex:25
#: lib/lokal_web/templates/user_registration/new.html.heex:3 #: lib/lokal_web/templates/user_registration/new.html.heex:3
#: lib/lokal_web/templates/user_registration/new.html.heex:41 #: lib/lokal_web/templates/user_registration/new.html.heex:41
#: lib/lokal_web/templates/user_reset_password/edit.html.heex:42 #: lib/lokal_web/templates/user_reset_password/edit.html.heex:43
#: lib/lokal_web/templates/user_reset_password/new.html.heex:24 #: lib/lokal_web/templates/user_reset_password/new.html.heex:25
#: lib/lokal_web/templates/user_session/new.html.heex:39 #: lib/lokal_web/templates/user_session/new.html.heex:40
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Register" msgid "Register"
msgstr "" msgstr ""
@ -73,7 +73,7 @@ msgstr ""
msgid "Send instructions to reset password" msgid "Send instructions to reset password"
msgstr "" msgstr ""
#: lib/lokal_web/live/invite_live/index.html.heex:32 #: lib/lokal_web/live/invite_live/index.html.heex:30
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Copy to clipboard" msgid "Copy to clipboard"
msgstr "" msgstr ""
@ -83,7 +83,7 @@ msgstr ""
msgid "Create Invite" msgid "Create Invite"
msgstr "" msgstr ""
#: lib/lokal_web/live/invite_live/index.html.heex:11 #: lib/lokal_web/live/invite_live/index.html.heex:12
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Invite someone new!" msgid "Invite someone new!"
msgstr "" msgstr ""

View File

@ -31,12 +31,12 @@ msgstr ""
msgid "Forgot your password?" msgid "Forgot your password?"
msgstr "" msgstr ""
#: lib/lokal_web/components/invite_card.ex:25 #: lib/lokal_web/components/invite_card.ex:33
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Invite Disabled" msgid "Invite Disabled"
msgstr "" msgstr ""
#: lib/lokal_web/components/topbar.ex:56 #: lib/lokal_web/components/topbar.ex:62
#: lib/lokal_web/live/invite_live/index.ex:41 #: lib/lokal_web/live/invite_live/index.ex:41
#: lib/lokal_web/live/invite_live/index.html.heex:3 #: lib/lokal_web/live/invite_live/index.html.heex:3
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
@ -84,11 +84,6 @@ msgstr ""
msgid "Shop from your community" msgid "Shop from your community"
msgstr "" msgstr ""
#: lib/lokal_web/components/invite_card.ex:20
#, elixir-autogen, elixir-format
msgid "Uses Left:"
msgstr ""
#: lib/lokal_web/live/home_live.html.heex:3 #: lib/lokal_web/live/home_live.html.heex:3
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Welcome to Lokal" msgid "Welcome to Lokal"
@ -99,12 +94,12 @@ msgstr ""
msgid "Home" msgid "Home"
msgstr "" msgstr ""
#: lib/lokal_web/live/invite_live/index.html.heex:89 #: lib/lokal_web/live/invite_live/index.html.heex:90
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Admins" msgid "Admins"
msgstr "" msgstr ""
#: lib/lokal_web/live/invite_live/index.html.heex:58 #: lib/lokal_web/live/invite_live/index.html.heex:59
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Disable" msgid "Disable"
msgstr "" msgstr ""
@ -114,7 +109,7 @@ msgstr ""
msgid "Edit Invite" msgid "Edit Invite"
msgstr "" msgstr ""
#: lib/lokal_web/live/invite_live/index.html.heex:62 #: lib/lokal_web/live/invite_live/index.html.heex:63
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Enable" msgid "Enable"
msgstr "" msgstr ""
@ -134,12 +129,12 @@ msgstr ""
msgid "No invites 😔" msgid "No invites 😔"
msgstr "" msgstr ""
#: lib/lokal_web/live/invite_live/index.html.heex:78 #: lib/lokal_web/live/invite_live/index.html.heex:79
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Set Unlimited" msgid "Set Unlimited"
msgstr "" msgstr ""
#: lib/lokal_web/live/invite_live/index.html.heex:118 #: lib/lokal_web/live/invite_live/index.html.heex:120
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Users" msgid "Users"
msgstr "" msgstr ""
@ -155,12 +150,39 @@ msgstr ""
msgid "English" msgid "English"
msgstr "" msgstr ""
#: lib/lokal_web/components/user_card.ex:30
#, elixir-autogen, elixir-format
msgid "User registered on"
msgstr ""
#: lib/lokal_web/templates/user_registration/new.html.heex:32 #: lib/lokal_web/templates/user_registration/new.html.heex:32
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Language" msgid "Language"
msgstr "" msgstr ""
#: lib/lokal_web/components/user_card.ex:29
#, elixir-autogen, elixir-format
msgid "Email unconfirmed"
msgstr ""
#: lib/lokal_web/components/topbar.ex:23
#: lib/lokal_web/templates/layout/root.html.heex:8
#: lib/lokal_web/templates/layout/root.html.heex:9
#, elixir-autogen, elixir-format
msgid "Lokal"
msgstr ""
#: lib/lokal_web/components/user_card.ex:34
#, elixir-autogen, elixir-format
msgid "User registered on%{registered_datetime}"
msgstr ""
#: lib/lokal_web/components/user_card.ex:23
#, elixir-autogen, elixir-format
msgid "User was confirmed at%{confirmed_datetime}"
msgstr ""
#: lib/lokal_web/components/invite_card.ex:23
#, elixir-autogen, elixir-format
msgid "Uses Left: %{uses_left}"
msgstr ""
#: lib/lokal_web/components/invite_card.ex:28
#, elixir-autogen, elixir-format
msgid "Uses Left: Unlimited"
msgstr ""

View File

@ -22,7 +22,7 @@ msgstr ""
msgid "Change password" msgid "Change password"
msgstr "" msgstr ""
#: lib/lokal_web/templates/user_settings/edit.html.heex:139 #: lib/lokal_web/templates/user_settings/edit.html.heex:145
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Delete User" msgid "Delete User"
msgstr "" msgstr ""
@ -34,9 +34,9 @@ msgstr ""
msgid "Forgot your password?" msgid "Forgot your password?"
msgstr "" msgstr ""
#: lib/lokal_web/components/topbar.ex:93 #: lib/lokal_web/components/topbar.ex:109
#: lib/lokal_web/templates/user_confirmation/new.html.heex:29 #: lib/lokal_web/templates/user_confirmation/new.html.heex:29
#: lib/lokal_web/templates/user_registration/new.html.heex:47 #: lib/lokal_web/templates/user_registration/new.html.heex:48
#: lib/lokal_web/templates/user_reset_password/edit.html.heex:47 #: lib/lokal_web/templates/user_reset_password/edit.html.heex:47
#: lib/lokal_web/templates/user_reset_password/new.html.heex:29 #: lib/lokal_web/templates/user_reset_password/new.html.heex:29
#: lib/lokal_web/templates/user_session/new.html.heex:3 #: lib/lokal_web/templates/user_session/new.html.heex:3
@ -45,13 +45,13 @@ msgstr ""
msgid "Log in" msgid "Log in"
msgstr "" msgstr ""
#: lib/lokal_web/components/topbar.ex:86 #: lib/lokal_web/components/topbar.ex:100
#: lib/lokal_web/templates/user_confirmation/new.html.heex:24 #: lib/lokal_web/templates/user_confirmation/new.html.heex:25
#: lib/lokal_web/templates/user_registration/new.html.heex:3 #: lib/lokal_web/templates/user_registration/new.html.heex:3
#: lib/lokal_web/templates/user_registration/new.html.heex:41 #: lib/lokal_web/templates/user_registration/new.html.heex:41
#: lib/lokal_web/templates/user_reset_password/edit.html.heex:42 #: lib/lokal_web/templates/user_reset_password/edit.html.heex:43
#: lib/lokal_web/templates/user_reset_password/new.html.heex:24 #: lib/lokal_web/templates/user_reset_password/new.html.heex:25
#: lib/lokal_web/templates/user_session/new.html.heex:39 #: lib/lokal_web/templates/user_session/new.html.heex:40
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Register" msgid "Register"
msgstr "" msgstr ""
@ -73,7 +73,7 @@ msgstr ""
msgid "Send instructions to reset password" msgid "Send instructions to reset password"
msgstr "" msgstr ""
#: lib/lokal_web/live/invite_live/index.html.heex:32 #: lib/lokal_web/live/invite_live/index.html.heex:30
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Copy to clipboard" msgid "Copy to clipboard"
msgstr "" msgstr ""
@ -83,7 +83,7 @@ msgstr ""
msgid "Create Invite" msgid "Create Invite"
msgstr "" msgstr ""
#: lib/lokal_web/live/invite_live/index.html.heex:11 #: lib/lokal_web/live/invite_live/index.html.heex:12
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Invite someone new!" msgid "Invite someone new!"
msgstr "" msgstr ""

View File

@ -31,12 +31,12 @@ msgstr ""
msgid "Forgot your password?" msgid "Forgot your password?"
msgstr "" msgstr ""
#: lib/lokal_web/components/invite_card.ex:25 #: lib/lokal_web/components/invite_card.ex:33
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Invite Disabled" msgid "Invite Disabled"
msgstr "" msgstr ""
#: lib/lokal_web/components/topbar.ex:56 #: lib/lokal_web/components/topbar.ex:62
#: lib/lokal_web/live/invite_live/index.ex:41 #: lib/lokal_web/live/invite_live/index.ex:41
#: lib/lokal_web/live/invite_live/index.html.heex:3 #: lib/lokal_web/live/invite_live/index.html.heex:3
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
@ -84,11 +84,6 @@ msgstr ""
msgid "Shop from your community" msgid "Shop from your community"
msgstr "" msgstr ""
#: lib/lokal_web/components/invite_card.ex:20
#, elixir-autogen, elixir-format
msgid "Uses Left:"
msgstr ""
#: lib/lokal_web/live/home_live.html.heex:3 #: lib/lokal_web/live/home_live.html.heex:3
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Welcome to Lokal" msgid "Welcome to Lokal"
@ -99,12 +94,12 @@ msgstr ""
msgid "Home" msgid "Home"
msgstr "" msgstr ""
#: lib/lokal_web/live/invite_live/index.html.heex:89 #: lib/lokal_web/live/invite_live/index.html.heex:90
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Admins" msgid "Admins"
msgstr "" msgstr ""
#: lib/lokal_web/live/invite_live/index.html.heex:58 #: lib/lokal_web/live/invite_live/index.html.heex:59
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Disable" msgid "Disable"
msgstr "" msgstr ""
@ -114,7 +109,7 @@ msgstr ""
msgid "Edit Invite" msgid "Edit Invite"
msgstr "" msgstr ""
#: lib/lokal_web/live/invite_live/index.html.heex:62 #: lib/lokal_web/live/invite_live/index.html.heex:63
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Enable" msgid "Enable"
msgstr "" msgstr ""
@ -134,12 +129,12 @@ msgstr ""
msgid "No invites 😔" msgid "No invites 😔"
msgstr "" msgstr ""
#: lib/lokal_web/live/invite_live/index.html.heex:78 #: lib/lokal_web/live/invite_live/index.html.heex:79
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Set Unlimited" msgid "Set Unlimited"
msgstr "" msgstr ""
#: lib/lokal_web/live/invite_live/index.html.heex:118 #: lib/lokal_web/live/invite_live/index.html.heex:120
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Users" msgid "Users"
msgstr "" msgstr ""
@ -155,12 +150,39 @@ msgstr ""
msgid "English" msgid "English"
msgstr "" msgstr ""
#: lib/lokal_web/components/user_card.ex:30
#, elixir-autogen, elixir-format
msgid "User registered on"
msgstr ""
#: lib/lokal_web/templates/user_registration/new.html.heex:32 #: lib/lokal_web/templates/user_registration/new.html.heex:32
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Language" msgid "Language"
msgstr "" msgstr ""
#: lib/lokal_web/components/user_card.ex:29
#, elixir-autogen, elixir-format
msgid "Email unconfirmed"
msgstr ""
#: lib/lokal_web/components/topbar.ex:23
#: lib/lokal_web/templates/layout/root.html.heex:8
#: lib/lokal_web/templates/layout/root.html.heex:9
#, elixir-autogen, elixir-format
msgid "Lokal"
msgstr ""
#: lib/lokal_web/components/user_card.ex:34
#, elixir-autogen, elixir-format, fuzzy
msgid "User registered on%{registered_datetime}"
msgstr ""
#: lib/lokal_web/components/user_card.ex:23
#, elixir-autogen, elixir-format
msgid "User was confirmed at%{confirmed_datetime}"
msgstr ""
#: lib/lokal_web/components/invite_card.ex:23
#, elixir-autogen, elixir-format, fuzzy
msgid "Uses Left: %{uses_left}"
msgstr ""
#: lib/lokal_web/components/invite_card.ex:28
#, elixir-autogen, elixir-format, fuzzy
msgid "Uses Left: Unlimited"
msgstr ""

View File

@ -25,7 +25,7 @@ msgstr ""
msgid "Are you sure you want to delete your account?" msgid "Are you sure you want to delete your account?"
msgstr "" msgstr ""
#: lib/lokal_web/components/topbar.ex:71 #: lib/lokal_web/components/topbar.ex:78
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Are you sure you want to log out?" msgid "Are you sure you want to log out?"
msgstr "" msgstr ""
@ -70,8 +70,8 @@ msgstr ""
msgid "Your account has been deleted" msgid "Your account has been deleted"
msgstr "" msgstr ""
#: lib/lokal_web/live/invite_live/index.html.heex:101 #: lib/lokal_web/live/invite_live/index.html.heex:102
#: lib/lokal_web/live/invite_live/index.html.heex:130 #: lib/lokal_web/live/invite_live/index.html.heex:132
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Are you sure you want to delete %{email}? This action is permanent!" msgid "Are you sure you want to delete %{email}? This action is permanent!"
msgstr "" msgstr ""
@ -136,7 +136,7 @@ msgstr ""
msgid "Are you sure you want to delete the invite for %{invite_name}?" msgid "Are you sure you want to delete the invite for %{invite_name}?"
msgstr "" msgstr ""
#: lib/lokal_web/live/invite_live/index.html.heex:73 #: lib/lokal_web/live/invite_live/index.html.heex:74
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Are you sure you want to make %{invite_name} unlimited?" msgid "Are you sure you want to make %{invite_name} unlimited?"
msgstr "" msgstr ""

View File

@ -25,7 +25,7 @@ msgstr ""
msgid "Are you sure you want to delete your account?" msgid "Are you sure you want to delete your account?"
msgstr "" msgstr ""
#: lib/lokal_web/components/topbar.ex:71 #: lib/lokal_web/components/topbar.ex:78
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Are you sure you want to log out?" msgid "Are you sure you want to log out?"
msgstr "" msgstr ""
@ -70,8 +70,8 @@ msgstr ""
msgid "Your account has been deleted" msgid "Your account has been deleted"
msgstr "" msgstr ""
#: lib/lokal_web/live/invite_live/index.html.heex:101 #: lib/lokal_web/live/invite_live/index.html.heex:102
#: lib/lokal_web/live/invite_live/index.html.heex:130 #: lib/lokal_web/live/invite_live/index.html.heex:132
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Are you sure you want to delete %{email}? This action is permanent!" msgid "Are you sure you want to delete %{email}? This action is permanent!"
msgstr "" msgstr ""
@ -136,7 +136,7 @@ msgstr ""
msgid "Are you sure you want to delete the invite for %{invite_name}?" msgid "Are you sure you want to delete the invite for %{invite_name}?"
msgstr "" msgstr ""
#: lib/lokal_web/live/invite_live/index.html.heex:73 #: lib/lokal_web/live/invite_live/index.html.heex:74
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Are you sure you want to make %{invite_name} unlimited?" msgid "Are you sure you want to make %{invite_name} unlimited?"
msgstr "" msgstr ""