remove extraneous aliases
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
shibao 2023-02-26 14:21:49 -05:00
parent 92cc49630d
commit 632a9e1379
24 changed files with 40 additions and 41 deletions

View File

@ -6,7 +6,7 @@ defmodule CanneryWeb.Components.Topbar do
use CanneryWeb, :component use CanneryWeb, :component
alias Cannery.Accounts alias Cannery.Accounts
alias CanneryWeb.{Endpoint, HomeLive} alias CanneryWeb.HomeLive
def topbar(assigns) do def topbar(assigns) do
assigns = assigns =
@ -81,16 +81,14 @@ defmodule CanneryWeb.Components.Topbar do
<%= gettext("Range") %> <%= gettext("Range") %>
</.link> </.link>
</li> </li>
<%= if @current_user.role == :admin do %> <li :if={@current_user |> Accounts.is_already_admin?()} class="mx-2 my-1">
<li class="mx-2 my-1"> <.link
<.link navigate={Routes.invite_index_path(Endpoint, :index)}
navigate={Routes.invite_index_path(Endpoint, :index)} class="text-primary-600 text-white hover:underline"
class="text-primary-600 text-white hover:underline" >
> <%= gettext("Invites") %>
<%= gettext("Invites") %> </.link>
</.link> </li>
</li>
<% end %>
<li class="mx-2 my-1"> <li class="mx-2 my-1">
<.link <.link
href={Routes.user_settings_path(Endpoint, :edit)} href={Routes.user_settings_path(Endpoint, :edit)}
@ -110,7 +108,8 @@ defmodule CanneryWeb.Components.Topbar do
</li> </li>
<li <li
:if={ :if={
@current_user.role == :admin and function_exported?(Routes, :live_dashboard_path, 2) @current_user |> Accounts.is_already_admin?() and
function_exported?(Routes, :live_dashboard_path, 2)
} }
class="mx-2 my-1" class="mx-2 my-1"
> >

View File

@ -7,7 +7,7 @@ defmodule CanneryWeb.InviteLive.Index do
import CanneryWeb.Components.{InviteCard, UserCard} import CanneryWeb.Components.{InviteCard, UserCard}
alias Cannery.Accounts alias Cannery.Accounts
alias Cannery.Accounts.{Invite, Invites} alias Cannery.Accounts.{Invite, Invites}
alias CanneryWeb.{Endpoint, HomeLive} alias CanneryWeb.HomeLive
alias Phoenix.LiveView.JS alias Phoenix.LiveView.JS
@impl true @impl true

View File

@ -6,7 +6,7 @@ defmodule CanneryWeb.TagLive.Index do
use CanneryWeb, :live_view use CanneryWeb, :live_view
import CanneryWeb.Components.TagCard import CanneryWeb.Components.TagCard
alias Cannery.{Tags, Tags.Tag} alias Cannery.{Tags, Tags.Tag}
alias CanneryWeb.{Endpoint, ViewHelpers} alias CanneryWeb.ViewHelpers
@impl true @impl true
def mount(%{"search" => search}, _session, socket) do def mount(%{"search" => search}, _session, socket) do

View File

@ -3,5 +3,5 @@ defmodule CanneryWeb.EmailView do
A view for email-related helper functions A view for email-related helper functions
""" """
use CanneryWeb, :view use CanneryWeb, :view
alias CanneryWeb.{Endpoint, HomeLive} alias CanneryWeb.HomeLive
end end

View File

@ -1,7 +1,7 @@
defmodule CanneryWeb.ErrorView do defmodule CanneryWeb.ErrorView do
use CanneryWeb, :view use CanneryWeb, :view
import CanneryWeb.Components.Topbar import CanneryWeb.Components.Topbar
alias CanneryWeb.{Endpoint, HomeLive} alias CanneryWeb.HomeLive
def template_not_found(error_path, _assigns) do def template_not_found(error_path, _assigns) do
error_string = error_string =

View File

@ -1,7 +1,7 @@
defmodule CanneryWeb.LayoutView do defmodule CanneryWeb.LayoutView do
use CanneryWeb, :view use CanneryWeb, :view
import CanneryWeb.Components.Topbar import CanneryWeb.Components.Topbar
alias CanneryWeb.{Endpoint, HomeLive} alias CanneryWeb.HomeLive
# Phoenix LiveDashboard is available only in development by default, # Phoenix LiveDashboard is available only in development by default,
# so we instruct Elixir to not warn if the dashboard route is missing. # so we instruct Elixir to not warn if the dashboard route is missing.

View File

@ -66,7 +66,7 @@ msgstr ""
msgid "Invite someone new!" msgid "Invite someone new!"
msgstr "" msgstr ""
#: lib/cannery_web/components/topbar.ex:138 #: lib/cannery_web/components/topbar.ex:137
#: lib/cannery_web/templates/user_confirmation/new.html.heex:31 #: lib/cannery_web/templates/user_confirmation/new.html.heex:31
#: lib/cannery_web/templates/user_registration/new.html.heex:44 #: lib/cannery_web/templates/user_registration/new.html.heex:44
#: lib/cannery_web/templates/user_reset_password/edit.html.heex:45 #: lib/cannery_web/templates/user_reset_password/edit.html.heex:45
@ -97,7 +97,7 @@ msgstr ""
msgid "New Tag" msgid "New Tag"
msgstr "" msgstr ""
#: lib/cannery_web/components/topbar.ex:130 #: lib/cannery_web/components/topbar.ex:129
#: lib/cannery_web/templates/user_confirmation/new.html.heex:28 #: lib/cannery_web/templates/user_confirmation/new.html.heex:28
#: lib/cannery_web/templates/user_registration/new.html.heex:3 #: lib/cannery_web/templates/user_registration/new.html.heex:3
#: lib/cannery_web/templates/user_registration/new.html.heex:37 #: lib/cannery_web/templates/user_registration/new.html.heex:37

View File

@ -79,7 +79,7 @@ msgstr "Passwort vergessen?"
msgid "Invite someone new!" msgid "Invite someone new!"
msgstr "Laden Sie jemanden ein!" msgstr "Laden Sie jemanden ein!"
#: lib/cannery_web/components/topbar.ex:138 #: lib/cannery_web/components/topbar.ex:137
#: lib/cannery_web/templates/user_confirmation/new.html.heex:31 #: lib/cannery_web/templates/user_confirmation/new.html.heex:31
#: lib/cannery_web/templates/user_registration/new.html.heex:44 #: lib/cannery_web/templates/user_registration/new.html.heex:44
#: lib/cannery_web/templates/user_reset_password/edit.html.heex:45 #: lib/cannery_web/templates/user_reset_password/edit.html.heex:45
@ -110,7 +110,7 @@ msgstr "Neuer Behälter"
msgid "New Tag" msgid "New Tag"
msgstr "Neuer Tag" msgstr "Neuer Tag"
#: lib/cannery_web/components/topbar.ex:130 #: lib/cannery_web/components/topbar.ex:129
#: lib/cannery_web/templates/user_confirmation/new.html.heex:28 #: lib/cannery_web/templates/user_confirmation/new.html.heex:28
#: lib/cannery_web/templates/user_registration/new.html.heex:3 #: lib/cannery_web/templates/user_registration/new.html.heex:3
#: lib/cannery_web/templates/user_registration/new.html.heex:37 #: lib/cannery_web/templates/user_registration/new.html.heex:37

View File

@ -188,7 +188,7 @@ msgstr "Einladung deaktiviert"
msgid "Invite Only" msgid "Invite Only"
msgstr "Nur mit Einladung" msgstr "Nur mit Einladung"
#: lib/cannery_web/components/topbar.ex:90 #: lib/cannery_web/components/topbar.ex:89
#: lib/cannery_web/live/invite_live/index.ex:42 #: lib/cannery_web/live/invite_live/index.ex:42
#: lib/cannery_web/live/invite_live/index.html.heex:3 #: lib/cannery_web/live/invite_live/index.html.heex:3
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format

View File

@ -84,7 +84,7 @@ msgstr "Sind Sie sicher, dass sie diese Munition löschen möchten?"
msgid "Are you sure you want to delete your account?" msgid "Are you sure you want to delete your account?"
msgstr "Sind Sie sicher, dass sie Ihren Account löschen möchten?" msgstr "Sind Sie sicher, dass sie Ihren Account löschen möchten?"
#: lib/cannery_web/components/topbar.ex:106 #: lib/cannery_web/components/topbar.ex:104
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Are you sure you want to log out?" msgid "Are you sure you want to log out?"
msgstr "Wirklich ausloggen?" msgstr "Wirklich ausloggen?"

View File

@ -184,7 +184,7 @@ msgstr ""
msgid "Invite Only" msgid "Invite Only"
msgstr "" msgstr ""
#: lib/cannery_web/components/topbar.ex:90 #: lib/cannery_web/components/topbar.ex:89
#: lib/cannery_web/live/invite_live/index.ex:42 #: lib/cannery_web/live/invite_live/index.ex:42
#: lib/cannery_web/live/invite_live/index.html.heex:3 #: lib/cannery_web/live/invite_live/index.html.heex:3
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format

View File

@ -66,7 +66,7 @@ msgstr ""
msgid "Invite someone new!" msgid "Invite someone new!"
msgstr "" msgstr ""
#: lib/cannery_web/components/topbar.ex:138 #: lib/cannery_web/components/topbar.ex:137
#: lib/cannery_web/templates/user_confirmation/new.html.heex:31 #: lib/cannery_web/templates/user_confirmation/new.html.heex:31
#: lib/cannery_web/templates/user_registration/new.html.heex:44 #: lib/cannery_web/templates/user_registration/new.html.heex:44
#: lib/cannery_web/templates/user_reset_password/edit.html.heex:45 #: lib/cannery_web/templates/user_reset_password/edit.html.heex:45
@ -97,7 +97,7 @@ msgstr ""
msgid "New Tag" msgid "New Tag"
msgstr "" msgstr ""
#: lib/cannery_web/components/topbar.ex:130 #: lib/cannery_web/components/topbar.ex:129
#: lib/cannery_web/templates/user_confirmation/new.html.heex:28 #: lib/cannery_web/templates/user_confirmation/new.html.heex:28
#: lib/cannery_web/templates/user_registration/new.html.heex:3 #: lib/cannery_web/templates/user_registration/new.html.heex:3
#: lib/cannery_web/templates/user_registration/new.html.heex:37 #: lib/cannery_web/templates/user_registration/new.html.heex:37

View File

@ -184,7 +184,7 @@ msgstr ""
msgid "Invite Only" msgid "Invite Only"
msgstr "" msgstr ""
#: lib/cannery_web/components/topbar.ex:90 #: lib/cannery_web/components/topbar.ex:89
#: lib/cannery_web/live/invite_live/index.ex:42 #: lib/cannery_web/live/invite_live/index.ex:42
#: lib/cannery_web/live/invite_live/index.html.heex:3 #: lib/cannery_web/live/invite_live/index.html.heex:3
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format

View File

@ -69,7 +69,7 @@ msgstr ""
msgid "Are you sure you want to delete your account?" msgid "Are you sure you want to delete your account?"
msgstr "" msgstr ""
#: lib/cannery_web/components/topbar.ex:106 #: lib/cannery_web/components/topbar.ex:104
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Are you sure you want to log out?" msgid "Are you sure you want to log out?"
msgstr "" msgstr ""

View File

@ -79,7 +79,7 @@ msgstr "¿Has olvidado tu contraseña?"
msgid "Invite someone new!" msgid "Invite someone new!"
msgstr "¡Invita a alguien nuevo!" msgstr "¡Invita a alguien nuevo!"
#: lib/cannery_web/components/topbar.ex:138 #: lib/cannery_web/components/topbar.ex:137
#: lib/cannery_web/templates/user_confirmation/new.html.heex:31 #: lib/cannery_web/templates/user_confirmation/new.html.heex:31
#: lib/cannery_web/templates/user_registration/new.html.heex:44 #: lib/cannery_web/templates/user_registration/new.html.heex:44
#: lib/cannery_web/templates/user_reset_password/edit.html.heex:45 #: lib/cannery_web/templates/user_reset_password/edit.html.heex:45
@ -110,7 +110,7 @@ msgstr "Nuevo Contenedor"
msgid "New Tag" msgid "New Tag"
msgstr "Nueva Etiqueta" msgstr "Nueva Etiqueta"
#: lib/cannery_web/components/topbar.ex:130 #: lib/cannery_web/components/topbar.ex:129
#: lib/cannery_web/templates/user_confirmation/new.html.heex:28 #: lib/cannery_web/templates/user_confirmation/new.html.heex:28
#: lib/cannery_web/templates/user_registration/new.html.heex:3 #: lib/cannery_web/templates/user_registration/new.html.heex:3
#: lib/cannery_web/templates/user_registration/new.html.heex:37 #: lib/cannery_web/templates/user_registration/new.html.heex:37

View File

@ -188,7 +188,7 @@ msgstr "Invitación Desactivada"
msgid "Invite Only" msgid "Invite Only"
msgstr "Solo Invitación" msgstr "Solo Invitación"
#: lib/cannery_web/components/topbar.ex:90 #: lib/cannery_web/components/topbar.ex:89
#: lib/cannery_web/live/invite_live/index.ex:42 #: lib/cannery_web/live/invite_live/index.ex:42
#: lib/cannery_web/live/invite_live/index.html.heex:3 #: lib/cannery_web/live/invite_live/index.html.heex:3
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format

View File

@ -84,7 +84,7 @@ msgstr "Está seguro que desea eliminar esta munición?"
msgid "Are you sure you want to delete your account?" msgid "Are you sure you want to delete your account?"
msgstr "Está seguro que desea eliminar su cuenta?" msgstr "Está seguro que desea eliminar su cuenta?"
#: lib/cannery_web/components/topbar.ex:106 #: lib/cannery_web/components/topbar.ex:104
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Are you sure you want to log out?" msgid "Are you sure you want to log out?"
msgstr "Está seguro que desea cerrar sesión?" msgstr "Está seguro que desea cerrar sesión?"

View File

@ -79,7 +79,7 @@ msgstr "Mot de passe oublié?"
msgid "Invite someone new!" msgid "Invite someone new!"
msgstr "Invitez une nouvelle personne!" msgstr "Invitez une nouvelle personne!"
#: lib/cannery_web/components/topbar.ex:138 #: lib/cannery_web/components/topbar.ex:137
#: lib/cannery_web/templates/user_confirmation/new.html.heex:31 #: lib/cannery_web/templates/user_confirmation/new.html.heex:31
#: lib/cannery_web/templates/user_registration/new.html.heex:44 #: lib/cannery_web/templates/user_registration/new.html.heex:44
#: lib/cannery_web/templates/user_reset_password/edit.html.heex:45 #: lib/cannery_web/templates/user_reset_password/edit.html.heex:45
@ -110,7 +110,7 @@ msgstr "Nouveau conteneur"
msgid "New Tag" msgid "New Tag"
msgstr "Nouveau tag" msgstr "Nouveau tag"
#: lib/cannery_web/components/topbar.ex:130 #: lib/cannery_web/components/topbar.ex:129
#: lib/cannery_web/templates/user_confirmation/new.html.heex:28 #: lib/cannery_web/templates/user_confirmation/new.html.heex:28
#: lib/cannery_web/templates/user_registration/new.html.heex:3 #: lib/cannery_web/templates/user_registration/new.html.heex:3
#: lib/cannery_web/templates/user_registration/new.html.heex:37 #: lib/cannery_web/templates/user_registration/new.html.heex:37

View File

@ -188,7 +188,7 @@ msgstr "Invitation désactivée"
msgid "Invite Only" msgid "Invite Only"
msgstr "Uniquement sur invitation" msgstr "Uniquement sur invitation"
#: lib/cannery_web/components/topbar.ex:90 #: lib/cannery_web/components/topbar.ex:89
#: lib/cannery_web/live/invite_live/index.ex:42 #: lib/cannery_web/live/invite_live/index.ex:42
#: lib/cannery_web/live/invite_live/index.html.heex:3 #: lib/cannery_web/live/invite_live/index.html.heex:3
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format

View File

@ -85,7 +85,7 @@ msgstr "Êtes-vous certain·e de supprimer cette munition?"
msgid "Are you sure you want to delete your account?" msgid "Are you sure you want to delete your account?"
msgstr "Êtes-vous certain·e de supprimer votre compte?" msgstr "Êtes-vous certain·e de supprimer votre compte?"
#: lib/cannery_web/components/topbar.ex:106 #: lib/cannery_web/components/topbar.ex:104
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Are you sure you want to log out?" msgid "Are you sure you want to log out?"
msgstr "Êtes-vous certain·e de vouloir vous déconnecter?" msgstr "Êtes-vous certain·e de vouloir vous déconnecter?"

View File

@ -77,7 +77,7 @@ msgstr ""
msgid "Invite someone new!" msgid "Invite someone new!"
msgstr "" msgstr ""
#: lib/cannery_web/components/topbar.ex:138 #: lib/cannery_web/components/topbar.ex:137
#: lib/cannery_web/templates/user_confirmation/new.html.heex:31 #: lib/cannery_web/templates/user_confirmation/new.html.heex:31
#: lib/cannery_web/templates/user_registration/new.html.heex:44 #: lib/cannery_web/templates/user_registration/new.html.heex:44
#: lib/cannery_web/templates/user_reset_password/edit.html.heex:45 #: lib/cannery_web/templates/user_reset_password/edit.html.heex:45
@ -108,7 +108,7 @@ msgstr ""
msgid "New Tag" msgid "New Tag"
msgstr "" msgstr ""
#: lib/cannery_web/components/topbar.ex:130 #: lib/cannery_web/components/topbar.ex:129
#: lib/cannery_web/templates/user_confirmation/new.html.heex:28 #: lib/cannery_web/templates/user_confirmation/new.html.heex:28
#: lib/cannery_web/templates/user_registration/new.html.heex:3 #: lib/cannery_web/templates/user_registration/new.html.heex:3
#: lib/cannery_web/templates/user_registration/new.html.heex:37 #: lib/cannery_web/templates/user_registration/new.html.heex:37

View File

@ -186,7 +186,7 @@ msgstr ""
msgid "Invite Only" msgid "Invite Only"
msgstr "" msgstr ""
#: lib/cannery_web/components/topbar.ex:90 #: lib/cannery_web/components/topbar.ex:89
#: lib/cannery_web/live/invite_live/index.ex:42 #: lib/cannery_web/live/invite_live/index.ex:42
#: lib/cannery_web/live/invite_live/index.html.heex:3 #: lib/cannery_web/live/invite_live/index.html.heex:3
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format

View File

@ -80,7 +80,7 @@ msgstr ""
msgid "Are you sure you want to delete your account?" msgid "Are you sure you want to delete your account?"
msgstr "" msgstr ""
#: lib/cannery_web/components/topbar.ex:106 #: lib/cannery_web/components/topbar.ex:104
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Are you sure you want to log out?" msgid "Are you sure you want to log out?"
msgstr "" msgstr ""

View File

@ -69,7 +69,7 @@ msgstr ""
msgid "Are you sure you want to delete your account?" msgid "Are you sure you want to delete your account?"
msgstr "" msgstr ""
#: lib/cannery_web/components/topbar.ex:106 #: lib/cannery_web/components/topbar.ex:104
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Are you sure you want to log out?" msgid "Are you sure you want to log out?"
msgstr "" msgstr ""