diff --git a/changelog.md b/changelog.md index 7593abc..64dd132 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # v0.1.8 - Fix bug with public registration +- Improve templates # v0.1.7 - Update dependencies diff --git a/lib/memex_web/components/contexts_table_component.ex b/lib/memex_web/components/contexts_table_component.ex index 4006db3..ccb176d 100644 --- a/lib/memex_web/components/contexts_table_component.ex +++ b/lib/memex_web/components/contexts_table_component.ex @@ -109,11 +109,13 @@ defmodule MemexWeb.Components.ContextsTableComponent do ~H"""
- <%= for tag <- @tags do %> - <.link patch={Routes.context_index_path(Endpoint, :search, tag)} class="link"> - <%= tag %> - - <% end %> + <.link + :for={tag <- @tags} + patch={Routes.context_index_path(Endpoint, :search, tag)} + class="link" + > + <%= tag %> +
""" end diff --git a/lib/memex_web/components/invite_card.ex b/lib/memex_web/components/invite_card.ex index c4389bb..e71cbe1 100644 --- a/lib/memex_web/components/invite_card.ex +++ b/lib/memex_web/components/invite_card.ex @@ -47,11 +47,9 @@ defmodule MemexWeb.Components.InviteCard do <%= render_slot(@code_actions) %> - <%= if @inner_block do %> -
- <%= render_slot(@inner_block) %> -
- <% end %> +
+ <%= render_slot(@inner_block) %> +
""" end diff --git a/lib/memex_web/components/notes_table_component.ex b/lib/memex_web/components/notes_table_component.ex index 527faf7..eef4b9e 100644 --- a/lib/memex_web/components/notes_table_component.ex +++ b/lib/memex_web/components/notes_table_component.ex @@ -109,11 +109,9 @@ defmodule MemexWeb.Components.NotesTableComponent do ~H"""
- <%= for tag <- @tags do %> - <.link patch={Routes.note_index_path(Endpoint, :search, tag)} class="link"> - <%= tag %> - - <% end %> + <.link :for={tag <- @tags} patch={Routes.note_index_path(Endpoint, :search, tag)} class="link"> + <%= tag %> +
""" end diff --git a/lib/memex_web/components/pipelines_table_component.ex b/lib/memex_web/components/pipelines_table_component.ex index a2c5be7..9bdc406 100644 --- a/lib/memex_web/components/pipelines_table_component.ex +++ b/lib/memex_web/components/pipelines_table_component.ex @@ -122,11 +122,13 @@ defmodule MemexWeb.Components.PipelinesTableComponent do ~H"""
- <%= for tag <- @tags do %> - <.link patch={Routes.pipeline_index_path(Endpoint, :search, tag)} class="link"> - <%= tag %> - - <% end %> + <.link + :for={tag <- @tags} + patch={Routes.pipeline_index_path(Endpoint, :search, tag)} + class="link" + > + <%= tag %> +
""" end diff --git a/lib/memex_web/components/table_component.html.heex b/lib/memex_web/components/table_component.html.heex index cb417e6..7142e06 100644 --- a/lib/memex_web/components/table_component.html.heex +++ b/lib/memex_web/components/table_component.html.heex @@ -33,20 +33,19 @@ - <%= for {values, i} <- @rows |> Enum.with_index() do %> - Integer.is_even(), do: @row_class, else: @alternate_row_class}> - <%= for %{key: key} = value <- @columns do %> - - <%= case values |> Map.get(key) do %> - <% {_custom_sort_value, value} -> %> - <%= value %> - <% value -> %> - <%= value %> - <% end %> - + Enum.with_index()} + class={if i |> Integer.is_even(), do: @row_class, else: @alternate_row_class} + > + + <%= case values |> Map.get(key) do %> + <% {_custom_sort_value, value} -> %> + <%= value %> + <% value -> %> + <%= value %> <% end %> - - <% end %> + + diff --git a/lib/memex_web/components/topbar.ex b/lib/memex_web/components/topbar.ex index b22db1f..b016a0e 100644 --- a/lib/memex_web/components/topbar.ex +++ b/lib/memex_web/components/topbar.ex @@ -65,16 +65,14 @@ defmodule MemexWeb.Components.Topbar do
  • <%= if @current_user do %> - <%= if @current_user |> Accounts.is_already_admin?() do %> -
  • - <.link - navigate={Routes.invite_index_path(Endpoint, :index)} - class="text-primary-400 text-primary-400 hover:underline" - > - <%= gettext("invites") %> - -
  • - <% end %> +
  • Accounts.is_already_admin?()} class="mx-2 my-1"> + <.link + navigate={Routes.invite_index_path(Endpoint, :index)} + class="text-primary-400 text-primary-400 hover:underline" + > + <%= gettext("invites") %> + +
  • <.link @@ -95,27 +93,28 @@ defmodule MemexWeb.Components.Topbar do
  • - <%= if @current_user.role == :admin and function_exported?(Routes, :live_dashboard_path, 2) do %> -
  • - <.link - navigate={Routes.live_dashboard_path(Endpoint, :home)} - class="text-primary-400 text-primary-400 hover:underline" - > - - -
  • - <% end %> +
  • + <.link + navigate={Routes.live_dashboard_path(Endpoint, :home)} + class="text-primary-400 text-primary-400 hover:underline" + > + + +
  • <% else %> - <%= if Accounts.allow_registration?() do %> -
  • - <.link - navigate={Routes.user_registration_path(Endpoint, :new)} - class="text-primary-400 text-primary-400 hover:underline truncate" - > - <%= dgettext("actions", "register") %> - -
  • - <% end %> +
  • + <.link + navigate={Routes.user_registration_path(Endpoint, :new)} + class="text-primary-400 text-primary-400 hover:underline truncate" + > + <%= dgettext("actions", "register") %> + +
  • <.link diff --git a/lib/memex_web/components/user_card.ex b/lib/memex_web/components/user_card.ex index 37d7233..246de93 100644 --- a/lib/memex_web/components/user_card.ex +++ b/lib/memex_web/components/user_card.ex @@ -10,8 +10,8 @@ defmodule MemexWeb.Components.UserCard do

    <%= @user.email %> @@ -39,11 +39,9 @@ defmodule MemexWeb.Components.UserCard do

    - <%= if @inner_block do %> -
    - <%= render_slot(@inner_block) %> -
    - <% end %> +
    + <%= render_slot(@inner_block) %> +
    """ end diff --git a/lib/memex_web/live/context_live/index.html.heex b/lib/memex_web/live/context_live/index.html.heex index dd0bc8b..2a94b79 100644 --- a/lib/memex_web/live/context_live/index.html.heex +++ b/lib/memex_web/live/context_live/index.html.heex @@ -30,46 +30,44 @@ contexts={@contexts} > <:actions :let={context}> - <%= if is_owner?(context, @current_user) do %> - <.link - patch={Routes.context_index_path(@socket, :edit, context.slug)} - data-qa={"context-edit-#{context.id}"} - > - <%= dgettext("actions", "edit") %> - - <% end %> - <%= if is_owner_or_admin?(context, @current_user) do %> - <.link - href="#" - phx-click="delete" - phx-value-id={context.id} - data-confirm={dgettext("prompts", "are you sure?")} - data-qa={"delete-context-#{context.id}"} - > - <%= dgettext("actions", "delete") %> - - <% end %> + <.link + :if={is_owner?(context, @current_user)} + patch={Routes.context_index_path(@socket, :edit, context.slug)} + data-qa={"context-edit-#{context.id}"} + > + <%= dgettext("actions", "edit") %> + + <.link + :if={is_owner_or_admin?(context, @current_user)} + href="#" + phx-click="delete" + phx-value-id={context.id} + data-confirm={dgettext("prompts", "are you sure?")} + data-qa={"delete-context-#{context.id}"} + > + <%= dgettext("actions", "delete") %> + <% end %> - <%= if @current_user do %> - <.link patch={Routes.context_index_path(@socket, :new)} class="self-end btn btn-primary"> - <%= dgettext("actions", "new context") %> - - <% end %> + <.link + :if={@current_user} + patch={Routes.context_index_path(@socket, :new)} + class="self-end btn btn-primary" + > + <%= dgettext("actions", "new context") %> + -<%= if @live_action in [:new, :edit] do %> - <.modal return_to={Routes.context_index_path(@socket, :index)}> - <.live_component - module={MemexWeb.ContextLive.FormComponent} - id={@context.id || :new} - current_user={@current_user} - title={@page_title} - action={@live_action} - context={@context} - return_to={Routes.context_index_path(@socket, :index)} - /> - -<% end %> +<.modal :if={@live_action in [:new, :edit]} return_to={Routes.context_index_path(@socket, :index)}> + <.live_component + module={MemexWeb.ContextLive.FormComponent} + id={@context.id || :new} + current_user={@current_user} + title={@page_title} + action={@live_action} + context={@context} + return_to={Routes.context_index_path(@socket, :index)} + /> + diff --git a/lib/memex_web/live/context_live/show.html.heex b/lib/memex_web/live/context_live/show.html.heex index 1d5be4d..b1ba656 100644 --- a/lib/memex_web/live/context_live/show.html.heex +++ b/lib/memex_web/live/context_live/show.html.heex @@ -4,11 +4,13 @@
    - <%= for tag <- @context.tags do %> - <.link navigate={Routes.context_index_path(Endpoint, :search, tag)} class="link"> - <%= tag %> - - <% end %> + <.link + :for={tag <- @context.tags} + navigate={Routes.context_index_path(Endpoint, :search, tag)} + class="link" + > + <%= tag %> +
    <.context_content context={@context} /> @@ -21,38 +23,37 @@ <.link class="btn btn-primary" navigate={Routes.context_index_path(@socket, :index)}> <%= dgettext("actions", "back") %> - <%= if is_owner?(@context, @current_user) do %> - <.link - class="btn btn-primary" - patch={Routes.context_show_path(@socket, :edit, @context.slug)} - > - <%= dgettext("actions", "edit") %> - - <% end %> - <%= if is_owner_or_admin?(@context, @current_user) do %> - - <% end %> + <.link + :if={is_owner?(@context, @current_user)} + class="btn btn-primary" + patch={Routes.context_show_path(@socket, :edit, @context.slug)} + > + <%= dgettext("actions", "edit") %> + + -<%= if @live_action in [:edit] do %> - <.modal return_to={Routes.context_show_path(@socket, :show, @context.slug)}> - <.live_component - module={MemexWeb.ContextLive.FormComponent} - id={@context.id} - current_user={@current_user} - title={@page_title} - action={@live_action} - context={@context} - return_to={Routes.context_show_path(@socket, :show, @context.slug)} - /> - -<% end %> +<.modal + if={@live_action == :edit} + return_to={Routes.context_show_path(@socket, :show, @context.slug)} +> + <.live_component + module={MemexWeb.ContextLive.FormComponent} + id={@context.id} + current_user={@current_user} + title={@page_title} + action={@live_action} + context={@context} + return_to={Routes.context_show_path(@socket, :show, @context.slug)} + /> + diff --git a/lib/memex_web/live/home_live.html.heex b/lib/memex_web/live/home_live.html.heex index 947e353..1afd985 100644 --- a/lib/memex_web/live/home_live.html.heex +++ b/lib/memex_web/live/home_live.html.heex @@ -38,7 +38,7 @@ navigate={Routes.live_path(Endpoint, FaqLive)} class="link title text-primary-400 text-lg" > - <%= gettext("read more on how to use %{name}", name: "memEx") %> + <%= gettext("read more on how to use memEx") %>
  • @@ -92,15 +92,13 @@

    <%= if @admins |> Enum.empty?() do %> <.link href={Routes.user_registration_path(Endpoint, :new)} class="link"> - <%= dgettext("prompts", "register to setup %{name}", name: "memEx") %> + <%= dgettext("prompts", "register to setup memEx") %> <% else %>

    - <%= for admin <- @admins do %> - - <%= admin.email %> - - <% end %> + + <%= email %> +
    <% end %>

    diff --git a/lib/memex_web/live/invite_live/form_component.html.heex b/lib/memex_web/live/invite_live/form_component.html.heex index e43224d..5975ac2 100644 --- a/lib/memex_web/live/invite_live/form_component.html.heex +++ b/lib/memex_web/live/invite_live/form_component.html.heex @@ -11,11 +11,12 @@ phx-change="validate" phx-submit="save" > - <%= if @changeset.action && not @changeset.valid? do %> -
    - <%= changeset_errors(@changeset) %> -
    - <% end %> +
    + <%= changeset_errors(@changeset) %> +
    <%= label(f, :name, gettext("Name"), class: "title text-lg text-primary-400") %> <%= text_input(f, :name, class: "input input-primary col-span-2") %> diff --git a/lib/memex_web/live/invite_live/index.html.heex b/lib/memex_web/live/invite_live/index.html.heex index d128e85..3e206d8 100644 --- a/lib/memex_web/live/invite_live/index.html.heex +++ b/lib/memex_web/live/invite_live/index.html.heex @@ -18,69 +18,65 @@ <% end %>
    - <%= for invite <- @invites do %> - <.invite_card invite={invite}> - <:code_actions> -
    - -
    - - <.link - patch={Routes.invite_index_path(Endpoint, :edit, invite)} - class="text-primary-400 link" - data-qa={"edit-#{invite.id}"} - > - - - - <.link - href="#" - class="text-primary-400 link" - phx-click="delete_invite" - phx-value-id={invite.id} - data-confirm={ - dgettext("prompts", "are you sure you want to delete the invite for %{invite_name}?", - invite_name: invite.name - ) - } - data-qa={"delete-#{invite.id}"} - > - - - - <%= if invite.disabled_at |> is_nil() do %> - - <%= gettext("disable") %> - - <% else %> - - <%= gettext("enable") %> - - <% end %> - - <%= if invite.disabled_at |> is_nil() and not (invite.uses_left |> is_nil()) do %> - + <:code_actions> +
    + +
    + + <.link + patch={Routes.invite_index_path(Endpoint, :edit, invite)} + class="text-primary-400 link" + data-qa={"edit-#{invite.id}"} + > + + + + <.link + href="#" + class="text-primary-400 link" + phx-click="delete_invite" + phx-value-id={invite.id} + data-confirm={ + dgettext("prompts", "are you sure you want to delete the invite for %{invite_name}?", + invite_name: invite.name + ) + } + data-qa={"delete-#{invite.id}"} + > + + + + + <%= if invite.disabled_at, do: gettext("enable"), else: gettext("disable") %> + + + is_nil() and not (invite.uses_left |> is_nil())} + href="#" + class="btn btn-primary" + phx-click="set_unlimited" + phx-value-id={invite.id} + data-confirm={ + dgettext("prompts", "are you sure you want to make %{invite_name} unlimited?", + invite_name: invite.name + ) + } + > + <%= gettext("set unlimited") %> + +
    <%= unless @admins |> Enum.empty?() do %> @@ -91,25 +87,23 @@
    - <%= for admin <- @admins do %> - <.user_card user={admin}> - <.link - href="#" - class="text-primary-400 link" - phx-click="delete_user" - phx-value-id={admin.id} - data-confirm={ - dgettext( - "prompts", - "are you sure you want to delete %{email}? This action is permanent!", - email: admin.email - ) - } - > - - - - <% end %> + <.user_card :for={admin <- @admins} user={admin}> + <.link + href="#" + class="text-primary-400 link" + phx-click="delete_user" + phx-value-id={admin.id} + data-confirm={ + dgettext( + "prompts", + "are you sure you want to delete %{email}? This action is permanent!", + email: admin.email + ) + } + > + + +
    <% end %> @@ -121,39 +115,35 @@
    - <%= for user <- @users do %> - <.user_card user={user}> - <.link - href="#" - class="text-primary-400 link" - phx-click="delete_user" - phx-value-id={user.id} - data-confirm={ - dgettext( - "prompts", - "are you sure you want to delete %{email}? This action is permanent!", - email: user.email - ) - } - > - - - - <% end %> + <.user_card :for={user <- @users} user={user}> + <.link + href="#" + class="text-primary-400 link" + phx-click="delete_user" + phx-value-id={user.id} + data-confirm={ + dgettext( + "prompts", + "are you sure you want to delete %{email}? This action is permanent!", + email: user.email + ) + } + > + + +
    <% end %> -<%= if @live_action in [:new, :edit] do %> - <.modal return_to={Routes.invite_index_path(Endpoint, :index)}> - <.live_component - module={MemexWeb.InviteLive.FormComponent} - id={@invite.id || :new} - title={@page_title} - action={@live_action} - invite={@invite} - return_to={Routes.invite_index_path(Endpoint, :index)} - current_user={@current_user} - /> - -<% end %> +<.modal :if={@live_action in [:new, :edit]} return_to={Routes.invite_index_path(Endpoint, :index)}> + <.live_component + module={MemexWeb.InviteLive.FormComponent} + id={@invite.id || :new} + title={@page_title} + action={@live_action} + invite={@invite} + return_to={Routes.invite_index_path(Endpoint, :index)} + current_user={@current_user} + /> + diff --git a/lib/memex_web/live/live_helpers.ex b/lib/memex_web/live/live_helpers.ex index c68fbf1..793788c 100644 --- a/lib/memex_web/live/live_helpers.ex +++ b/lib/memex_web/live/live_helpers.ex @@ -31,8 +31,8 @@ defmodule MemexWeb.LiveHelpers do patch={@return_to} id="modal-bg" class="fade-in fixed z-10 left-0 top-0 - w-screen h-screen overflow-hidden - p-8 flex flex-col justify-center items-center cursor-auto" + w-screen h-screen overflow-hidden + p-8 flex flex-col justify-center items-center cursor-auto" style="background-color: rgba(0,0,0,0.4);" phx-remove={hide_modal()} > @@ -48,16 +48,16 @@ defmodule MemexWeb.LiveHelpers do -<%= if @live_action in [:new, :edit] do %> - <.modal return_to={Routes.note_index_path(@socket, :index)}> - <.live_component - module={MemexWeb.NoteLive.FormComponent} - id={@note.id || :new} - current_user={@current_user} - title={@page_title} - action={@live_action} - note={@note} - return_to={Routes.note_index_path(@socket, :index)} - /> - -<% end %> +<.modal :if={@live_action in [:new, :edit]} return_to={Routes.note_index_path(@socket, :index)}> + <.live_component + module={MemexWeb.NoteLive.FormComponent} + id={@note.id || :new} + current_user={@current_user} + title={@page_title} + action={@live_action} + note={@note} + return_to={Routes.note_index_path(@socket, :index)} + /> + diff --git a/lib/memex_web/live/note_live/show.html.heex b/lib/memex_web/live/note_live/show.html.heex index f02b6ea..ebce59e 100644 --- a/lib/memex_web/live/note_live/show.html.heex +++ b/lib/memex_web/live/note_live/show.html.heex @@ -4,11 +4,13 @@
    - <%= for tag <- @note.tags do %> - <.link navigate={Routes.note_index_path(Endpoint, :search, tag)} class="link"> - <%= tag %> - - <% end %> + <.link + :for={tag <- @note.tags} + navigate={Routes.note_index_path(Endpoint, :search, tag)} + class="link" + > + <%= tag %> +
    <.note_content note={@note} /> @@ -21,35 +23,34 @@ <.link class="btn btn-primary" navigate={Routes.note_index_path(@socket, :index)}> <%= dgettext("actions", "back") %> - <%= if is_owner?(@note, @current_user) do %> - <.link class="btn btn-primary" patch={Routes.note_show_path(@socket, :edit, @note.slug)}> - <%= dgettext("actions", "edit") %> - - <% end %> - <%= if is_owner_or_admin?(@note, @current_user) do %> - - <% end %> + <.link + :if={is_owner?(@note, @current_user)} + class="btn btn-primary" + patch={Routes.note_show_path(@socket, :edit, @note.slug)} + > + <%= dgettext("actions", "edit") %> + + -<%= if @live_action in [:edit] do %> - <.modal return_to={Routes.note_show_path(@socket, :show, @note.slug)}> - <.live_component - module={MemexWeb.NoteLive.FormComponent} - id={@note.id} - current_user={@current_user} - title={@page_title} - action={@live_action} - note={@note} - return_to={Routes.note_show_path(@socket, :show, @note.slug)} - /> - -<% end %> +<.modal :if={@live_action == :edit} return_to={Routes.note_show_path(@socket, :show, @note.slug)}> + <.live_component + module={MemexWeb.NoteLive.FormComponent} + id={@note.id} + current_user={@current_user} + title={@page_title} + action={@live_action} + note={@note} + return_to={Routes.note_show_path(@socket, :show, @note.slug)} + /> + diff --git a/lib/memex_web/live/pipeline_live/index.html.heex b/lib/memex_web/live/pipeline_live/index.html.heex index 6ef21f3..5d91906 100644 --- a/lib/memex_web/live/pipeline_live/index.html.heex +++ b/lib/memex_web/live/pipeline_live/index.html.heex @@ -30,46 +30,47 @@ pipelines={@pipelines} > <:actions :let={pipeline}> - <%= if is_owner?(pipeline, @current_user) do %> - <.link - patch={Routes.pipeline_index_path(@socket, :edit, pipeline.slug)} - data-qa={"pipeline-edit-#{pipeline.id}"} - > - <%= dgettext("actions", "edit") %> - - <% end %> - <%= if is_owner_or_admin?(pipeline, @current_user) do %> - <.link - href="#" - phx-click="delete" - phx-value-id={pipeline.id} - data-confirm={dgettext("prompts", "are you sure?")} - data-qa={"delete-pipeline-#{pipeline.id}"} - > - <%= dgettext("actions", "delete") %> - - <% end %> + <.link + :if={is_owner?(pipeline, @current_user)} + patch={Routes.pipeline_index_path(@socket, :edit, pipeline.slug)} + data-qa={"pipeline-edit-#{pipeline.id}"} + > + <%= dgettext("actions", "edit") %> + + <.link + :if={is_owner_or_admin?(pipeline, @current_user)} + href="#" + phx-click="delete" + phx-value-id={pipeline.id} + data-confirm={dgettext("prompts", "are you sure?")} + data-qa={"delete-pipeline-#{pipeline.id}"} + > + <%= dgettext("actions", "delete") %> + <% end %> - <%= if @current_user do %> - <.link patch={Routes.pipeline_index_path(@socket, :new)} class="self-end btn btn-primary"> - <%= dgettext("actions", "new pipeline") %> - - <% end %> + <.link + :if={@current_user} + patch={Routes.pipeline_index_path(@socket, :new)} + class="self-end btn btn-primary" + > + <%= dgettext("actions", "new pipeline") %> + -<%= if @live_action in [:new, :edit] do %> - <.modal return_to={Routes.pipeline_index_path(@socket, :index)}> - <.live_component - module={MemexWeb.PipelineLive.FormComponent} - id={@pipeline.id || :new} - current_user={@current_user} - title={@page_title} - action={@live_action} - pipeline={@pipeline} - return_to={Routes.pipeline_index_path(@socket, :index)} - /> - -<% end %> +<.modal + :if={@live_action in [:new, :edit]} + return_to={Routes.pipeline_index_path(@socket, :index)} +> + <.live_component + module={MemexWeb.PipelineLive.FormComponent} + id={@pipeline.id || :new} + current_user={@current_user} + title={@page_title} + action={@live_action} + pipeline={@pipeline} + return_to={Routes.pipeline_index_path(@socket, :index)} + /> + diff --git a/lib/memex_web/live/pipeline_live/show.html.heex b/lib/memex_web/live/pipeline_live/show.html.heex index 45b5aa4..f6847df 100644 --- a/lib/memex_web/live/pipeline_live/show.html.heex +++ b/lib/memex_web/live/pipeline_live/show.html.heex @@ -4,23 +4,24 @@
    - <%= for tag <- @pipeline.tags do %> - <.link navigate={Routes.pipeline_index_path(Endpoint, :search, tag)} class="link"> - <%= tag %> - - <% end %> + <.link + :for={tag <- @pipeline.tags} + navigate={Routes.pipeline_index_path(Endpoint, :search, tag)} + class="link" + > + <%= tag %> +
    - <%= if @pipeline.description do %> - - <% end %> +

    <%= gettext("Visibility: %{visibility}", visibility: @pipeline.visibility) %> @@ -30,25 +31,23 @@ <.link class="btn btn-primary" navigate={Routes.pipeline_index_path(@socket, :index)}> <%= dgettext("actions", "back") %> - <%= if is_owner?(@pipeline, @current_user) do %> - <.link - class="btn btn-primary" - patch={Routes.pipeline_show_path(@socket, :edit, @pipeline.slug)} - > - <%= dgettext("actions", "edit") %> - - <% end %> - <%= if is_owner_or_admin?(@pipeline, @current_user) do %> - - <% end %> + <.link + :if={is_owner?(@pipeline, @current_user)} + class="btn btn-primary" + patch={Routes.pipeline_show_path(@socket, :edit, @pipeline.slug)} + > + <%= dgettext("actions", "edit") %> + +


    @@ -126,15 +125,14 @@ <% end %> <% end %> - <%= if is_owner?(@pipeline, @current_user) do %> - <.link - class="self-end btn btn-primary" - patch={Routes.pipeline_show_path(@socket, :add_step, @pipeline.slug)} - data-qa={"add-step-#{@pipeline.id}"} - > - <%= dgettext("actions", "add step") %> - - <% end %> + <.link + :if={is_owner?(@pipeline, @current_user)} + class="self-end btn btn-primary" + patch={Routes.pipeline_show_path(@socket, :add_step, @pipeline.slug)} + data-qa={"add-step-#{@pipeline.id}"} + > + <%= dgettext("actions", "add step") %> + <%= case @live_action do %> @@ -150,20 +148,7 @@ return_to={Routes.pipeline_show_path(@socket, :show, @pipeline.slug)} /> - <% :add_step -> %> - <.modal return_to={Routes.pipeline_show_path(@socket, :show, @pipeline.slug)}> - <.live_component - module={MemexWeb.StepLive.FormComponent} - id={@pipeline.id || :new} - current_user={@current_user} - title={@page_title} - action={@live_action} - pipeline={@pipeline} - step={@step} - return_to={Routes.pipeline_show_path(@socket, :show, @pipeline.slug)} - /> - - <% :edit_step -> %> + <% action when action in [:add_step, :edit_step] -> %> <.modal return_to={Routes.pipeline_show_path(@socket, :show, @pipeline.slug)}> <.live_component module={MemexWeb.StepLive.FormComponent} diff --git a/lib/memex_web/templates/error/error.html.heex b/lib/memex_web/templates/error/error.html.heex index c78a695..a7eb289 100644 --- a/lib/memex_web/templates/error/error.html.heex +++ b/lib/memex_web/templates/error/error.html.heex @@ -5,7 +5,7 @@ - <%= dgettext("errors", "Error") %> | memEx + <%= dgettext("errors", "Error") %> | <%= gettext("memEx") %>