|
|
|
@ -3,7 +3,8 @@ defmodule DecentralisedBookIndexWeb.Components.MyPartials.Navbar do
|
|
|
|
|
use DecentralisedBookIndexWeb, :verified_routes
|
|
|
|
|
alias Phoenix.LiveView.JS
|
|
|
|
|
|
|
|
|
|
attr(:page_title, :string, required: true)
|
|
|
|
|
attr :page_title, :string, required: true
|
|
|
|
|
attr :current_user, :map, default: nil
|
|
|
|
|
|
|
|
|
|
def partial_navbar(assigns) do
|
|
|
|
|
~H"""
|
|
|
|
@ -32,6 +33,14 @@ defmodule DecentralisedBookIndexWeb.Components.MyPartials.Navbar do
|
|
|
|
|
<li>
|
|
|
|
|
<a href={~p"/authors/"} class={selected_navbar_link_css(@page_title, "Listing Authors")} aria-current="page">Authors</a>
|
|
|
|
|
</li>
|
|
|
|
|
<%= if @current_user != nil do %>
|
|
|
|
|
<li>
|
|
|
|
|
<a href={~p"/publishers/"} class={selected_navbar_link_css(@page_title, "Listing Publishers")} aria-current="page">Publishers</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<a href={~p"/servers/"} class={selected_navbar_link_css(@page_title, "Listing Server")} aria-current="page">Servers</a>
|
|
|
|
|
</li>
|
|
|
|
|
<% end %>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|