remove extraneous aliases

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -66,7 +66,7 @@ msgstr ""
msgid "Invite someone new!"
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_registration/new.html.heex:44
#: lib/cannery_web/templates/user_reset_password/edit.html.heex:45
@ -97,7 +97,7 @@ msgstr ""
msgid "New Tag"
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_registration/new.html.heex:3
#: lib/cannery_web/templates/user_registration/new.html.heex:37

View File

@ -79,7 +79,7 @@ msgstr "Passwort vergessen?"
msgid "Invite someone new!"
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_registration/new.html.heex:44
#: lib/cannery_web/templates/user_reset_password/edit.html.heex:45
@ -110,7 +110,7 @@ msgstr "Neuer Behälter"
msgid "New 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_registration/new.html.heex:3
#: lib/cannery_web/templates/user_registration/new.html.heex:37

View File

@ -188,7 +188,7 @@ msgstr "Einladung deaktiviert"
msgid "Invite Only"
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.html.heex:3
#, 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?"
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
msgid "Are you sure you want to log out?"
msgstr "Wirklich ausloggen?"

View File

@ -184,7 +184,7 @@ msgstr ""
msgid "Invite Only"
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.html.heex:3
#, elixir-autogen, elixir-format

View File

@ -66,7 +66,7 @@ msgstr ""
msgid "Invite someone new!"
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_registration/new.html.heex:44
#: lib/cannery_web/templates/user_reset_password/edit.html.heex:45
@ -97,7 +97,7 @@ msgstr ""
msgid "New Tag"
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_registration/new.html.heex:3
#: lib/cannery_web/templates/user_registration/new.html.heex:37

View File

@ -184,7 +184,7 @@ msgstr ""
msgid "Invite Only"
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.html.heex:3
#, elixir-autogen, elixir-format

View File

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

View File

@ -79,7 +79,7 @@ msgstr "¿Has olvidado tu contraseña?"
msgid "Invite someone new!"
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_registration/new.html.heex:44
#: lib/cannery_web/templates/user_reset_password/edit.html.heex:45
@ -110,7 +110,7 @@ msgstr "Nuevo Contenedor"
msgid "New Tag"
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_registration/new.html.heex:3
#: lib/cannery_web/templates/user_registration/new.html.heex:37

View File

@ -188,7 +188,7 @@ msgstr "Invitación Desactivada"
msgid "Invite Only"
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.html.heex:3
#, 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?"
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
msgid "Are you sure you want to log out?"
msgstr "Está seguro que desea cerrar sesión?"

View File

@ -79,7 +79,7 @@ msgstr "Mot de passe oublié?"
msgid "Invite someone new!"
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_registration/new.html.heex:44
#: lib/cannery_web/templates/user_reset_password/edit.html.heex:45
@ -110,7 +110,7 @@ msgstr "Nouveau conteneur"
msgid "New 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_registration/new.html.heex:3
#: lib/cannery_web/templates/user_registration/new.html.heex:37

View File

@ -188,7 +188,7 @@ msgstr "Invitation désactivée"
msgid "Invite Only"
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.html.heex:3
#, 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?"
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
msgid "Are you sure you want to log out?"
msgstr "Êtes-vous certain·e de vouloir vous déconnecter?"

View File

@ -77,7 +77,7 @@ msgstr ""
msgid "Invite someone new!"
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_registration/new.html.heex:44
#: lib/cannery_web/templates/user_reset_password/edit.html.heex:45
@ -108,7 +108,7 @@ msgstr ""
msgid "New Tag"
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_registration/new.html.heex:3
#: lib/cannery_web/templates/user_registration/new.html.heex:37

View File

@ -186,7 +186,7 @@ msgstr ""
msgid "Invite Only"
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.html.heex:3
#, elixir-autogen, elixir-format

View File

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

View File

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