185 lines
7.7 KiB
Plaintext
185 lines
7.7 KiB
Plaintext
<nav class="relative z-20 py-8">
|
|
<div class="container print:max-w-full">
|
|
<nav class="relative flex items-center justify-between sm:h-10 md:justify-center">
|
|
<div class="flex items-center flex-1 md:absolute md:inset-y-0 md:left-0">
|
|
<a href={home_dest(@conn)}>
|
|
<img
|
|
src={
|
|
PlausibleWeb.Router.Helpers.static_path(
|
|
@conn,
|
|
logo_path("logo_dark.svg")
|
|
)
|
|
}
|
|
class="w-32 hidden dark:inline"
|
|
alt="Plausible logo"
|
|
loading="lazy"
|
|
/>
|
|
<img
|
|
src={
|
|
PlausibleWeb.Router.Helpers.static_path(
|
|
@conn,
|
|
logo_path("logo_light.svg")
|
|
)
|
|
}
|
|
class="w-32 inline dark:hidden"
|
|
alt="Plausible logo"
|
|
loading="lazy"
|
|
/>
|
|
</a>
|
|
</div>
|
|
<div class="absolute inset-y-0 right-0 flex items-center justify-end">
|
|
<%= cond do %>
|
|
<% @conn.assigns[:current_user] -> %>
|
|
<ul class="flex items-center gap-2 w-full sm:w-auto">
|
|
<li :if={
|
|
ee?() && @conn.assigns[:site] &&
|
|
Plausible.Auth.is_super_admin?(@conn.assigns[:current_user])
|
|
}>
|
|
<.styled_link
|
|
class="text-sm mr-6"
|
|
href={"/cs/sites/site/#{@conn.assigns.site.id}"}
|
|
new_tab={true}
|
|
>
|
|
CS
|
|
</.styled_link>
|
|
</li>
|
|
<li
|
|
:if={ee?() and Plausible.Teams.on_trial?(@conn.assigns[:current_team])}
|
|
class="hidden sm:block"
|
|
>
|
|
<.styled_link
|
|
class="flex items-center h-[40px] px-3 py-2 text-sm text-yellow-700 hover:text-yellow-800 dark:text-yellow-500 dark:hover:text-yellow-500 font-medium rounded-md bg-yellow-100 dark:bg-yellow-800/40 dark:hover:bg-yellow-800/50 transition-colors duration-150"
|
|
href={Routes.settings_path(@conn, :subscription)}
|
|
>
|
|
{trial_notification(@conn.assigns[:current_team])}
|
|
</.styled_link>
|
|
</li>
|
|
<li class="w-full sm:w-auto">
|
|
<.dropdown>
|
|
<:button class="flex items-center gap-2 pl-3 pr-1.5 py-2 rounded-md transition-colors duration-150 hover:bg-gray-100 dark:hover:bg-gray-800">
|
|
<span class="hidden md:block text-sm font-medium truncate dark:text-gray-100">
|
|
{@conn.assigns[:current_user].name}
|
|
</span>
|
|
<img
|
|
src={Plausible.Auth.User.profile_img_url(@conn.assigns[:current_user])}
|
|
class="-my-0.5 w-7 rounded-full"
|
|
/>
|
|
</:button>
|
|
<:menu>
|
|
<.dropdown_item>
|
|
<div class="text-xs text-gray-500 dark:text-gray-400">Signed in as</div>
|
|
<p class="truncate font-medium text-gray-900 dark:text-gray-100" role="none">
|
|
{@conn.assigns[:current_user].email}
|
|
</p>
|
|
</.dropdown_item>
|
|
<.team_switcher
|
|
conn={@conn}
|
|
teams={@teams}
|
|
my_team={@my_team}
|
|
current_team={@current_team}
|
|
more_teams?={@more_teams?}
|
|
/>
|
|
<.dropdown_divider />
|
|
<.dropdown_item href={Routes.settings_path(@conn, :index)}>
|
|
Account Settings
|
|
</.dropdown_item>
|
|
|
|
<div :if={@my_team && @my_team.id == @current_team.id}>
|
|
<.dropdown_item class="flex" href={Routes.team_setup_path(@conn, :setup)}>
|
|
<span data-test="create-a-team-cta" class="flex-1">
|
|
Create a Team
|
|
</span>
|
|
</.dropdown_item>
|
|
<.dropdown_divider />
|
|
</div>
|
|
|
|
<div :if={Plausible.Teams.setup?(@current_team)}>
|
|
<.dropdown_item
|
|
class="flex"
|
|
href={Routes.settings_path(@conn, :team_general)}
|
|
>
|
|
<span class="flex-1">
|
|
Team Settings
|
|
</span>
|
|
</.dropdown_item>
|
|
<.dropdown_divider />
|
|
</div>
|
|
<.dropdown_item
|
|
class="!flex justify-between gap-x-12"
|
|
new_tab
|
|
href="https://plausible.io/docs"
|
|
>
|
|
Help Center
|
|
</.dropdown_item>
|
|
<.dropdown_item
|
|
:if={ee?()}
|
|
class="!flex justify-between gap-x-12"
|
|
new_tab
|
|
href="https://plausible.io/contact"
|
|
>
|
|
Contact Support
|
|
</.dropdown_item>
|
|
<.dropdown_item
|
|
:if={ee?()}
|
|
class="!flex justify-between gap-x-12"
|
|
new_tab
|
|
href={feedback_link(@conn.assigns[:current_user])}
|
|
>
|
|
Feature Requests
|
|
</.dropdown_item>
|
|
<.dropdown_item
|
|
:if={ce?()}
|
|
class="!flex justify-between gap-x-12"
|
|
new_tab
|
|
href="https://github.com/plausible/analytics"
|
|
>
|
|
Github Repo
|
|
</.dropdown_item>
|
|
<.dropdown_item href="/logout">Log Out</.dropdown_item>
|
|
</:menu>
|
|
</.dropdown>
|
|
</li>
|
|
<%= if @conn.assigns[:current_user] && ee?() do %>
|
|
<li id="changelog-notification" class="relative py-2"></li>
|
|
<% end %>
|
|
</ul>
|
|
<% Keyword.fetch!(Application.get_env(:plausible, :selfhost), :disable_registration) != false -> %>
|
|
<ul class="flex" x-show="!document.cookie.includes('logged_in=true')">
|
|
<li>
|
|
<div class="inline-flex">
|
|
<a
|
|
href="/login"
|
|
class="font-medium text-gray-500 dark:text-gray-200 hover:text-gray-900 focus:outline-hidden focus:text-gray-900 transition duration-150 ease-in-out"
|
|
>
|
|
Login
|
|
</a>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<% true -> %>
|
|
<ul class="flex" x-show="!document.cookie.includes('logged_in=true')">
|
|
<li>
|
|
<div class="inline-flex">
|
|
<a
|
|
href="/login"
|
|
class="font-medium text-gray-500 dark:text-gray-200 hover:text-gray-900 focus:outline-hidden focus:text-gray-900 transition duration-150 ease-in-out"
|
|
>
|
|
Login
|
|
</a>
|
|
</div>
|
|
<div class="inline-flex ml-6 rounded-sm shadow-sm">
|
|
<a
|
|
href="/register"
|
|
class="inline-flex items-center justify-center px-5 py-2 text-base font-medium text-white bg-indigo-600 border border-transparent leading-6 rounded-md hover:bg-indigo-500 focus:outline-hidden focus:ring transition duration-150 ease-in-out"
|
|
>
|
|
Sign up
|
|
</a>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<% end %>
|
|
</div>
|
|
</nav>
|
|
</div>
|
|
</nav>
|