ee cummings this shit
This commit is contained in:
parent
821a8e223c
commit
f1889aec07
@ -18,11 +18,11 @@ defmodule MemexWeb.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:") %>
|
<%= gettext("Uses Left:") %>
|
||||||
<%= @invite.uses_left || "Unlimited" %>
|
<%= @invite.uses_left || gettext("unlimited") %>
|
||||||
</h2>
|
</h2>
|
||||||
<% else %>
|
<% else %>
|
||||||
<h2 class="title text-md">
|
<h2 class="title text-md">
|
||||||
<%= gettext("Invite Disabled") %>
|
<%= gettext("invite disabled") %>
|
||||||
</h2>
|
</h2>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ defmodule MemexWeb.Components.Topbar do
|
|||||||
navigate={Routes.note_index_path(Endpoint, :index)}
|
navigate={Routes.note_index_path(Endpoint, :index)}
|
||||||
class="text-primary-400 text-primary-400 hover:underline truncate"
|
class="text-primary-400 text-primary-400 hover:underline truncate"
|
||||||
>
|
>
|
||||||
<%= gettext("Notes") %>
|
<%= gettext("notes") %>
|
||||||
</.link>
|
</.link>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ defmodule MemexWeb.Components.Topbar do
|
|||||||
navigate={Routes.context_index_path(Endpoint, :index)}
|
navigate={Routes.context_index_path(Endpoint, :index)}
|
||||||
class="text-primary-400 text-primary-400 hover:underline truncate"
|
class="text-primary-400 text-primary-400 hover:underline truncate"
|
||||||
>
|
>
|
||||||
<%= gettext("Contexts") %>
|
<%= gettext("contexts") %>
|
||||||
</.link>
|
</.link>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@ -59,11 +59,11 @@ defmodule MemexWeb.Components.Topbar do
|
|||||||
navigate={Routes.pipeline_index_path(Endpoint, :index)}
|
navigate={Routes.pipeline_index_path(Endpoint, :index)}
|
||||||
class="text-primary-400 text-primary-400 hover:underline truncate"
|
class="text-primary-400 text-primary-400 hover:underline truncate"
|
||||||
>
|
>
|
||||||
<%= gettext("Pipelines") %>
|
<%= gettext("pipelines") %>
|
||||||
</.link>
|
</.link>
|
||||||
</li>
|
</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 %>
|
<%= if @current_user.role == :admin do %>
|
||||||
<li class="mx-2 my-1">
|
<li class="mx-2 my-1">
|
||||||
@ -71,7 +71,7 @@ defmodule MemexWeb.Components.Topbar do
|
|||||||
navigate={Routes.invite_index_path(Endpoint, :index)}
|
navigate={Routes.invite_index_path(Endpoint, :index)}
|
||||||
class="text-primary-400 text-primary-400 hover:underline"
|
class="text-primary-400 text-primary-400 hover:underline"
|
||||||
>
|
>
|
||||||
<%= gettext("Invites") %>
|
<%= gettext("invites") %>
|
||||||
</.link>
|
</.link>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
@ -89,7 +89,7 @@ defmodule MemexWeb.Components.Topbar do
|
|||||||
<.link
|
<.link
|
||||||
href={Routes.user_session_path(Endpoint, :delete)}
|
href={Routes.user_session_path(Endpoint, :delete)}
|
||||||
method="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>
|
<i class="fas fa-sign-out-alt"></i>
|
||||||
</.link>
|
</.link>
|
||||||
@ -112,7 +112,7 @@ defmodule MemexWeb.Components.Topbar do
|
|||||||
navigate={Routes.user_registration_path(Endpoint, :new)}
|
navigate={Routes.user_registration_path(Endpoint, :new)}
|
||||||
class="text-primary-400 text-primary-400 hover:underline truncate"
|
class="text-primary-400 text-primary-400 hover:underline truncate"
|
||||||
>
|
>
|
||||||
<%= dgettext("actions", "Register") %>
|
<%= dgettext("actions", "register") %>
|
||||||
</.link>
|
</.link>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
@ -122,7 +122,7 @@ defmodule MemexWeb.Components.Topbar do
|
|||||||
navigate={Routes.user_session_path(Endpoint, :new)}
|
navigate={Routes.user_session_path(Endpoint, :new)}
|
||||||
class="text-primary-400 text-primary-400 hover:underline truncate"
|
class="text-primary-400 text-primary-400 hover:underline truncate"
|
||||||
>
|
>
|
||||||
<%= dgettext("actions", "Log in") %>
|
<%= dgettext("actions", "log in") %>
|
||||||
</.link>
|
</.link>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -20,9 +20,12 @@ defmodule MemexWeb.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 |> is_nil() do %>
|
||||||
Email unconfirmed
|
<%= gettext("email unconfirmed") %>
|
||||||
<% else %>
|
<% 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 %>
|
<% end %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ defmodule MemexWeb.UserRegistrationController do
|
|||||||
render(conn, "new.html",
|
render(conn, "new.html",
|
||||||
changeset: Accounts.change_user_registration(%User{}),
|
changeset: Accounts.change_user_registration(%User{}),
|
||||||
invite: invite,
|
invite: invite,
|
||||||
page_title: gettext("Register")
|
page_title: gettext("register")
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ defmodule MemexWeb.UserSessionController do
|
|||||||
alias MemexWeb.UserAuth
|
alias MemexWeb.UserAuth
|
||||||
|
|
||||||
def new(conn, _params) do
|
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
|
end
|
||||||
|
|
||||||
def create(conn, %{"user" => user_params}) do
|
def create(conn, %{"user" => user_params}) do
|
||||||
|
@ -32,7 +32,7 @@ defmodule MemexWeb.ContextLive.FormComponent do
|
|||||||
{:ok, _context} ->
|
{:ok, _context} ->
|
||||||
{:noreply,
|
{:noreply,
|
||||||
socket
|
socket
|
||||||
|> put_flash(:info, "Context updated successfully")
|
|> put_flash(:info, "context updated successfully")
|
||||||
|> push_navigate(to: socket.assigns.return_to)}
|
|> push_navigate(to: socket.assigns.return_to)}
|
||||||
|
|
||||||
{:error, %Ecto.Changeset{} = changeset} ->
|
{:error, %Ecto.Changeset{} = changeset} ->
|
||||||
@ -45,7 +45,7 @@ defmodule MemexWeb.ContextLive.FormComponent do
|
|||||||
{:ok, _context} ->
|
{:ok, _context} ->
|
||||||
{:noreply,
|
{:noreply,
|
||||||
socket
|
socket
|
||||||
|> put_flash(:info, "Context created successfully")
|
|> put_flash(:info, "context created successfully")
|
||||||
|> push_navigate(to: socket.assigns.return_to)}
|
|> push_navigate(to: socket.assigns.return_to)}
|
||||||
|
|
||||||
{:error, %Ecto.Changeset{} = changeset} ->
|
{:error, %Ecto.Changeset{} = changeset} ->
|
||||||
|
@ -16,19 +16,19 @@ defmodule MemexWeb.ContextLive.Index do
|
|||||||
|
|
||||||
defp apply_action(socket, :edit, %{"id" => id}) do
|
defp apply_action(socket, :edit, %{"id" => id}) do
|
||||||
socket
|
socket
|
||||||
|> assign(:page_title, "Edit Context")
|
|> assign(:page_title, "edit context")
|
||||||
|> assign(:context, Contexts.get_context!(id))
|
|> assign(:context, Contexts.get_context!(id))
|
||||||
end
|
end
|
||||||
|
|
||||||
defp apply_action(socket, :new, _params) do
|
defp apply_action(socket, :new, _params) do
|
||||||
socket
|
socket
|
||||||
|> assign(:page_title, "New Context")
|
|> assign(:page_title, "new context")
|
||||||
|> assign(:context, %Context{})
|
|> assign(:context, %Context{})
|
||||||
end
|
end
|
||||||
|
|
||||||
defp apply_action(socket, :index, _params) do
|
defp apply_action(socket, :index, _params) do
|
||||||
socket
|
socket
|
||||||
|> assign(:page_title, "Listing Contexts")
|
|> assign(:page_title, "listing contexts")
|
||||||
|> assign(:context, nil)
|
|> assign(:context, nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<h1>Listing Contexts</h1>
|
<h1>listing contexts</h1>
|
||||||
|
|
||||||
<%= if @live_action in [:new, :edit] do %>
|
<%= if @live_action in [:new, :edit] do %>
|
||||||
<.modal return_to={Routes.context_index_path(@socket, :index)}>
|
<.modal return_to={Routes.context_index_path(@socket, :index)}>
|
||||||
@ -35,12 +35,12 @@
|
|||||||
<td>
|
<td>
|
||||||
<span>
|
<span>
|
||||||
<.link navigate={Routes.context_show_path(@socket, :show, context)}>
|
<.link navigate={Routes.context_show_path(@socket, :show, context)}>
|
||||||
<%= dgettext("actions", "Show") %>
|
<%= dgettext("actions", "show") %>
|
||||||
</.link>
|
</.link>
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
<.link patch={Routes.context_index_path(@socket, :edit, context)}>
|
<.link patch={Routes.context_index_path(@socket, :edit, context)}>
|
||||||
<%= dgettext("actions", "Edit") %>
|
<%= dgettext("actions", "edit") %>
|
||||||
</.link>
|
</.link>
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
@ -48,9 +48,9 @@
|
|||||||
href="#"
|
href="#"
|
||||||
phx-click="delete"
|
phx-click="delete"
|
||||||
phx-value-id={context.id}
|
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>
|
</.link>
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
@ -61,6 +61,6 @@
|
|||||||
|
|
||||||
<span>
|
<span>
|
||||||
<.link patch={Routes.context_index_path(@socket, :new)}>
|
<.link patch={Routes.context_index_path(@socket, :new)}>
|
||||||
<%= dgettext("actions", "New Context") %>
|
<%= dgettext("actions", "new context") %>
|
||||||
</.link>
|
</.link>
|
||||||
</span>
|
</span>
|
||||||
|
@ -16,6 +16,6 @@ defmodule MemexWeb.ContextLive.Show do
|
|||||||
|> assign(:context, Contexts.get_context!(id))}
|
|> assign(:context, Contexts.get_context!(id))}
|
||||||
end
|
end
|
||||||
|
|
||||||
defp page_title(:show), do: "Show Context"
|
defp page_title(:show), do: "show context"
|
||||||
defp page_title(:edit), do: "Edit Context"
|
defp page_title(:edit), do: "edit context"
|
||||||
end
|
end
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<h1>Show Context</h1>
|
<h1>show context</h1>
|
||||||
|
|
||||||
<%= if @live_action in [:edit] do %>
|
<%= if @live_action in [:edit] do %>
|
||||||
<.modal return_to={Routes.context_show_path(@socket, :show, @context)}>
|
<.modal return_to={Routes.context_show_path(@socket, :show, @context)}>
|
||||||
@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
<span>
|
<span>
|
||||||
<.link patch={Routes.context_show_path(@socket, :edit, @context)} class="button">
|
<.link patch={Routes.context_show_path(@socket, :edit, @context)} class="button">
|
||||||
<%= dgettext("actions", "Edit") %>
|
<%= dgettext("actions", "edit") %>
|
||||||
</.link>
|
</.link>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
|
||||||
|
@ -9,30 +9,30 @@
|
|||||||
<li class="flex flex-col justify-center items-center
|
<li class="flex flex-col justify-center items-center
|
||||||
space-y-2">
|
space-y-2">
|
||||||
<b class="whitespace-nowrap">
|
<b class="whitespace-nowrap">
|
||||||
<%= gettext("Notes:") %>
|
<%= gettext("notes:") %>
|
||||||
</b>
|
</b>
|
||||||
<p>
|
<p>
|
||||||
<%= gettext("Document notes about individual items or concepts") %>
|
<%= gettext("document notes about individual items or concepts") %>
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="flex flex-col justify-center items-center
|
<li class="flex flex-col justify-center items-center
|
||||||
space-y-2">
|
space-y-2">
|
||||||
<b class="whitespace-nowrap">
|
<b class="whitespace-nowrap">
|
||||||
<%= gettext("Contexts:") %>
|
<%= gettext("contexts:") %>
|
||||||
</b>
|
</b>
|
||||||
<p>
|
<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>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="flex flex-col justify-center items-center
|
<li class="flex flex-col justify-center items-center
|
||||||
space-y-2">
|
space-y-2">
|
||||||
<b class="whitespace-nowrap">
|
<b class="whitespace-nowrap">
|
||||||
<%= gettext("Pipelines:") %>
|
<%= gettext("pipelines:") %>
|
||||||
</b>
|
</b>
|
||||||
<p>
|
<p>
|
||||||
<%= gettext("Document your processes, attaching contexts to each step") %>
|
<%= gettext("document your processes, attaching contexts to each step") %>
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -41,36 +41,36 @@
|
|||||||
|
|
||||||
<ul class="flex flex-col space-y-4 text-center">
|
<ul class="flex flex-col space-y-4 text-center">
|
||||||
<h2 class="title text-primary-400 text-lg">
|
<h2 class="title text-primary-400 text-lg">
|
||||||
<%= gettext("Features") %>
|
<%= gettext("features") %>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<li class="flex flex-col justify-center items-center
|
<li class="flex flex-col justify-center items-center
|
||||||
space-y-2">
|
space-y-2">
|
||||||
<b class="whitespace-nowrap">
|
<b class="whitespace-nowrap">
|
||||||
<%= gettext("Multi-user:") %>
|
<%= gettext("multi-user:") %>
|
||||||
</b>
|
</b>
|
||||||
<p>
|
<p>
|
||||||
<%= gettext("Built with sharing and collaboration in mind") %>
|
<%= gettext("built with sharing and collaboration in mind") %>
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="flex flex-col justify-center items-center
|
<li class="flex flex-col justify-center items-center
|
||||||
space-y-2">
|
space-y-2">
|
||||||
<b class="whitespace-nowrap">
|
<b class="whitespace-nowrap">
|
||||||
<%= gettext("Privacy:") %>
|
<%= gettext("privacy:") %>
|
||||||
</b>
|
</b>
|
||||||
<p>
|
<p>
|
||||||
<%= gettext("Privacy controls on a per-note, context or pipeline basis") %>
|
<%= gettext("privacy controls on a per-note, context or pipeline basis") %>
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="flex flex-col justify-center items-center
|
<li class="flex flex-col justify-center items-center
|
||||||
space-y-2">
|
space-y-2">
|
||||||
<b class="whitespace-nowrap">
|
<b class="whitespace-nowrap">
|
||||||
<%= gettext("Convenient:") %>
|
<%= gettext("convenient:") %>
|
||||||
</b>
|
</b>
|
||||||
<p>
|
<p>
|
||||||
<%= gettext("Accessible from any internet-capable device") %>
|
<%= gettext("accessible from any internet-capable device") %>
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -79,12 +79,12 @@
|
|||||||
|
|
||||||
<ul class="flex flex-col space-y-4 text-center">
|
<ul class="flex flex-col space-y-4 text-center">
|
||||||
<h2 class="title text-primary-400 text-lg">
|
<h2 class="title text-primary-400 text-lg">
|
||||||
<%= gettext("Instance Information") %>
|
<%= gettext("instance information") %>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<li class="flex flex-col justify-center space-x-2">
|
<li class="flex flex-col justify-center space-x-2">
|
||||||
<b>
|
<b>
|
||||||
<%= gettext("Admins:") %>
|
<%= gettext("admins:") %>
|
||||||
</b>
|
</b>
|
||||||
<p>
|
<p>
|
||||||
<%= if @admins |> Enum.empty?() do %>
|
<%= if @admins |> Enum.empty?() do %>
|
||||||
@ -92,7 +92,7 @@
|
|||||||
href={Routes.user_registration_path(MemexWeb.Endpoint, :new)}
|
href={Routes.user_registration_path(MemexWeb.Endpoint, :new)}
|
||||||
class="hover:underline"
|
class="hover:underline"
|
||||||
>
|
>
|
||||||
<%= dgettext("prompts", "Register to setup %{name}", name: "memex") %>
|
<%= dgettext("prompts", "register to setup %{name}", name: "memex") %>
|
||||||
</.link>
|
</.link>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="flex flex-wrap justify-center space-x-2">
|
<div class="flex flex-wrap justify-center space-x-2">
|
||||||
@ -107,18 +107,18 @@
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="flex flex-row justify-center space-x-2">
|
<li class="flex flex-row justify-center space-x-2">
|
||||||
<b>Registration:</b>
|
<b><%= gettext("registration:") %></b>
|
||||||
<p>
|
<p>
|
||||||
<%= Application.get_env(:memex, MemexWeb.Endpoint)[:registration]
|
<%= Application.get_env(:memex, MemexWeb.Endpoint)[:registration]
|
||||||
|> case do
|
|> case do
|
||||||
"public" -> gettext("Public Signups")
|
"public" -> gettext("public signups")
|
||||||
_ -> gettext("Invite Only")
|
_ -> gettext("invite only")
|
||||||
end %>
|
end %>
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="flex flex-row justify-center items-center space-x-2">
|
<li class="flex flex-row justify-center items-center space-x-2">
|
||||||
<b>Version:</b>
|
<b><%= gettext("version:") %></b>
|
||||||
<.link
|
<.link
|
||||||
href="https://gitea.bubbletea.dev/shibao/memex/src/branch/stable/CHANGELOG.md"
|
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"
|
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">
|
<ul class="flex flex-col space-y-2 text-center justify-center">
|
||||||
<h2 class="title text-primary-400 text-lg">
|
<h2 class="title text-primary-400 text-lg">
|
||||||
<%= gettext("Get involved!") %>
|
<%= gettext("get involved!") %>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<li class="flex flex-col justify-center space-x-2">
|
<li class="flex flex-col justify-center space-x-2">
|
||||||
@ -145,7 +145,7 @@
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
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>
|
<i class="fas fa-md fa-code"></i>
|
||||||
</.link>
|
</.link>
|
||||||
</li>
|
</li>
|
||||||
@ -156,7 +156,7 @@
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
>
|
>
|
||||||
<p><%= gettext("Help translate") %></p>
|
<p><%= gettext("help translate") %></p>
|
||||||
<i class="fas fa-md fa-language"></i>
|
<i class="fas fa-md fa-language"></i>
|
||||||
</.link>
|
</.link>
|
||||||
</li>
|
</li>
|
||||||
@ -167,7 +167,7 @@
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
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>
|
<i class="fas fa-md fa-spider"></i>
|
||||||
</.link>
|
</.link>
|
||||||
</li>
|
</li>
|
||||||
|
@ -30,15 +30,15 @@ defmodule MemexWeb.InviteLive.Index do
|
|||||||
|
|
||||||
defp apply_action(%{assigns: %{current_user: current_user}} = socket, :edit, %{"id" => id}) do
|
defp apply_action(%{assigns: %{current_user: current_user}} = socket, :edit, %{"id" => id}) do
|
||||||
socket
|
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
|
end
|
||||||
|
|
||||||
defp apply_action(socket, :new, _params) do
|
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
|
end
|
||||||
|
|
||||||
defp apply_action(socket, :index, _params) do
|
defp apply_action(socket, :index, _params) do
|
||||||
socket |> assign(page_title: gettext("Invites"), invite: nil)
|
socket |> assign(page_title: gettext("invites"), invite: nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
<div class="w-full flex flex-col space-y-8 justify-center items-center">
|
<div class="w-full flex flex-col space-y-8 justify-center items-center">
|
||||||
<h1 class="title text-2xl title-primary-500">
|
<h1 class="title text-2xl title-primary-500">
|
||||||
<%= gettext("Invites") %>
|
<%= gettext("invites") %>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<%= if @invites |> Enum.empty?() do %>
|
<%= if @invites |> Enum.empty?() do %>
|
||||||
<h1 class="title text-xl text-primary-400">
|
<h1 class="title text-xl text-primary-400">
|
||||||
<%= gettext("No invites 😔") %>
|
<%= gettext("no invites 😔") %>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<.link patch={Routes.invite_index_path(Endpoint, :new)} class="btn btn-primary">
|
<.link patch={Routes.invite_index_path(Endpoint, :new)} class="btn btn-primary">
|
||||||
<%= dgettext("actions", "Invite someone new!") %>
|
<%= dgettext("actions", "invite someone new!") %>
|
||||||
</.link>
|
</.link>
|
||||||
<% else %>
|
<% else %>
|
||||||
<.link patch={Routes.invite_index_path(Endpoint, :new)} class="btn btn-primary">
|
<.link patch={Routes.invite_index_path(Endpoint, :new)} class="btn btn-primary">
|
||||||
<%= dgettext("actions", "Create Invite") %>
|
<%= dgettext("actions", "create invite") %>
|
||||||
</.link>
|
</.link>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
@ -45,7 +45,7 @@
|
|||||||
phx-click="delete_invite"
|
phx-click="delete_invite"
|
||||||
phx-value-id={invite.id}
|
phx-value-id={invite.id}
|
||||||
data-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
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -56,11 +56,11 @@
|
|||||||
|
|
||||||
<%= 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}>
|
||||||
<%= gettext("Disable") %>
|
<%= gettext("disable") %>
|
||||||
</a>
|
</a>
|
||||||
<% else %>
|
<% else %>
|
||||||
<a href="#" class="btn btn-primary" phx-click="enable_invite" phx-value-id={invite.id}>
|
<a href="#" class="btn btn-primary" phx-click="enable_invite" phx-value-id={invite.id}>
|
||||||
<%= gettext("Enable") %>
|
<%= gettext("enable") %>
|
||||||
</a>
|
</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
@ -71,12 +71,12 @@
|
|||||||
phx-click="set_unlimited"
|
phx-click="set_unlimited"
|
||||||
phx-value-id={invite.id}
|
phx-value-id={invite.id}
|
||||||
data-confirm={
|
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
|
invite_name: invite.name
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<%= gettext("Set Unlimited") %>
|
<%= gettext("set unlimited") %>
|
||||||
</a>
|
</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
</.invite_card>
|
</.invite_card>
|
||||||
@ -101,7 +101,7 @@
|
|||||||
data-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
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -117,7 +117,7 @@
|
|||||||
<hr class="hr" />
|
<hr class="hr" />
|
||||||
|
|
||||||
<h1 class="title text-2xl text-primary-400">
|
<h1 class="title text-2xl text-primary-400">
|
||||||
<%= gettext("Users") %>
|
<%= gettext("users") %>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<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">
|
||||||
@ -131,7 +131,7 @@
|
|||||||
data-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
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ defmodule MemexWeb.NoteLive.FormComponent do
|
|||||||
{:ok, _note} ->
|
{:ok, _note} ->
|
||||||
{:noreply,
|
{:noreply,
|
||||||
socket
|
socket
|
||||||
|> put_flash(:info, "Note updated successfully")
|
|> put_flash(:info, gettext("%{title} saved", title: title))
|
||||||
|> push_navigate(to: socket.assigns.return_to)}
|
|> push_navigate(to: socket.assigns.return_to)}
|
||||||
|
|
||||||
{:error, %Ecto.Changeset{} = changeset} ->
|
{:error, %Ecto.Changeset{} = changeset} ->
|
||||||
@ -45,7 +45,7 @@ defmodule MemexWeb.NoteLive.FormComponent do
|
|||||||
{:ok, _note} ->
|
{:ok, _note} ->
|
||||||
{:noreply,
|
{:noreply,
|
||||||
socket
|
socket
|
||||||
|> put_flash(:info, "Note created successfully")
|
|> put_flash(:info, gettext("%{title} created", title: title))
|
||||||
|> push_navigate(to: socket.assigns.return_to)}
|
|> push_navigate(to: socket.assigns.return_to)}
|
||||||
|
|
||||||
{:error, %Ecto.Changeset{} = changeset} ->
|
{:error, %Ecto.Changeset{} = changeset} ->
|
||||||
|
@ -16,19 +16,19 @@ defmodule MemexWeb.NoteLive.Index do
|
|||||||
|
|
||||||
defp apply_action(socket, :edit, %{"id" => id}) do
|
defp apply_action(socket, :edit, %{"id" => id}) do
|
||||||
socket
|
socket
|
||||||
|> assign(:page_title, "Edit Note")
|
|> assign(page_title: gettext("edit %{title}", title: title))
|
||||||
|> assign(:note, Notes.get_note!(id))
|
|> assign(:note, Notes.get_note!(id))
|
||||||
end
|
end
|
||||||
|
|
||||||
defp apply_action(socket, :new, _params) do
|
defp apply_action(socket, :new, _params) do
|
||||||
socket
|
socket
|
||||||
|> assign(:page_title, "New Note")
|
|> assign(page_title: "new note")
|
||||||
|> assign(:note, %Note{})
|
|> assign(:note, %Note{})
|
||||||
end
|
end
|
||||||
|
|
||||||
defp apply_action(socket, :index, _params) do
|
defp apply_action(socket, :index, _params) do
|
||||||
socket
|
socket
|
||||||
|> assign(:page_title, "Listing Notes")
|
|> assign(page_title: "notes")
|
||||||
|> assign(:note, nil)
|
|> assign(:note, nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -37,8 +37,7 @@ defmodule MemexWeb.NoteLive.Index do
|
|||||||
note = Notes.get_note!(id)
|
note = Notes.get_note!(id)
|
||||||
{:ok, _} = Notes.delete_note(note)
|
{:ok, _} = Notes.delete_note(note)
|
||||||
|
|
||||||
{:noreply, assign(socket, :notes, list_notes())}
|
|> put_flash(:info, gettext("%{title} deleted", title: title))
|
||||||
end
|
|
||||||
|
|
||||||
defp list_notes do
|
defp list_notes do
|
||||||
Notes.list_notes()
|
Notes.list_notes()
|
||||||
|
@ -16,6 +16,6 @@ defmodule MemexWeb.NoteLive.Show do
|
|||||||
|> assign(:note, Notes.get_note!(id))}
|
|> assign(:note, Notes.get_note!(id))}
|
||||||
end
|
end
|
||||||
|
|
||||||
defp page_title(:show), do: "Show Note"
|
defp page_title(:show), do: "show note"
|
||||||
defp page_title(:edit), do: "Edit Note"
|
defp page_title(:edit), do: "edit note"
|
||||||
end
|
end
|
||||||
|
@ -32,7 +32,7 @@ defmodule MemexWeb.PipelineLive.FormComponent do
|
|||||||
{:ok, _pipeline} ->
|
{:ok, _pipeline} ->
|
||||||
{:noreply,
|
{:noreply,
|
||||||
socket
|
socket
|
||||||
|> put_flash(:info, "Pipeline updated successfully")
|
|> put_flash(:info, "pipeline updated successfully")
|
||||||
|> push_navigate(to: socket.assigns.return_to)}
|
|> push_navigate(to: socket.assigns.return_to)}
|
||||||
|
|
||||||
{:error, %Ecto.Changeset{} = changeset} ->
|
{:error, %Ecto.Changeset{} = changeset} ->
|
||||||
@ -45,7 +45,7 @@ defmodule MemexWeb.PipelineLive.FormComponent do
|
|||||||
{:ok, _pipeline} ->
|
{:ok, _pipeline} ->
|
||||||
{:noreply,
|
{:noreply,
|
||||||
socket
|
socket
|
||||||
|> put_flash(:info, "Pipeline created successfully")
|
|> put_flash(:info, "pipeline created successfully")
|
||||||
|> push_navigate(to: socket.assigns.return_to)}
|
|> push_navigate(to: socket.assigns.return_to)}
|
||||||
|
|
||||||
{:error, %Ecto.Changeset{} = changeset} ->
|
{:error, %Ecto.Changeset{} = changeset} ->
|
||||||
|
@ -16,19 +16,19 @@ defmodule MemexWeb.PipelineLive.Index do
|
|||||||
|
|
||||||
defp apply_action(socket, :edit, %{"id" => id}) do
|
defp apply_action(socket, :edit, %{"id" => id}) do
|
||||||
socket
|
socket
|
||||||
|> assign(:page_title, "Edit Pipeline")
|
|> assign(:page_title, "edit pipeline")
|
||||||
|> assign(:pipeline, Pipelines.get_pipeline!(id))
|
|> assign(:pipeline, Pipelines.get_pipeline!(id))
|
||||||
end
|
end
|
||||||
|
|
||||||
defp apply_action(socket, :new, _params) do
|
defp apply_action(socket, :new, _params) do
|
||||||
socket
|
socket
|
||||||
|> assign(:page_title, "New Pipeline")
|
|> assign(:page_title, "new Pipeline")
|
||||||
|> assign(:pipeline, %Pipeline{})
|
|> assign(:pipeline, %Pipeline{})
|
||||||
end
|
end
|
||||||
|
|
||||||
defp apply_action(socket, :index, _params) do
|
defp apply_action(socket, :index, _params) do
|
||||||
socket
|
socket
|
||||||
|> assign(:page_title, "Listing Pipelines")
|
|> assign(:page_title, "listing pipelines")
|
||||||
|> assign(:pipeline, nil)
|
|> assign(:pipeline, nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<h1>Listing Pipelines</h1>
|
<h1>listing pipelines</h1>
|
||||||
|
|
||||||
<%= if @live_action in [:new, :edit] do %>
|
<%= if @live_action in [:new, :edit] do %>
|
||||||
<.modal return_to={Routes.pipeline_index_path(@socket, :index)}>
|
<.modal return_to={Routes.pipeline_index_path(@socket, :index)}>
|
||||||
@ -33,12 +33,12 @@
|
|||||||
<td>
|
<td>
|
||||||
<span>
|
<span>
|
||||||
<.link navigate={Routes.pipeline_show_path(@socket, :show, pipeline)}>
|
<.link navigate={Routes.pipeline_show_path(@socket, :show, pipeline)}>
|
||||||
<%= dgettext("actions", "Show") %>
|
<%= dgettext("actions", "show") %>
|
||||||
</.link>
|
</.link>
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
<.link patch={Routes.pipeline_index_path(@socket, :edit, pipeline)}>
|
<.link patch={Routes.pipeline_index_path(@socket, :edit, pipeline)}>
|
||||||
<%= dgettext("actions", "Edit") %>
|
<%= dgettext("actions", "edit") %>
|
||||||
</.link>
|
</.link>
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
@ -46,9 +46,9 @@
|
|||||||
href="#"
|
href="#"
|
||||||
phx-click="delete"
|
phx-click="delete"
|
||||||
phx-value-id={pipeline.id}
|
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>
|
</.link>
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
@ -59,6 +59,6 @@
|
|||||||
|
|
||||||
<span>
|
<span>
|
||||||
<.link patch={Routes.pipeline_index_path(@socket, :new)}>
|
<.link patch={Routes.pipeline_index_path(@socket, :new)}>
|
||||||
<%= dgettext("actions", "New Pipeline") %>
|
<%= dgettext("actions", "new pipeline") %>
|
||||||
</.link>
|
</.link>
|
||||||
</span>
|
</span>
|
||||||
|
@ -16,6 +16,6 @@ defmodule MemexWeb.PipelineLive.Show do
|
|||||||
|> assign(:pipeline, Pipelines.get_pipeline!(id))}
|
|> assign(:pipeline, Pipelines.get_pipeline!(id))}
|
||||||
end
|
end
|
||||||
|
|
||||||
defp page_title(:show), do: "Show Pipeline"
|
defp page_title(:show), do: "show pipeline"
|
||||||
defp page_title(:edit), do: "Edit Pipeline"
|
defp page_title(:edit), do: "edit pipeline"
|
||||||
end
|
end
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<h1>Show Pipeline</h1>
|
<h1>show pipeline</h1>
|
||||||
|
|
||||||
<%= if @live_action in [:edit] do %>
|
<%= if @live_action in [:edit] do %>
|
||||||
<.modal return_to={Routes.pipeline_show_path(@socket, :show, @pipeline)}>
|
<.modal return_to={Routes.pipeline_show_path(@socket, :show, @pipeline)}>
|
||||||
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
<span>
|
<span>
|
||||||
<.link patch={Routes.pipeline_show_path(@socket, :edit, @pipeline)} class="button">
|
<.link patch={Routes.pipeline_show_path(@socket, :edit, @pipeline)} class="button">
|
||||||
<%= dgettext("actions", "Edit") %>
|
<%= dgettext("actions", "edit") %>
|
||||||
</.link>
|
</.link>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
|
||||||
|
@ -22,11 +22,11 @@
|
|||||||
<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 href={Routes.user_registration_path(@conn, :new)} class="btn btn-primary">
|
<.link href={Routes.user_registration_path(@conn, :new)} class="btn btn-primary">
|
||||||
<%= dgettext("actions", "Register") %>
|
<%= dgettext("actions", "register") %>
|
||||||
</.link>
|
</.link>
|
||||||
<% end %>
|
<% end %>
|
||||||
<.link href={Routes.user_session_path(@conn, :new)} class="btn btn-primary">
|
<.link href={Routes.user_session_path(@conn, :new)} class="btn btn-primary">
|
||||||
<%= dgettext("actions", "Log in") %>
|
<%= dgettext("actions", "log in") %>
|
||||||
</.link>
|
</.link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<div class="mx-auto mb-8 max-w-2xl flex flex-col justify-center items-center space-y-4">
|
<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">
|
<h1 class="title text-primary-400 text-xl">
|
||||||
<%= dgettext("actions", "Register") %>
|
<%= dgettext("actions", "register") %>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<.form
|
<.form
|
||||||
@ -38,14 +38,14 @@
|
|||||||
) %>
|
) %>
|
||||||
<%= error_tag(f, :locale) %>
|
<%= 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>
|
</.form>
|
||||||
|
|
||||||
<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 href={Routes.user_session_path(@conn, :new)} class="btn btn-primary">
|
<.link href={Routes.user_session_path(@conn, :new)} class="btn btn-primary">
|
||||||
<%= dgettext("actions", "Log in") %>
|
<%= dgettext("actions", "log in") %>
|
||||||
</.link>
|
</.link>
|
||||||
<.link href={Routes.user_reset_password_path(@conn, :new)} class="btn btn-primary">
|
<.link href={Routes.user_reset_password_path(@conn, :new)} class="btn btn-primary">
|
||||||
<%= dgettext("actions", "Forgot your password?") %>
|
<%= dgettext("actions", "Forgot your password?") %>
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% 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") %>
|
<%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
|
||||||
<%= error_tag(f, :password, "col-span-3") %>
|
<%= error_tag(f, :password, "col-span-3") %>
|
||||||
|
|
||||||
@ -40,11 +40,11 @@
|
|||||||
<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 href={Routes.user_registration_path(@conn, :new)} class="btn btn-primary">
|
<.link href={Routes.user_registration_path(@conn, :new)} class="btn btn-primary">
|
||||||
<%= dgettext("actions", "Register") %>
|
<%= dgettext("actions", "register") %>
|
||||||
</.link>
|
</.link>
|
||||||
<% end %>
|
<% end %>
|
||||||
<.link href={Routes.user_session_path(@conn, :new)} class="btn btn-primary">
|
<.link href={Routes.user_session_path(@conn, :new)} class="btn btn-primary">
|
||||||
<%= dgettext("actions", "Log in") %>
|
<%= dgettext("actions", "log in") %>
|
||||||
</.link>
|
</.link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -22,11 +22,11 @@
|
|||||||
<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 href={Routes.user_registration_path(@conn, :new)} class="btn btn-primary">
|
<.link href={Routes.user_registration_path(@conn, :new)} class="btn btn-primary">
|
||||||
<%= dgettext("actions", "Register") %>
|
<%= dgettext("actions", "register") %>
|
||||||
</.link>
|
</.link>
|
||||||
<% end %>
|
<% end %>
|
||||||
<.link href={Routes.user_session_path(@conn, :new)} class="btn btn-primary">
|
<.link href={Routes.user_session_path(@conn, :new)} class="btn btn-primary">
|
||||||
<%= dgettext("actions", "Log in") %>
|
<%= dgettext("actions", "log in") %>
|
||||||
</.link>
|
</.link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<div class="mx-auto mb-8 max-w-2xl flex flex-col justify-center items-center space-y-4">
|
<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">
|
<h1 class="title text-primary-400 text-xl">
|
||||||
<%= dgettext("actions", "Log in") %>
|
<%= dgettext("actions", "log in") %>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<.form
|
<.form
|
||||||
@ -29,7 +29,7 @@
|
|||||||
) %>
|
) %>
|
||||||
<%= checkbox(f, :remember_me, class: "checkbox col-span-2") %>
|
<%= 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>
|
</.form>
|
||||||
|
|
||||||
<hr class="hr" />
|
<hr class="hr" />
|
||||||
@ -37,7 +37,7 @@
|
|||||||
<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 href={Routes.user_registration_path(@conn, :new)} class="btn btn-primary">
|
<.link href={Routes.user_registration_path(@conn, :new)} class="btn btn-primary">
|
||||||
<%= dgettext("actions", "Register") %>
|
<%= dgettext("actions", "register") %>
|
||||||
</.link>
|
</.link>
|
||||||
<% end %>
|
<% end %>
|
||||||
<.link href={Routes.user_reset_password_path(@conn, :new)} class="btn btn-primary">
|
<.link href={Routes.user_reset_password_path(@conn, :new)} class="btn btn-primary">
|
||||||
|
@ -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">
|
<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">
|
<h1 class="pb-4 title text-primary-400 text-xl">
|
||||||
<%= gettext("Settings") %>
|
<%= gettext("settings") %>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<hr class="hr" />
|
<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"
|
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">
|
<h3 class="title text-primary-400 text-lg col-span-3">
|
||||||
<%= dgettext("actions", "Change email") %>
|
<%= dgettext("actions", "change email") %>
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<%= if @email_changeset.action && not @email_changeset.valid? do %>
|
<%= if @email_changeset.action && not @email_changeset.valid? do %>
|
||||||
<div class="alert alert-danger col-span-3">
|
<div class="alert alert-danger col-span-3">
|
||||||
<p>
|
<p>
|
||||||
<%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
|
<%= dgettext("errors", "oops, something went wrong! Please check the errors below") %>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= hidden_input(f, :action, name: "action", value: "update_email") %>
|
<%= 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") %>
|
<%= email_input(f, :email, required: true, class: "mx-2 my-1 input input-primary col-span-2") %>
|
||||||
<%= error_tag(f, :email, "col-span-3") %>
|
<%= 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",
|
for: "current_password_for_email",
|
||||||
class: "mx-2 my-1 title text-lg text-primary-400"
|
class: "mx-2 my-1 title text-lg text-primary-400"
|
||||||
) %>
|
) %>
|
||||||
@ -41,7 +41,7 @@
|
|||||||
) %>
|
) %>
|
||||||
<%= error_tag(f, :current_password, "col-span-3") %>
|
<%= 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"
|
class: "mx-auto btn btn-primary col-span-3"
|
||||||
) %>
|
) %>
|
||||||
</.form>
|
</.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"
|
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">
|
<h3 class="title text-primary-400 text-lg col-span-3">
|
||||||
<%= dgettext("actions", "Change password") %>
|
<%= dgettext("actions", "change password") %>
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<%= if @password_changeset.action && not @password_changeset.valid? do %>
|
<%= if @password_changeset.action && not @password_changeset.valid? do %>
|
||||||
@ -68,14 +68,14 @@
|
|||||||
|
|
||||||
<%= hidden_input(f, :action, name: "action", value: "update_password") %>
|
<%= 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,
|
<%= password_input(f, :password,
|
||||||
required: true,
|
required: true,
|
||||||
class: "mx-2 my-1 input input-primary col-span-2"
|
class: "mx-2 my-1 input input-primary col-span-2"
|
||||||
) %>
|
) %>
|
||||||
<%= error_tag(f, :password, "col-span-3") %>
|
<%= 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"
|
class: "title text-lg text-primary-400"
|
||||||
) %>
|
) %>
|
||||||
<%= password_input(f, :password_confirmation,
|
<%= password_input(f, :password_confirmation,
|
||||||
@ -84,7 +84,7 @@
|
|||||||
) %>
|
) %>
|
||||||
<%= error_tag(f, :password_confirmation, "col-span-3") %>
|
<%= 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",
|
for: "current_password_for_password",
|
||||||
class: "title text-lg text-primary-400"
|
class: "title text-lg text-primary-400"
|
||||||
) %>
|
) %>
|
||||||
@ -96,7 +96,7 @@
|
|||||||
) %>
|
) %>
|
||||||
<%= error_tag(f, :current_password, "col-span-3") %>
|
<%= 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"
|
class: "mx-auto btn btn-primary col-span-3"
|
||||||
) %>
|
) %>
|
||||||
</.form>
|
</.form>
|
||||||
@ -110,27 +110,27 @@
|
|||||||
class="flex flex-col space-y-4 justify-center items-center"
|
class="flex flex-col space-y-4 justify-center items-center"
|
||||||
>
|
>
|
||||||
<h3 class="title text-primary-400 text-lg">
|
<h3 class="title text-primary-400 text-lg">
|
||||||
<%= dgettext("actions", "Change Language") %>
|
<%= dgettext("actions", "change language") %>
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<%= if @locale_changeset.action && not @locale_changeset.valid? do %>
|
<%= if @locale_changeset.action && not @locale_changeset.valid? do %>
|
||||||
<div class="alert alert-danger">
|
<div class="alert alert-danger">
|
||||||
<p>
|
<p>
|
||||||
<%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
|
<%= dgettext("errors", "oops, something went wrong! Please check the errors below") %>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= hidden_input(f, :action, name: "action", value: "update_locale") %>
|
<%= 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"
|
class: "mx-2 my-1 min-w-md input input-primary"
|
||||||
) %>
|
) %>
|
||||||
<%= error_tag(f, :locale) %>
|
<%= error_tag(f, :locale) %>
|
||||||
|
|
||||||
<%= submit(dgettext("actions", "Change language"),
|
<%= submit(dgettext("actions", "change language"),
|
||||||
class: "whitespace-nowrap mx-auto btn btn-primary",
|
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>
|
</.form>
|
||||||
|
|
||||||
@ -140,8 +140,8 @@
|
|||||||
href={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") %>
|
<%= dgettext("actions", "delete user") %>
|
||||||
</.link>
|
</.link>
|
||||||
</div>
|
</div>
|
||||||
|
@ -9,6 +9,6 @@ defmodule MemexWeb.HomeControllerTest do
|
|||||||
|
|
||||||
test "GET /", %{conn: conn} do
|
test "GET /", %{conn: conn} do
|
||||||
conn = get(conn, "/")
|
conn = get(conn, "/")
|
||||||
assert html_response(conn, 200) =~ "Welcome to Memex"
|
assert html_response(conn, 200) =~ "memex"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -12,8 +12,8 @@ defmodule MemexWeb.UserRegistrationControllerTest do
|
|||||||
test "renders registration page", %{conn: conn} do
|
test "renders registration page", %{conn: conn} do
|
||||||
conn = get(conn, Routes.user_registration_path(conn, :new))
|
conn = get(conn, Routes.user_registration_path(conn, :new))
|
||||||
response = html_response(conn, 200)
|
response = html_response(conn, 200)
|
||||||
assert response =~ dgettext("actions", "Register")
|
assert response =~ dgettext("actions", "register")
|
||||||
assert response =~ dgettext("actions", "Log in")
|
assert response =~ dgettext("actions", "log in")
|
||||||
end
|
end
|
||||||
|
|
||||||
test "redirects if already logged in", %{conn: conn} do
|
test "redirects if already logged in", %{conn: conn} do
|
||||||
@ -46,7 +46,7 @@ defmodule MemexWeb.UserRegistrationControllerTest do
|
|||||||
})
|
})
|
||||||
|
|
||||||
response = html_response(conn, 200)
|
response = html_response(conn, 200)
|
||||||
assert response =~ gettext("Register")
|
assert response =~ gettext("register")
|
||||||
assert response =~ "must have the @ sign and no spaces"
|
assert response =~ "must have the @ sign and no spaces"
|
||||||
assert response =~ "should be at least 12 character"
|
assert response =~ "should be at least 12 character"
|
||||||
end
|
end
|
||||||
|
@ -16,7 +16,7 @@ defmodule MemexWeb.UserSessionControllerTest do
|
|||||||
test "renders log in page", %{conn: conn} do
|
test "renders log in page", %{conn: conn} do
|
||||||
conn = get(conn, Routes.user_session_path(conn, :new))
|
conn = get(conn, Routes.user_session_path(conn, :new))
|
||||||
response = html_response(conn, 200)
|
response = html_response(conn, 200)
|
||||||
assert response =~ dgettext("actions", "Log in")
|
assert response =~ dgettext("actions", "log in")
|
||||||
end
|
end
|
||||||
|
|
||||||
test "redirects if already logged in", %{conn: conn, current_user: current_user} do
|
test "redirects if already logged in", %{conn: conn, current_user: current_user} do
|
||||||
@ -39,7 +39,7 @@ defmodule MemexWeb.UserSessionControllerTest do
|
|||||||
conn = get(conn, "/")
|
conn = get(conn, "/")
|
||||||
response = html_response(conn, 200)
|
response = html_response(conn, 200)
|
||||||
assert response =~ current_user.email
|
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
|
end
|
||||||
|
|
||||||
test "logs the user in with remember me", %{conn: conn, current_user: current_user} do
|
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)
|
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")
|
assert response =~ dgettext("errors", "Invalid email or password")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -59,7 +59,7 @@ defmodule MemexWeb.UserSettingsControllerTest do
|
|||||||
})
|
})
|
||||||
|
|
||||||
response = html_response(old_password_conn, 200)
|
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", "should be at least 12 character(s)")
|
||||||
assert response =~ dgettext("errors", "does not match password")
|
assert response =~ dgettext("errors", "does not match password")
|
||||||
assert response =~ dgettext("errors", "is not valid")
|
assert response =~ dgettext("errors", "is not valid")
|
||||||
@ -98,7 +98,7 @@ defmodule MemexWeb.UserSettingsControllerTest do
|
|||||||
})
|
})
|
||||||
|
|
||||||
response = html_response(conn, 200)
|
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", "must have the @ sign and no spaces")
|
||||||
assert response =~ dgettext("errors", "is not valid")
|
assert response =~ dgettext("errors", "is not valid")
|
||||||
end
|
end
|
||||||
|
@ -24,15 +24,15 @@ defmodule MemexWeb.ContextLiveTest do
|
|||||||
test "lists all contexts", %{conn: conn, context: context} do
|
test "lists all contexts", %{conn: conn, context: context} do
|
||||||
{:ok, _index_live, html} = live(conn, Routes.context_index_path(conn, :index))
|
{:ok, _index_live, html} = live(conn, Routes.context_index_path(conn, :index))
|
||||||
|
|
||||||
assert html =~ "Listing Contexts"
|
assert html =~ "listing contexts"
|
||||||
assert html =~ context.content
|
assert html =~ context.content
|
||||||
end
|
end
|
||||||
|
|
||||||
test "saves new context", %{conn: conn} do
|
test "saves new context", %{conn: conn} do
|
||||||
{:ok, index_live, _html} = live(conn, Routes.context_index_path(conn, :index))
|
{:ok, index_live, _html} = live(conn, Routes.context_index_path(conn, :index))
|
||||||
|
|
||||||
assert index_live |> element("a", "New Context") |> render_click() =~
|
assert index_live |> element("a", "new context") |> render_click() =~
|
||||||
"New Context"
|
"new context"
|
||||||
|
|
||||||
assert_patch(index_live, Routes.context_index_path(conn, :new))
|
assert_patch(index_live, Routes.context_index_path(conn, :new))
|
||||||
|
|
||||||
@ -46,15 +46,15 @@ defmodule MemexWeb.ContextLiveTest do
|
|||||||
|> render_submit()
|
|> render_submit()
|
||||||
|> follow_redirect(conn, Routes.context_index_path(conn, :index))
|
|> follow_redirect(conn, Routes.context_index_path(conn, :index))
|
||||||
|
|
||||||
assert html =~ "Context created successfully"
|
assert html =~ "context created successfully"
|
||||||
assert html =~ "some content"
|
assert html =~ "some content"
|
||||||
end
|
end
|
||||||
|
|
||||||
test "updates context in listing", %{conn: conn, context: context} do
|
test "updates context in listing", %{conn: conn, context: context} do
|
||||||
{:ok, index_live, _html} = live(conn, Routes.context_index_path(conn, :index))
|
{:ok, index_live, _html} = live(conn, Routes.context_index_path(conn, :index))
|
||||||
|
|
||||||
assert index_live |> element("#context-#{context.id} a", "Edit") |> render_click() =~
|
assert index_live |> element("#context-#{context.id} a", "edit") |> render_click() =~
|
||||||
"Edit Context"
|
"edit context"
|
||||||
|
|
||||||
assert_patch(index_live, Routes.context_index_path(conn, :edit, context))
|
assert_patch(index_live, Routes.context_index_path(conn, :edit, context))
|
||||||
|
|
||||||
@ -68,33 +68,33 @@ defmodule MemexWeb.ContextLiveTest do
|
|||||||
|> render_submit()
|
|> render_submit()
|
||||||
|> follow_redirect(conn, Routes.context_index_path(conn, :index))
|
|> follow_redirect(conn, Routes.context_index_path(conn, :index))
|
||||||
|
|
||||||
assert html =~ "Context updated successfully"
|
assert html =~ "context updated successfully"
|
||||||
assert html =~ "some updated content"
|
assert html =~ "some updated content"
|
||||||
end
|
end
|
||||||
|
|
||||||
test "deletes context in listing", %{conn: conn, context: context} do
|
test "deletes context in listing", %{conn: conn, context: context} do
|
||||||
{:ok, index_live, _html} = live(conn, Routes.context_index_path(conn, :index))
|
{: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}")
|
refute has_element?(index_live, "#context-#{context.id}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "Show" do
|
describe "show" do
|
||||||
setup [:create_context]
|
setup [:create_context]
|
||||||
|
|
||||||
test "displays context", %{conn: conn, context: context} do
|
test "displays context", %{conn: conn, context: context} do
|
||||||
{:ok, _show_live, html} = live(conn, Routes.context_show_path(conn, :show, context))
|
{: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
|
assert html =~ context.content
|
||||||
end
|
end
|
||||||
|
|
||||||
test "updates context within modal", %{conn: conn, context: context} do
|
test "updates context within modal", %{conn: conn, context: context} do
|
||||||
{:ok, show_live, _html} = live(conn, Routes.context_show_path(conn, :show, context))
|
{:ok, show_live, _html} = live(conn, Routes.context_show_path(conn, :show, context))
|
||||||
|
|
||||||
assert show_live |> element("a", "Edit") |> render_click() =~
|
assert show_live |> element("a", "edit") |> render_click() =~
|
||||||
"Edit Context"
|
"edit context"
|
||||||
|
|
||||||
assert_patch(show_live, Routes.context_show_path(conn, :edit, context))
|
assert_patch(show_live, Routes.context_show_path(conn, :edit, context))
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ defmodule MemexWeb.ContextLiveTest do
|
|||||||
|> render_submit()
|
|> render_submit()
|
||||||
|> follow_redirect(conn, Routes.context_show_path(conn, :show, context))
|
|> 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"
|
assert html =~ "some updated content"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -24,15 +24,15 @@ defmodule MemexWeb.InviteLiveTest do
|
|||||||
test "lists all invites", %{conn: conn, invite: invite} do
|
test "lists all invites", %{conn: conn, invite: invite} do
|
||||||
{:ok, _index_live, html} = live(conn, Routes.invite_index_path(conn, :index))
|
{:ok, _index_live, html} = live(conn, Routes.invite_index_path(conn, :index))
|
||||||
|
|
||||||
assert html =~ gettext("Invites")
|
assert html =~ gettext("invites")
|
||||||
assert html =~ invite.name
|
assert html =~ invite.name
|
||||||
end
|
end
|
||||||
|
|
||||||
test "saves new invite", %{conn: conn} do
|
test "saves new invite", %{conn: conn} do
|
||||||
{:ok, index_live, _html} = live(conn, Routes.invite_index_path(conn, :index))
|
{:ok, index_live, _html} = live(conn, Routes.invite_index_path(conn, :index))
|
||||||
|
|
||||||
assert index_live |> element("a", dgettext("actions", "Create Invite")) |> render_click() =~
|
assert index_live |> element("a", dgettext("actions", "create invite")) |> render_click() =~
|
||||||
gettext("New Invite")
|
gettext("new invite")
|
||||||
|
|
||||||
assert_patch(index_live, Routes.invite_index_path(conn, :new))
|
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))
|
{:ok, index_live, _html} = live(conn, Routes.invite_index_path(conn, :index))
|
||||||
|
|
||||||
assert index_live |> element("[data-qa=\"edit-#{invite.id}\"]") |> render_click() =~
|
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))
|
assert_patch(index_live, Routes.invite_index_path(conn, :edit, invite))
|
||||||
|
|
||||||
|
@ -24,15 +24,15 @@ defmodule MemexWeb.NoteLiveTest do
|
|||||||
test "lists all notes", %{conn: conn, note: note} do
|
test "lists all notes", %{conn: conn, note: note} do
|
||||||
{:ok, _index_live, html} = live(conn, Routes.note_index_path(conn, :index))
|
{:ok, _index_live, html} = live(conn, Routes.note_index_path(conn, :index))
|
||||||
|
|
||||||
assert html =~ "Listing Notes"
|
assert html =~ "notes"
|
||||||
assert html =~ note.content
|
assert html =~ note.content
|
||||||
end
|
end
|
||||||
|
|
||||||
test "saves new note", %{conn: conn} do
|
test "saves new note", %{conn: conn} do
|
||||||
{:ok, index_live, _html} = live(conn, Routes.note_index_path(conn, :index))
|
{:ok, index_live, _html} = live(conn, Routes.note_index_path(conn, :index))
|
||||||
|
|
||||||
assert index_live |> element("a", "New Note") |> render_click() =~
|
assert index_live |> element("a", "new note") |> render_click() =~
|
||||||
"New Note"
|
"new note"
|
||||||
|
|
||||||
assert_patch(index_live, Routes.note_index_path(conn, :new))
|
assert_patch(index_live, Routes.note_index_path(conn, :new))
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ defmodule MemexWeb.NoteLiveTest do
|
|||||||
|> render_submit()
|
|> render_submit()
|
||||||
|> follow_redirect(conn, Routes.note_index_path(conn, :index))
|
|> 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"
|
assert html =~ "some content"
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ defmodule MemexWeb.NoteLiveTest do
|
|||||||
{:ok, index_live, _html} = live(conn, Routes.note_index_path(conn, :index))
|
{:ok, index_live, _html} = live(conn, Routes.note_index_path(conn, :index))
|
||||||
|
|
||||||
assert index_live |> element("#note-#{note.id} a", "Edit") |> render_click() =~
|
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))
|
assert_patch(index_live, Routes.note_index_path(conn, :edit, note))
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ defmodule MemexWeb.NoteLiveTest do
|
|||||||
|> render_submit()
|
|> render_submit()
|
||||||
|> follow_redirect(conn, Routes.note_index_path(conn, :index))
|
|> 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"
|
assert html =~ "some updated content"
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -80,21 +80,20 @@ defmodule MemexWeb.NoteLiveTest do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "Show" do
|
describe "show" do
|
||||||
setup [:create_note]
|
setup [:register_and_log_in_user, :create_note]
|
||||||
|
|
||||||
test "displays note", %{conn: conn, note: note} do
|
test "displays note", %{conn: conn, note: note} do
|
||||||
{:ok, _show_live, html} = live(conn, Routes.note_show_path(conn, :show, note))
|
{: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
|
assert html =~ note.content
|
||||||
end
|
end
|
||||||
|
|
||||||
test "updates note within modal", %{conn: conn, note: note} do
|
test "updates note within modal", %{conn: conn, note: note} do
|
||||||
{:ok, show_live, _html} = live(conn, Routes.note_show_path(conn, :show, note))
|
{:ok, show_live, _html} = live(conn, Routes.note_show_path(conn, :show, note))
|
||||||
|
|
||||||
assert show_live |> element("a", "Edit") |> render_click() =~
|
assert show_live |> element("a", "edit") |> render_click() =~ "edit"
|
||||||
"Edit Note"
|
|
||||||
|
|
||||||
assert_patch(show_live, Routes.note_show_path(conn, :edit, note))
|
assert_patch(show_live, Routes.note_show_path(conn, :edit, note))
|
||||||
|
|
||||||
@ -108,7 +107,7 @@ defmodule MemexWeb.NoteLiveTest do
|
|||||||
|> render_submit()
|
|> render_submit()
|
||||||
|> follow_redirect(conn, Routes.note_show_path(conn, :show, note))
|
|> 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"
|
assert html =~ "some updated content"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -5,7 +5,7 @@ defmodule MemexWeb.HomeLiveTest do
|
|||||||
|
|
||||||
test "disconnected and connected render", %{conn: conn} do
|
test "disconnected and connected render", %{conn: conn} do
|
||||||
{:ok, page_live, disconnected_html} = live(conn, "/")
|
{:ok, page_live, disconnected_html} = live(conn, "/")
|
||||||
assert disconnected_html =~ "Welcome to Memex"
|
assert disconnected_html =~ "memex"
|
||||||
assert render(page_live) =~ "Welcome to Memex"
|
assert render(page_live) =~ "memex"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -23,15 +23,15 @@ defmodule MemexWeb.PipelineLiveTest do
|
|||||||
test "lists all pipelines", %{conn: conn, pipeline: pipeline} do
|
test "lists all pipelines", %{conn: conn, pipeline: pipeline} do
|
||||||
{:ok, _index_live, html} = live(conn, Routes.pipeline_index_path(conn, :index))
|
{:ok, _index_live, html} = live(conn, Routes.pipeline_index_path(conn, :index))
|
||||||
|
|
||||||
assert html =~ "Listing Pipelines"
|
assert html =~ "listing pipelines"
|
||||||
assert html =~ pipeline.description
|
assert html =~ pipeline.description
|
||||||
end
|
end
|
||||||
|
|
||||||
test "saves new pipeline", %{conn: conn} do
|
test "saves new pipeline", %{conn: conn} do
|
||||||
{:ok, index_live, _html} = live(conn, Routes.pipeline_index_path(conn, :index))
|
{:ok, index_live, _html} = live(conn, Routes.pipeline_index_path(conn, :index))
|
||||||
|
|
||||||
assert index_live |> element("a", "New Pipeline") |> render_click() =~
|
assert index_live |> element("a", "new pipeline") |> render_click() =~
|
||||||
"New Pipeline"
|
"new pipeline"
|
||||||
|
|
||||||
assert_patch(index_live, Routes.pipeline_index_path(conn, :new))
|
assert_patch(index_live, Routes.pipeline_index_path(conn, :new))
|
||||||
|
|
||||||
@ -45,15 +45,15 @@ defmodule MemexWeb.PipelineLiveTest do
|
|||||||
|> render_submit()
|
|> render_submit()
|
||||||
|> follow_redirect(conn, Routes.pipeline_index_path(conn, :index))
|
|> follow_redirect(conn, Routes.pipeline_index_path(conn, :index))
|
||||||
|
|
||||||
assert html =~ "Pipeline created successfully"
|
assert html =~ "pipeline created successfully"
|
||||||
assert html =~ "some description"
|
assert html =~ "some description"
|
||||||
end
|
end
|
||||||
|
|
||||||
test "updates pipeline in listing", %{conn: conn, pipeline: pipeline} do
|
test "updates pipeline in listing", %{conn: conn, pipeline: pipeline} do
|
||||||
{:ok, index_live, _html} = live(conn, Routes.pipeline_index_path(conn, :index))
|
{:ok, index_live, _html} = live(conn, Routes.pipeline_index_path(conn, :index))
|
||||||
|
|
||||||
assert index_live |> element("#pipeline-#{pipeline.id} a", "Edit") |> render_click() =~
|
assert index_live |> element("#pipeline-#{pipeline.id} a", "edit") |> render_click() =~
|
||||||
"Edit Pipeline"
|
"edit pipeline"
|
||||||
|
|
||||||
assert_patch(index_live, Routes.pipeline_index_path(conn, :edit, pipeline))
|
assert_patch(index_live, Routes.pipeline_index_path(conn, :edit, pipeline))
|
||||||
|
|
||||||
@ -67,33 +67,33 @@ defmodule MemexWeb.PipelineLiveTest do
|
|||||||
|> render_submit()
|
|> render_submit()
|
||||||
|> follow_redirect(conn, Routes.pipeline_index_path(conn, :index))
|
|> follow_redirect(conn, Routes.pipeline_index_path(conn, :index))
|
||||||
|
|
||||||
assert html =~ "Pipeline updated successfully"
|
assert html =~ "pipeline updated successfully"
|
||||||
assert html =~ "some updated description"
|
assert html =~ "some updated description"
|
||||||
end
|
end
|
||||||
|
|
||||||
test "deletes pipeline in listing", %{conn: conn, pipeline: pipeline} do
|
test "deletes pipeline in listing", %{conn: conn, pipeline: pipeline} do
|
||||||
{:ok, index_live, _html} = live(conn, Routes.pipeline_index_path(conn, :index))
|
{: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}")
|
refute has_element?(index_live, "#pipeline-#{pipeline.id}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "Show" do
|
describe "show" do
|
||||||
setup [:create_pipeline]
|
setup [:create_pipeline]
|
||||||
|
|
||||||
test "displays pipeline", %{conn: conn, pipeline: pipeline} do
|
test "displays pipeline", %{conn: conn, pipeline: pipeline} do
|
||||||
{:ok, _show_live, html} = live(conn, Routes.pipeline_show_path(conn, :show, pipeline))
|
{: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
|
assert html =~ pipeline.description
|
||||||
end
|
end
|
||||||
|
|
||||||
test "updates pipeline within modal", %{conn: conn, pipeline: pipeline} do
|
test "updates pipeline within modal", %{conn: conn, pipeline: pipeline} do
|
||||||
{:ok, show_live, _html} = live(conn, Routes.pipeline_show_path(conn, :show, pipeline))
|
{:ok, show_live, _html} = live(conn, Routes.pipeline_show_path(conn, :show, pipeline))
|
||||||
|
|
||||||
assert show_live |> element("a", "Edit") |> render_click() =~
|
assert show_live |> element("a", "edit") |> render_click() =~
|
||||||
"Edit Pipeline"
|
"edit pipeline"
|
||||||
|
|
||||||
assert_patch(show_live, Routes.pipeline_show_path(conn, :edit, pipeline))
|
assert_patch(show_live, Routes.pipeline_show_path(conn, :edit, pipeline))
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ defmodule MemexWeb.PipelineLiveTest do
|
|||||||
|> render_submit()
|
|> render_submit()
|
||||||
|> follow_redirect(conn, Routes.pipeline_show_path(conn, :show, pipeline))
|
|> 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"
|
assert html =~ "some updated description"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user