ee cummings this shit

This commit is contained in:
shibao 2022-11-17 22:30:01 -05:00
parent 821a8e223c
commit f1889aec07
36 changed files with 177 additions and 176 deletions

View File

@ -18,11 +18,11 @@ defmodule MemexWeb.Components.InviteCard do
<%= if @invite.disabled_at |> is_nil() do %>
<h2 class="title text-md">
<%= gettext("Uses Left:") %>
<%= @invite.uses_left || "Unlimited" %>
<%= @invite.uses_left || gettext("unlimited") %>
</h2>
<% else %>
<h2 class="title text-md">
<%= gettext("Invite Disabled") %>
<%= gettext("invite disabled") %>
</h2>
<% end %>

View File

@ -41,7 +41,7 @@ defmodule MemexWeb.Components.Topbar do
navigate={Routes.note_index_path(Endpoint, :index)}
class="text-primary-400 text-primary-400 hover:underline truncate"
>
<%= gettext("Notes") %>
<%= gettext("notes") %>
</.link>
</li>
@ -50,7 +50,7 @@ defmodule MemexWeb.Components.Topbar do
navigate={Routes.context_index_path(Endpoint, :index)}
class="text-primary-400 text-primary-400 hover:underline truncate"
>
<%= gettext("Contexts") %>
<%= gettext("contexts") %>
</.link>
</li>
@ -59,11 +59,11 @@ defmodule MemexWeb.Components.Topbar do
navigate={Routes.pipeline_index_path(Endpoint, :index)}
class="text-primary-400 text-primary-400 hover:underline truncate"
>
<%= gettext("Pipelines") %>
<%= gettext("pipelines") %>
</.link>
</li>
<li class="mx-2 my-1 border-left border border-primary-400"></li>
<li class="mx-2 my-1 border-left border border-primary-700"></li>
<%= if @current_user.role == :admin do %>
<li class="mx-2 my-1">
@ -71,7 +71,7 @@ defmodule MemexWeb.Components.Topbar do
navigate={Routes.invite_index_path(Endpoint, :index)}
class="text-primary-400 text-primary-400 hover:underline"
>
<%= gettext("Invites") %>
<%= gettext("invites") %>
</.link>
</li>
<% end %>
@ -89,7 +89,7 @@ defmodule MemexWeb.Components.Topbar do
<.link
href={Routes.user_session_path(Endpoint, :delete)}
method="delete"
data-confirm={dgettext("prompts", "Are you sure you want to log out?")}
data-confirm={dgettext("prompts", "are you sure you want to log out?")}
>
<i class="fas fa-sign-out-alt"></i>
</.link>
@ -112,7 +112,7 @@ defmodule MemexWeb.Components.Topbar do
navigate={Routes.user_registration_path(Endpoint, :new)}
class="text-primary-400 text-primary-400 hover:underline truncate"
>
<%= dgettext("actions", "Register") %>
<%= dgettext("actions", "register") %>
</.link>
</li>
<% end %>
@ -122,7 +122,7 @@ defmodule MemexWeb.Components.Topbar do
navigate={Routes.user_session_path(Endpoint, :new)}
class="text-primary-400 text-primary-400 hover:underline truncate"
>
<%= dgettext("actions", "Log in") %>
<%= dgettext("actions", "log in") %>
</.link>
</li>
<% end %>

View File

@ -20,9 +20,12 @@ defmodule MemexWeb.Components.UserCard do
<h3 class="px-4 py-2 rounded-lg title text-lg">
<p>
<%= if @user.confirmed_at |> is_nil() do %>
Email unconfirmed
<%= gettext("email unconfirmed") %>
<% else %>
User was confirmed at <%= @user.confirmed_at |> display_datetime() %>
<%= gettext(
"user was confirmed at %{relative_datetime}",
relative_datetime: @user.confirmed_at |> display_datetime()
) %>
<% end %>
</p>

View File

@ -32,7 +32,7 @@ defmodule MemexWeb.UserRegistrationController do
render(conn, "new.html",
changeset: Accounts.change_user_registration(%User{}),
invite: invite,
page_title: gettext("Register")
page_title: gettext("register")
)
end

View File

@ -5,7 +5,7 @@ defmodule MemexWeb.UserSessionController do
alias MemexWeb.UserAuth
def new(conn, _params) do
render(conn, "new.html", error_message: nil, page_title: gettext("Log in"))
render(conn, "new.html", error_message: nil, page_title: gettext("log in"))
end
def create(conn, %{"user" => user_params}) do

View File

@ -32,7 +32,7 @@ defmodule MemexWeb.ContextLive.FormComponent do
{:ok, _context} ->
{:noreply,
socket
|> put_flash(:info, "Context updated successfully")
|> put_flash(:info, "context updated successfully")
|> push_navigate(to: socket.assigns.return_to)}
{:error, %Ecto.Changeset{} = changeset} ->
@ -45,7 +45,7 @@ defmodule MemexWeb.ContextLive.FormComponent do
{:ok, _context} ->
{:noreply,
socket
|> put_flash(:info, "Context created successfully")
|> put_flash(:info, "context created successfully")
|> push_navigate(to: socket.assigns.return_to)}
{:error, %Ecto.Changeset{} = changeset} ->

View File

@ -16,19 +16,19 @@ defmodule MemexWeb.ContextLive.Index do
defp apply_action(socket, :edit, %{"id" => id}) do
socket
|> assign(:page_title, "Edit Context")
|> assign(:page_title, "edit context")
|> assign(:context, Contexts.get_context!(id))
end
defp apply_action(socket, :new, _params) do
socket
|> assign(:page_title, "New Context")
|> assign(:page_title, "new context")
|> assign(:context, %Context{})
end
defp apply_action(socket, :index, _params) do
socket
|> assign(:page_title, "Listing Contexts")
|> assign(:page_title, "listing contexts")
|> assign(:context, nil)
end

View File

@ -1,4 +1,4 @@
<h1>Listing Contexts</h1>
<h1>listing contexts</h1>
<%= if @live_action in [:new, :edit] do %>
<.modal return_to={Routes.context_index_path(@socket, :index)}>
@ -35,12 +35,12 @@
<td>
<span>
<.link navigate={Routes.context_show_path(@socket, :show, context)}>
<%= dgettext("actions", "Show") %>
<%= dgettext("actions", "show") %>
</.link>
</span>
<span>
<.link patch={Routes.context_index_path(@socket, :edit, context)}>
<%= dgettext("actions", "Edit") %>
<%= dgettext("actions", "edit") %>
</.link>
</span>
<span>
@ -48,9 +48,9 @@
href="#"
phx-click="delete"
phx-value-id={context.id}
data-confirm={dgettext("prompts", "Are you sure?")}
data-confirm={dgettext("prompts", "are you sure?")}
>
<%= dgettext("actions", "Delete") %>
<%= dgettext("actions", "delete") %>
</.link>
</span>
</td>
@ -61,6 +61,6 @@
<span>
<.link patch={Routes.context_index_path(@socket, :new)}>
<%= dgettext("actions", "New Context") %>
<%= dgettext("actions", "new context") %>
</.link>
</span>

View File

@ -16,6 +16,6 @@ defmodule MemexWeb.ContextLive.Show do
|> assign(:context, Contexts.get_context!(id))}
end
defp page_title(:show), do: "Show Context"
defp page_title(:edit), do: "Edit Context"
defp page_title(:show), do: "show context"
defp page_title(:edit), do: "edit context"
end

View File

@ -1,4 +1,4 @@
<h1>Show Context</h1>
<h1>show context</h1>
<%= if @live_action in [:edit] do %>
<.modal return_to={Routes.context_show_path(@socket, :show, @context)}>
@ -37,7 +37,7 @@
<span>
<.link patch={Routes.context_show_path(@socket, :edit, @context)} class="button">
<%= dgettext("actions", "Edit") %>
<%= dgettext("actions", "edit") %>
</.link>
</span>
|

View File

@ -9,30 +9,30 @@
<li class="flex flex-col justify-center items-center
space-y-2">
<b class="whitespace-nowrap">
<%= gettext("Notes:") %>
<%= gettext("notes:") %>
</b>
<p>
<%= gettext("Document notes about individual items or concepts") %>
<%= gettext("document notes about individual items or concepts") %>
</p>
</li>
<li class="flex flex-col justify-center items-center
space-y-2">
<b class="whitespace-nowrap">
<%= gettext("Contexts:") %>
<%= gettext("contexts:") %>
</b>
<p>
<%= gettext("Provide context around a single topic and hotlink to your notes") %>
<%= gettext("provide context around a single topic and hotlink to your notes") %>
</p>
</li>
<li class="flex flex-col justify-center items-center
space-y-2">
<b class="whitespace-nowrap">
<%= gettext("Pipelines:") %>
<%= gettext("pipelines:") %>
</b>
<p>
<%= gettext("Document your processes, attaching contexts to each step") %>
<%= gettext("document your processes, attaching contexts to each step") %>
</p>
</li>
</ul>
@ -41,36 +41,36 @@
<ul class="flex flex-col space-y-4 text-center">
<h2 class="title text-primary-400 text-lg">
<%= gettext("Features") %>
<%= gettext("features") %>
</h2>
<li class="flex flex-col justify-center items-center
space-y-2">
<b class="whitespace-nowrap">
<%= gettext("Multi-user:") %>
<%= gettext("multi-user:") %>
</b>
<p>
<%= gettext("Built with sharing and collaboration in mind") %>
<%= gettext("built with sharing and collaboration in mind") %>
</p>
</li>
<li class="flex flex-col justify-center items-center
space-y-2">
<b class="whitespace-nowrap">
<%= gettext("Privacy:") %>
<%= gettext("privacy:") %>
</b>
<p>
<%= gettext("Privacy controls on a per-note, context or pipeline basis") %>
<%= gettext("privacy controls on a per-note, context or pipeline basis") %>
</p>
</li>
<li class="flex flex-col justify-center items-center
space-y-2">
<b class="whitespace-nowrap">
<%= gettext("Convenient:") %>
<%= gettext("convenient:") %>
</b>
<p>
<%= gettext("Accessible from any internet-capable device") %>
<%= gettext("accessible from any internet-capable device") %>
</p>
</li>
</ul>
@ -79,12 +79,12 @@
<ul class="flex flex-col space-y-4 text-center">
<h2 class="title text-primary-400 text-lg">
<%= gettext("Instance Information") %>
<%= gettext("instance information") %>
</h2>
<li class="flex flex-col justify-center space-x-2">
<b>
<%= gettext("Admins:") %>
<%= gettext("admins:") %>
</b>
<p>
<%= if @admins |> Enum.empty?() do %>
@ -92,7 +92,7 @@
href={Routes.user_registration_path(MemexWeb.Endpoint, :new)}
class="hover:underline"
>
<%= dgettext("prompts", "Register to setup %{name}", name: "memex") %>
<%= dgettext("prompts", "register to setup %{name}", name: "memex") %>
</.link>
<% else %>
<div class="flex flex-wrap justify-center space-x-2">
@ -107,18 +107,18 @@
</li>
<li class="flex flex-row justify-center space-x-2">
<b>Registration:</b>
<b><%= gettext("registration:") %></b>
<p>
<%= Application.get_env(:memex, MemexWeb.Endpoint)[:registration]
|> case do
"public" -> gettext("Public Signups")
_ -> gettext("Invite Only")
"public" -> gettext("public signups")
_ -> gettext("invite only")
end %>
</p>
</li>
<li class="flex flex-row justify-center items-center space-x-2">
<b>Version:</b>
<b><%= gettext("version:") %></b>
<.link
href="https://gitea.bubbletea.dev/shibao/memex/src/branch/stable/CHANGELOG.md"
class="flex flex-row justify-center items-center space-x-2 hover:underline"
@ -135,7 +135,7 @@
<ul class="flex flex-col space-y-2 text-center justify-center">
<h2 class="title text-primary-400 text-lg">
<%= gettext("Get involved!") %>
<%= gettext("get involved!") %>
</h2>
<li class="flex flex-col justify-center space-x-2">
@ -145,7 +145,7 @@
target="_blank"
rel="noopener noreferrer"
>
<p><%= gettext("View the source code") %></p>
<p><%= gettext("view the source code") %></p>
<i class="fas fa-md fa-code"></i>
</.link>
</li>
@ -156,7 +156,7 @@
target="_blank"
rel="noopener noreferrer"
>
<p><%= gettext("Help translate") %></p>
<p><%= gettext("help translate") %></p>
<i class="fas fa-md fa-language"></i>
</.link>
</li>
@ -167,7 +167,7 @@
target="_blank"
rel="noopener noreferrer"
>
<p><%= gettext("Report bugs or request features") %></p>
<p><%= gettext("report bugs or request features") %></p>
<i class="fas fa-md fa-spider"></i>
</.link>
</li>

View File

@ -30,15 +30,15 @@ defmodule MemexWeb.InviteLive.Index do
defp apply_action(%{assigns: %{current_user: current_user}} = socket, :edit, %{"id" => id}) do
socket
|> assign(page_title: gettext("Edit Invite"), invite: Invites.get_invite!(id, current_user))
|> assign(page_title: gettext("edit invite"), invite: Invites.get_invite!(id, current_user))
end
defp apply_action(socket, :new, _params) do
socket |> assign(page_title: gettext("New Invite"), invite: %Invite{})
socket |> assign(page_title: gettext("new invite"), invite: %Invite{})
end
defp apply_action(socket, :index, _params) do
socket |> assign(page_title: gettext("Invites"), invite: nil)
socket |> assign(page_title: gettext("invites"), invite: nil)
end
@impl true

View File

@ -1,19 +1,19 @@
<div class="w-full flex flex-col space-y-8 justify-center items-center">
<h1 class="title text-2xl title-primary-500">
<%= gettext("Invites") %>
<%= gettext("invites") %>
</h1>
<%= if @invites |> Enum.empty?() do %>
<h1 class="title text-xl text-primary-400">
<%= gettext("No invites 😔") %>
<%= gettext("no invites 😔") %>
</h1>
<.link patch={Routes.invite_index_path(Endpoint, :new)} class="btn btn-primary">
<%= dgettext("actions", "Invite someone new!") %>
<%= dgettext("actions", "invite someone new!") %>
</.link>
<% else %>
<.link patch={Routes.invite_index_path(Endpoint, :new)} class="btn btn-primary">
<%= dgettext("actions", "Create Invite") %>
<%= dgettext("actions", "create invite") %>
</.link>
<% end %>
@ -45,7 +45,7 @@
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}?",
dgettext("prompts", "are you sure you want to delete the invite for %{invite_name}?",
invite_name: invite.name
)
}
@ -56,11 +56,11 @@
<%= if invite.disabled_at |> is_nil() do %>
<a href="#" class="btn btn-primary" phx-click="disable_invite" phx-value-id={invite.id}>
<%= gettext("Disable") %>
<%= gettext("disable") %>
</a>
<% else %>
<a href="#" class="btn btn-primary" phx-click="enable_invite" phx-value-id={invite.id}>
<%= gettext("Enable") %>
<%= gettext("enable") %>
</a>
<% end %>
@ -71,12 +71,12 @@
phx-click="set_unlimited"
phx-value-id={invite.id}
data-confirm={
dgettext("prompts", "Are you sure you want to make %{invite_name} unlimited?",
dgettext("prompts", "are you sure you want to make %{invite_name} unlimited?",
invite_name: invite.name
)
}
>
<%= gettext("Set Unlimited") %>
<%= gettext("set unlimited") %>
</a>
<% end %>
</.invite_card>
@ -101,7 +101,7 @@
data-confirm={
dgettext(
"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
)
}
@ -117,7 +117,7 @@
<hr class="hr" />
<h1 class="title text-2xl text-primary-400">
<%= gettext("Users") %>
<%= gettext("users") %>
</h1>
<div class="w-full flex flex-row flex-wrap justify-center items-center">
@ -131,7 +131,7 @@
data-confirm={
dgettext(
"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
)
}

View File

@ -32,7 +32,7 @@ defmodule MemexWeb.NoteLive.FormComponent do
{:ok, _note} ->
{:noreply,
socket
|> put_flash(:info, "Note updated successfully")
|> put_flash(:info, gettext("%{title} saved", title: title))
|> push_navigate(to: socket.assigns.return_to)}
{:error, %Ecto.Changeset{} = changeset} ->
@ -45,7 +45,7 @@ defmodule MemexWeb.NoteLive.FormComponent do
{:ok, _note} ->
{:noreply,
socket
|> put_flash(:info, "Note created successfully")
|> put_flash(:info, gettext("%{title} created", title: title))
|> push_navigate(to: socket.assigns.return_to)}
{:error, %Ecto.Changeset{} = changeset} ->

View File

@ -16,19 +16,19 @@ defmodule MemexWeb.NoteLive.Index do
defp apply_action(socket, :edit, %{"id" => id}) do
socket
|> assign(:page_title, "Edit Note")
|> assign(page_title: gettext("edit %{title}", title: title))
|> assign(:note, Notes.get_note!(id))
end
defp apply_action(socket, :new, _params) do
socket
|> assign(:page_title, "New Note")
|> assign(page_title: "new note")
|> assign(:note, %Note{})
end
defp apply_action(socket, :index, _params) do
socket
|> assign(:page_title, "Listing Notes")
|> assign(page_title: "notes")
|> assign(:note, nil)
end
@ -37,8 +37,7 @@ defmodule MemexWeb.NoteLive.Index do
note = Notes.get_note!(id)
{:ok, _} = Notes.delete_note(note)
{:noreply, assign(socket, :notes, list_notes())}
end
|> put_flash(:info, gettext("%{title} deleted", title: title))
defp list_notes do
Notes.list_notes()

View File

@ -16,6 +16,6 @@ defmodule MemexWeb.NoteLive.Show do
|> assign(:note, Notes.get_note!(id))}
end
defp page_title(:show), do: "Show Note"
defp page_title(:edit), do: "Edit Note"
defp page_title(:show), do: "show note"
defp page_title(:edit), do: "edit note"
end

View File

@ -32,7 +32,7 @@ defmodule MemexWeb.PipelineLive.FormComponent do
{:ok, _pipeline} ->
{:noreply,
socket
|> put_flash(:info, "Pipeline updated successfully")
|> put_flash(:info, "pipeline updated successfully")
|> push_navigate(to: socket.assigns.return_to)}
{:error, %Ecto.Changeset{} = changeset} ->
@ -45,7 +45,7 @@ defmodule MemexWeb.PipelineLive.FormComponent do
{:ok, _pipeline} ->
{:noreply,
socket
|> put_flash(:info, "Pipeline created successfully")
|> put_flash(:info, "pipeline created successfully")
|> push_navigate(to: socket.assigns.return_to)}
{:error, %Ecto.Changeset{} = changeset} ->

View File

@ -16,19 +16,19 @@ defmodule MemexWeb.PipelineLive.Index do
defp apply_action(socket, :edit, %{"id" => id}) do
socket
|> assign(:page_title, "Edit Pipeline")
|> assign(:page_title, "edit pipeline")
|> assign(:pipeline, Pipelines.get_pipeline!(id))
end
defp apply_action(socket, :new, _params) do
socket
|> assign(:page_title, "New Pipeline")
|> assign(:page_title, "new Pipeline")
|> assign(:pipeline, %Pipeline{})
end
defp apply_action(socket, :index, _params) do
socket
|> assign(:page_title, "Listing Pipelines")
|> assign(:page_title, "listing pipelines")
|> assign(:pipeline, nil)
end

View File

@ -1,4 +1,4 @@
<h1>Listing Pipelines</h1>
<h1>listing pipelines</h1>
<%= if @live_action in [:new, :edit] do %>
<.modal return_to={Routes.pipeline_index_path(@socket, :index)}>
@ -33,12 +33,12 @@
<td>
<span>
<.link navigate={Routes.pipeline_show_path(@socket, :show, pipeline)}>
<%= dgettext("actions", "Show") %>
<%= dgettext("actions", "show") %>
</.link>
</span>
<span>
<.link patch={Routes.pipeline_index_path(@socket, :edit, pipeline)}>
<%= dgettext("actions", "Edit") %>
<%= dgettext("actions", "edit") %>
</.link>
</span>
<span>
@ -46,9 +46,9 @@
href="#"
phx-click="delete"
phx-value-id={pipeline.id}
data-confirm={dgettext("prompts", "Are you sure?")}
data-confirm={dgettext("prompts", "are you sure?")}
>
<%= dgettext("actions", "Delete") %>
<%= dgettext("actions", "delete") %>
</.link>
</span>
</td>
@ -59,6 +59,6 @@
<span>
<.link patch={Routes.pipeline_index_path(@socket, :new)}>
<%= dgettext("actions", "New Pipeline") %>
<%= dgettext("actions", "new pipeline") %>
</.link>
</span>

View File

@ -16,6 +16,6 @@ defmodule MemexWeb.PipelineLive.Show do
|> assign(:pipeline, Pipelines.get_pipeline!(id))}
end
defp page_title(:show), do: "Show Pipeline"
defp page_title(:edit), do: "Edit Pipeline"
defp page_title(:show), do: "show pipeline"
defp page_title(:edit), do: "edit pipeline"
end

View File

@ -1,4 +1,4 @@
<h1>Show Pipeline</h1>
<h1>show pipeline</h1>
<%= if @live_action in [:edit] do %>
<.modal return_to={Routes.pipeline_show_path(@socket, :show, @pipeline)}>
@ -32,7 +32,7 @@
<span>
<.link patch={Routes.pipeline_show_path(@socket, :edit, @pipeline)} class="button">
<%= dgettext("actions", "Edit") %>
<%= dgettext("actions", "edit") %>
</.link>
</span>
|

View File

@ -22,11 +22,11 @@
<div class="flex flex-row justify-center items-center space-x-4">
<%= if Accounts.allow_registration?() do %>
<.link href={Routes.user_registration_path(@conn, :new)} class="btn btn-primary">
<%= dgettext("actions", "Register") %>
<%= dgettext("actions", "register") %>
</.link>
<% end %>
<.link href={Routes.user_session_path(@conn, :new)} class="btn btn-primary">
<%= dgettext("actions", "Log in") %>
<%= dgettext("actions", "log in") %>
</.link>
</div>
</div>

View File

@ -1,6 +1,6 @@
<div class="mx-auto mb-8 max-w-2xl flex flex-col justify-center items-center space-y-4">
<h1 class="title text-primary-400 text-xl">
<%= dgettext("actions", "Register") %>
<%= dgettext("actions", "register") %>
</h1>
<.form
@ -38,14 +38,14 @@
) %>
<%= error_tag(f, :locale) %>
<%= submit(dgettext("actions", "Register"), class: "mx-auto btn btn-primary col-span-3") %>
<%= submit(dgettext("actions", "register"), class: "mx-auto btn btn-primary col-span-3") %>
</.form>
<hr class="hr" />
<div class="flex flex-row justify-center items-center space-x-4">
<.link href={Routes.user_session_path(@conn, :new)} class="btn btn-primary">
<%= dgettext("actions", "Log in") %>
<%= dgettext("actions", "log in") %>
</.link>
<.link href={Routes.user_reset_password_path(@conn, :new)} class="btn btn-primary">
<%= dgettext("actions", "Forgot your password?") %>

View File

@ -17,7 +17,7 @@
</div>
<% end %>
<%= label(f, :password, "New password", class: "title text-lg text-primary-400") %>
<%= label(f, :password, "new password", class: "title text-lg text-primary-400") %>
<%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
<%= error_tag(f, :password, "col-span-3") %>
@ -40,11 +40,11 @@
<div class="flex flex-row justify-center items-center space-x-4">
<%= if Accounts.allow_registration?() do %>
<.link href={Routes.user_registration_path(@conn, :new)} class="btn btn-primary">
<%= dgettext("actions", "Register") %>
<%= dgettext("actions", "register") %>
</.link>
<% end %>
<.link href={Routes.user_session_path(@conn, :new)} class="btn btn-primary">
<%= dgettext("actions", "Log in") %>
<%= dgettext("actions", "log in") %>
</.link>
</div>
</div>

View File

@ -22,11 +22,11 @@
<div class="flex flex-row justify-center items-center space-x-4">
<%= if Accounts.allow_registration?() do %>
<.link href={Routes.user_registration_path(@conn, :new)} class="btn btn-primary">
<%= dgettext("actions", "Register") %>
<%= dgettext("actions", "register") %>
</.link>
<% end %>
<.link href={Routes.user_session_path(@conn, :new)} class="btn btn-primary">
<%= dgettext("actions", "Log in") %>
<%= dgettext("actions", "log in") %>
</.link>
</div>
</div>

View File

@ -1,6 +1,6 @@
<div class="mx-auto mb-8 max-w-2xl flex flex-col justify-center items-center space-y-4">
<h1 class="title text-primary-400 text-xl">
<%= dgettext("actions", "Log in") %>
<%= dgettext("actions", "log in") %>
</h1>
<.form
@ -29,7 +29,7 @@
) %>
<%= checkbox(f, :remember_me, class: "checkbox col-span-2") %>
<%= submit(dgettext("actions", "Log in"), class: "mx-auto btn btn-primary col-span-3") %>
<%= submit(dgettext("actions", "log in"), class: "mx-auto btn btn-primary col-span-3") %>
</.form>
<hr class="hr" />
@ -37,7 +37,7 @@
<div class="flex flex-row justify-center items-center space-x-4">
<%= if Accounts.allow_registration?() do %>
<.link href={Routes.user_registration_path(@conn, :new)} class="btn btn-primary">
<%= dgettext("actions", "Register") %>
<%= dgettext("actions", "register") %>
</.link>
<% end %>
<.link href={Routes.user_reset_password_path(@conn, :new)} class="btn btn-primary">

View File

@ -1,6 +1,6 @@
<div class="mx-auto mb-8 max-w-2xl flex flex-col justify-center items-center text-center space-y-4">
<h1 class="pb-4 title text-primary-400 text-xl">
<%= gettext("Settings") %>
<%= gettext("settings") %>
</h1>
<hr class="hr" />
@ -12,24 +12,24 @@
class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
>
<h3 class="title text-primary-400 text-lg col-span-3">
<%= dgettext("actions", "Change email") %>
<%= dgettext("actions", "change email") %>
</h3>
<%= if @email_changeset.action && not @email_changeset.valid? do %>
<div class="alert alert-danger col-span-3">
<p>
<%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
<%= dgettext("errors", "oops, something went wrong! Please check the errors below") %>
</p>
</div>
<% end %>
<%= hidden_input(f, :action, name: "action", value: "update_email") %>
<%= label(f, :email, class: "title text-lg text-primary-400") %>
<%= label(f, :email, gettext("email"), class: "title text-lg text-primary-400") %>
<%= email_input(f, :email, required: true, class: "mx-2 my-1 input input-primary col-span-2") %>
<%= error_tag(f, :email, "col-span-3") %>
<%= label(f, :current_password, gettext("Current password"),
<%= label(f, :current_password, gettext("current password"),
for: "current_password_for_email",
class: "mx-2 my-1 title text-lg text-primary-400"
) %>
@ -41,7 +41,7 @@
) %>
<%= error_tag(f, :current_password, "col-span-3") %>
<%= submit(dgettext("actions", "Change email"),
<%= submit(dgettext("actions", "change email"),
class: "mx-auto btn btn-primary col-span-3"
) %>
</.form>
@ -55,7 +55,7 @@
class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
>
<h3 class="title text-primary-400 text-lg col-span-3">
<%= dgettext("actions", "Change password") %>
<%= dgettext("actions", "change password") %>
</h3>
<%= if @password_changeset.action && not @password_changeset.valid? do %>
@ -68,14 +68,14 @@
<%= hidden_input(f, :action, name: "action", value: "update_password") %>
<%= label(f, :password, gettext("New password"), class: "title text-lg text-primary-400") %>
<%= label(f, :password, gettext("new password"), class: "title text-lg text-primary-400") %>
<%= password_input(f, :password,
required: true,
class: "mx-2 my-1 input input-primary col-span-2"
) %>
<%= error_tag(f, :password, "col-span-3") %>
<%= label(f, :password_confirmation, gettext("Confirm new password"),
<%= label(f, :password_confirmation, gettext("confirm new password"),
class: "title text-lg text-primary-400"
) %>
<%= password_input(f, :password_confirmation,
@ -84,7 +84,7 @@
) %>
<%= error_tag(f, :password_confirmation, "col-span-3") %>
<%= label(f, :current_password, gettext("Current password"),
<%= label(f, :current_password, gettext("current password"),
for: "current_password_for_password",
class: "title text-lg text-primary-400"
) %>
@ -96,7 +96,7 @@
) %>
<%= error_tag(f, :current_password, "col-span-3") %>
<%= submit(dgettext("actions", "Change password"),
<%= submit(dgettext("actions", "change password"),
class: "mx-auto btn btn-primary col-span-3"
) %>
</.form>
@ -110,27 +110,27 @@
class="flex flex-col space-y-4 justify-center items-center"
>
<h3 class="title text-primary-400 text-lg">
<%= dgettext("actions", "Change Language") %>
<%= dgettext("actions", "change language") %>
</h3>
<%= if @locale_changeset.action && not @locale_changeset.valid? do %>
<div class="alert alert-danger">
<p>
<%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
<%= dgettext("errors", "oops, something went wrong! Please check the errors below") %>
</p>
</div>
<% end %>
<%= hidden_input(f, :action, name: "action", value: "update_locale") %>
<%= select(f, :locale, [{gettext("English"), "en_US"}, {"Spanish", "es"}],
<%= select(f, :locale, [{gettext("english"), "en_US"}, {"spanish", "es"}],
class: "mx-2 my-1 min-w-md input input-primary"
) %>
<%= error_tag(f, :locale) %>
<%= submit(dgettext("actions", "Change language"),
<%= submit(dgettext("actions", "change language"),
class: "whitespace-nowrap mx-auto btn btn-primary",
data: [qa: dgettext("prompts", "Are you sure you want to change your language?")]
data: [qa: dgettext("prompts", "are you sure you want to change your language?")]
) %>
</.form>
@ -140,8 +140,8 @@
href={Routes.user_settings_path(@conn, :delete, @current_user)}
method={:delete}
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") %>
<%= dgettext("actions", "delete user") %>
</.link>
</div>

View File

@ -9,6 +9,6 @@ defmodule MemexWeb.HomeControllerTest do
test "GET /", %{conn: conn} do
conn = get(conn, "/")
assert html_response(conn, 200) =~ "Welcome to Memex"
assert html_response(conn, 200) =~ "memex"
end
end

View File

@ -12,8 +12,8 @@ defmodule MemexWeb.UserRegistrationControllerTest do
test "renders registration page", %{conn: conn} do
conn = get(conn, Routes.user_registration_path(conn, :new))
response = html_response(conn, 200)
assert response =~ dgettext("actions", "Register")
assert response =~ dgettext("actions", "Log in")
assert response =~ dgettext("actions", "register")
assert response =~ dgettext("actions", "log in")
end
test "redirects if already logged in", %{conn: conn} do
@ -46,7 +46,7 @@ defmodule MemexWeb.UserRegistrationControllerTest do
})
response = html_response(conn, 200)
assert response =~ gettext("Register")
assert response =~ gettext("register")
assert response =~ "must have the @ sign and no spaces"
assert response =~ "should be at least 12 character"
end

View File

@ -16,7 +16,7 @@ defmodule MemexWeb.UserSessionControllerTest do
test "renders log in page", %{conn: conn} do
conn = get(conn, Routes.user_session_path(conn, :new))
response = html_response(conn, 200)
assert response =~ dgettext("actions", "Log in")
assert response =~ dgettext("actions", "log in")
end
test "redirects if already logged in", %{conn: conn, current_user: current_user} do
@ -39,7 +39,7 @@ defmodule MemexWeb.UserSessionControllerTest do
conn = get(conn, "/")
response = html_response(conn, 200)
assert response =~ current_user.email
assert response =~ dgettext("prompts", "Are you sure you want to log out?")
assert response =~ dgettext("prompts", "are you sure you want to log out?")
end
test "logs the user in with remember me", %{conn: conn, current_user: current_user} do
@ -78,7 +78,7 @@ defmodule MemexWeb.UserSessionControllerTest do
})
response = html_response(conn, 200)
assert response =~ dgettext("actions", "Log in")
assert response =~ dgettext("actions", "log in")
assert response =~ dgettext("errors", "Invalid email or password")
end
end

View File

@ -59,7 +59,7 @@ defmodule MemexWeb.UserSettingsControllerTest do
})
response = html_response(old_password_conn, 200)
assert response =~ gettext("Settings")
assert response =~ gettext("settings")
assert response =~ dgettext("errors", "should be at least 12 character(s)")
assert response =~ dgettext("errors", "does not match password")
assert response =~ dgettext("errors", "is not valid")
@ -98,7 +98,7 @@ defmodule MemexWeb.UserSettingsControllerTest do
})
response = html_response(conn, 200)
assert response =~ gettext("Settings")
assert response =~ gettext("settings")
assert response =~ dgettext("errors", "must have the @ sign and no spaces")
assert response =~ dgettext("errors", "is not valid")
end

View File

@ -24,15 +24,15 @@ defmodule MemexWeb.ContextLiveTest do
test "lists all contexts", %{conn: conn, context: context} do
{:ok, _index_live, html} = live(conn, Routes.context_index_path(conn, :index))
assert html =~ "Listing Contexts"
assert html =~ "listing contexts"
assert html =~ context.content
end
test "saves new context", %{conn: conn} do
{:ok, index_live, _html} = live(conn, Routes.context_index_path(conn, :index))
assert index_live |> element("a", "New Context") |> render_click() =~
"New Context"
assert index_live |> element("a", "new context") |> render_click() =~
"new context"
assert_patch(index_live, Routes.context_index_path(conn, :new))
@ -46,15 +46,15 @@ defmodule MemexWeb.ContextLiveTest do
|> render_submit()
|> follow_redirect(conn, Routes.context_index_path(conn, :index))
assert html =~ "Context created successfully"
assert html =~ "context created successfully"
assert html =~ "some content"
end
test "updates context in listing", %{conn: conn, context: context} do
{:ok, index_live, _html} = live(conn, Routes.context_index_path(conn, :index))
assert index_live |> element("#context-#{context.id} a", "Edit") |> render_click() =~
"Edit Context"
assert index_live |> element("#context-#{context.id} a", "edit") |> render_click() =~
"edit context"
assert_patch(index_live, Routes.context_index_path(conn, :edit, context))
@ -68,33 +68,33 @@ defmodule MemexWeb.ContextLiveTest do
|> render_submit()
|> follow_redirect(conn, Routes.context_index_path(conn, :index))
assert html =~ "Context updated successfully"
assert html =~ "context updated successfully"
assert html =~ "some updated content"
end
test "deletes context in listing", %{conn: conn, context: context} do
{:ok, index_live, _html} = live(conn, Routes.context_index_path(conn, :index))
assert index_live |> element("#context-#{context.id} a", "Delete") |> render_click()
assert index_live |> element("#context-#{context.id} a", "delete") |> render_click()
refute has_element?(index_live, "#context-#{context.id}")
end
end
describe "Show" do
describe "show" do
setup [:create_context]
test "displays context", %{conn: conn, context: context} do
{:ok, _show_live, html} = live(conn, Routes.context_show_path(conn, :show, context))
assert html =~ "Show Context"
assert html =~ "show context"
assert html =~ context.content
end
test "updates context within modal", %{conn: conn, context: context} do
{:ok, show_live, _html} = live(conn, Routes.context_show_path(conn, :show, context))
assert show_live |> element("a", "Edit") |> render_click() =~
"Edit Context"
assert show_live |> element("a", "edit") |> render_click() =~
"edit context"
assert_patch(show_live, Routes.context_show_path(conn, :edit, context))
@ -108,7 +108,7 @@ defmodule MemexWeb.ContextLiveTest do
|> render_submit()
|> follow_redirect(conn, Routes.context_show_path(conn, :show, context))
assert html =~ "Context updated successfully"
assert html =~ "context updated successfully"
assert html =~ "some updated content"
end
end

View File

@ -24,15 +24,15 @@ defmodule MemexWeb.InviteLiveTest do
test "lists all invites", %{conn: conn, invite: invite} do
{:ok, _index_live, html} = live(conn, Routes.invite_index_path(conn, :index))
assert html =~ gettext("Invites")
assert html =~ gettext("invites")
assert html =~ invite.name
end
test "saves new invite", %{conn: conn} do
{:ok, index_live, _html} = live(conn, Routes.invite_index_path(conn, :index))
assert index_live |> element("a", dgettext("actions", "Create Invite")) |> render_click() =~
gettext("New Invite")
assert index_live |> element("a", dgettext("actions", "create invite")) |> render_click() =~
gettext("new invite")
assert_patch(index_live, Routes.invite_index_path(conn, :new))
@ -56,7 +56,7 @@ defmodule MemexWeb.InviteLiveTest do
{:ok, index_live, _html} = live(conn, Routes.invite_index_path(conn, :index))
assert index_live |> element("[data-qa=\"edit-#{invite.id}\"]") |> render_click() =~
gettext("Edit Invite")
gettext("edit invite")
assert_patch(index_live, Routes.invite_index_path(conn, :edit, invite))

View File

@ -24,15 +24,15 @@ defmodule MemexWeb.NoteLiveTest do
test "lists all notes", %{conn: conn, note: note} do
{:ok, _index_live, html} = live(conn, Routes.note_index_path(conn, :index))
assert html =~ "Listing Notes"
assert html =~ "notes"
assert html =~ note.content
end
test "saves new note", %{conn: conn} do
{:ok, index_live, _html} = live(conn, Routes.note_index_path(conn, :index))
assert index_live |> element("a", "New Note") |> render_click() =~
"New Note"
assert index_live |> element("a", "new note") |> render_click() =~
"new note"
assert_patch(index_live, Routes.note_index_path(conn, :new))
@ -46,7 +46,7 @@ defmodule MemexWeb.NoteLiveTest do
|> render_submit()
|> follow_redirect(conn, Routes.note_index_path(conn, :index))
assert html =~ "Note created successfully"
assert html =~ "#{@create_attrs |> Map.get("title")} created"
assert html =~ "some content"
end
@ -54,7 +54,7 @@ defmodule MemexWeb.NoteLiveTest do
{:ok, index_live, _html} = live(conn, Routes.note_index_path(conn, :index))
assert index_live |> element("#note-#{note.id} a", "Edit") |> render_click() =~
"Edit Note"
"edit"
assert_patch(index_live, Routes.note_index_path(conn, :edit, note))
@ -68,7 +68,7 @@ defmodule MemexWeb.NoteLiveTest do
|> render_submit()
|> follow_redirect(conn, Routes.note_index_path(conn, :index))
assert html =~ "Note updated successfully"
assert html =~ "#{@update_attrs |> Map.get("title")} saved"
assert html =~ "some updated content"
end
@ -80,21 +80,20 @@ defmodule MemexWeb.NoteLiveTest do
end
end
describe "Show" do
setup [:create_note]
describe "show" do
setup [:register_and_log_in_user, :create_note]
test "displays note", %{conn: conn, note: note} do
{:ok, _show_live, html} = live(conn, Routes.note_show_path(conn, :show, note))
assert html =~ "Show Note"
assert html =~ "show note"
assert html =~ note.content
end
test "updates note within modal", %{conn: conn, note: note} do
{:ok, show_live, _html} = live(conn, Routes.note_show_path(conn, :show, note))
assert show_live |> element("a", "Edit") |> render_click() =~
"Edit Note"
assert show_live |> element("a", "edit") |> render_click() =~ "edit"
assert_patch(show_live, Routes.note_show_path(conn, :edit, note))
@ -108,7 +107,7 @@ defmodule MemexWeb.NoteLiveTest do
|> render_submit()
|> follow_redirect(conn, Routes.note_show_path(conn, :show, note))
assert html =~ "Note updated successfully"
assert html =~ "#{@update_attrs |> Map.get("title")} saved"
assert html =~ "some updated content"
end
end

View File

@ -5,7 +5,7 @@ defmodule MemexWeb.HomeLiveTest do
test "disconnected and connected render", %{conn: conn} do
{:ok, page_live, disconnected_html} = live(conn, "/")
assert disconnected_html =~ "Welcome to Memex"
assert render(page_live) =~ "Welcome to Memex"
assert disconnected_html =~ "memex"
assert render(page_live) =~ "memex"
end
end

View File

@ -23,15 +23,15 @@ defmodule MemexWeb.PipelineLiveTest do
test "lists all pipelines", %{conn: conn, pipeline: pipeline} do
{:ok, _index_live, html} = live(conn, Routes.pipeline_index_path(conn, :index))
assert html =~ "Listing Pipelines"
assert html =~ "listing pipelines"
assert html =~ pipeline.description
end
test "saves new pipeline", %{conn: conn} do
{:ok, index_live, _html} = live(conn, Routes.pipeline_index_path(conn, :index))
assert index_live |> element("a", "New Pipeline") |> render_click() =~
"New Pipeline"
assert index_live |> element("a", "new pipeline") |> render_click() =~
"new pipeline"
assert_patch(index_live, Routes.pipeline_index_path(conn, :new))
@ -45,15 +45,15 @@ defmodule MemexWeb.PipelineLiveTest do
|> render_submit()
|> follow_redirect(conn, Routes.pipeline_index_path(conn, :index))
assert html =~ "Pipeline created successfully"
assert html =~ "pipeline created successfully"
assert html =~ "some description"
end
test "updates pipeline in listing", %{conn: conn, pipeline: pipeline} do
{:ok, index_live, _html} = live(conn, Routes.pipeline_index_path(conn, :index))
assert index_live |> element("#pipeline-#{pipeline.id} a", "Edit") |> render_click() =~
"Edit Pipeline"
assert index_live |> element("#pipeline-#{pipeline.id} a", "edit") |> render_click() =~
"edit pipeline"
assert_patch(index_live, Routes.pipeline_index_path(conn, :edit, pipeline))
@ -67,33 +67,33 @@ defmodule MemexWeb.PipelineLiveTest do
|> render_submit()
|> follow_redirect(conn, Routes.pipeline_index_path(conn, :index))
assert html =~ "Pipeline updated successfully"
assert html =~ "pipeline updated successfully"
assert html =~ "some updated description"
end
test "deletes pipeline in listing", %{conn: conn, pipeline: pipeline} do
{:ok, index_live, _html} = live(conn, Routes.pipeline_index_path(conn, :index))
assert index_live |> element("#pipeline-#{pipeline.id} a", "Delete") |> render_click()
assert index_live |> element("#pipeline-#{pipeline.id} a", "delete") |> render_click()
refute has_element?(index_live, "#pipeline-#{pipeline.id}")
end
end
describe "Show" do
describe "show" do
setup [:create_pipeline]
test "displays pipeline", %{conn: conn, pipeline: pipeline} do
{:ok, _show_live, html} = live(conn, Routes.pipeline_show_path(conn, :show, pipeline))
assert html =~ "Show Pipeline"
assert html =~ "show pipeline"
assert html =~ pipeline.description
end
test "updates pipeline within modal", %{conn: conn, pipeline: pipeline} do
{:ok, show_live, _html} = live(conn, Routes.pipeline_show_path(conn, :show, pipeline))
assert show_live |> element("a", "Edit") |> render_click() =~
"Edit Pipeline"
assert show_live |> element("a", "edit") |> render_click() =~
"edit pipeline"
assert_patch(show_live, Routes.pipeline_show_path(conn, :edit, pipeline))
@ -107,7 +107,7 @@ defmodule MemexWeb.PipelineLiveTest do
|> render_submit()
|> follow_redirect(conn, Routes.pipeline_show_path(conn, :show, pipeline))
assert html =~ "Pipeline updated successfully"
assert html =~ "pipeline updated successfully"
assert html =~ "some updated description"
end
end