diff --git a/lib/decentralised_book_index_web/components/my_partials/footer.ex b/lib/decentralised_book_index_web/components/my_partials/footer.ex index 8d353d7..040ae6f 100644 --- a/lib/decentralised_book_index_web/components/my_partials/footer.ex +++ b/lib/decentralised_book_index_web/components/my_partials/footer.ex @@ -6,7 +6,9 @@ defmodule DecentralisedBookIndexWeb.Components.MyPartials.Footer do """ diff --git a/lib/decentralised_book_index_web/components/my_partials/navbar.ex b/lib/decentralised_book_index_web/components/my_partials/navbar.ex index 0f808e6..3eea901 100644 --- a/lib/decentralised_book_index_web/components/my_partials/navbar.ex +++ b/lib/decentralised_book_index_web/components/my_partials/navbar.ex @@ -12,48 +12,125 @@ defmodule DecentralisedBookIndexWeb.Components.MyPartials.Navbar do def partial_navbar(assigns) do ~H""" - - - - - + + + + + - DBI - - - <.user_info current_user={@current_user} /> - - Open main menu - - - - - - - - Books - - - Authors - - <%= if @current_user != nil and Role.can_moderate?(@current_user.role) do %> - - Publishers - - <% end %> - <%= if @current_user != nil and Role.can_administrate?(@current_user.role) do %> - - Servers - - <% end %> - <%= if @current_user != nil and Role.can_administrate?(@current_user.role) do %> - - Users - - <% end %> - - + DBI + + + <.user_info current_user={@current_user} /> + + Open main menu + + + + + + + + + + + + + + Books + + + + + Authors + + + <%= if @current_user != nil and Role.can_moderate?(@current_user.role) do %> + + + Publishers + + + <% end %> + <%= if @current_user != nil and Role.can_administrate?(@current_user.role) do %> + + + Servers + + + <% end %> + <%= if @current_user != nil and Role.can_administrate?(@current_user.role) do %> + + + Users + + + <% end %> + + + """ end @@ -63,27 +140,40 @@ defmodule DecentralisedBookIndexWeb.Components.MyPartials.Navbar do defp user_info(assigns) do ~H""" <%= if @current_user != nil do %> - - - Open dropdown - {@current_user.email} - - - - <%= if @current_user.role != :user do %> - - role: {@current_user.role} - - <% end %> - <.link patch={~p"/sign-out"}> - <.primary_button> - Sign Out - - - + + + Open dropdown + {@current_user.email} + + + + <%= if @current_user.role != :user do %> + + role: {@current_user.role} + + <% end %> + <.link patch={~p"/sign-out"}> + <.primary_button> + Sign Out + + + <% else %> - Sign in + + Sign in + <% end %> """ end
- role: {@current_user.role} -
+ role: {@current_user.role} +