forked from shibao/cannery
remove extraneous aliases
This commit is contained in:
@ -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"
|
||||
>
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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 =
|
||||
|
@ -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.
|
||||
|
Reference in New Issue
Block a user