alias CanneryWeb.Endpoint
This commit is contained in:
		| @@ -6,7 +6,7 @@ defmodule CanneryWeb.Components.Topbar do | |||||||
|   use CanneryWeb, :component |   use CanneryWeb, :component | ||||||
|  |  | ||||||
|   alias Cannery.Accounts |   alias Cannery.Accounts | ||||||
|   alias CanneryWeb.HomeLive |   alias CanneryWeb.{Endpoint, HomeLive} | ||||||
|  |  | ||||||
|   def topbar(assigns) do |   def topbar(assigns) do | ||||||
|     assigns = |     assigns = | ||||||
| @@ -17,7 +17,7 @@ defmodule CanneryWeb.Components.Topbar do | |||||||
|       <nav role="navigation"> |       <nav role="navigation"> | ||||||
|         <div class="flex flex-row justify-between items-center space-x-4"> |         <div class="flex flex-row justify-between items-center space-x-4"> | ||||||
|           <div class="flex flex-row justify-start items-center space-x-2"> |           <div class="flex flex-row justify-start items-center space-x-2"> | ||||||
|             <%= link to: Routes.live_path(CanneryWeb.Endpoint, HomeLive) do %> |             <%= link to: Routes.live_path(Endpoint, HomeLive) do %> | ||||||
|               <h1 class="leading-5 text-xl text-white hover:underline"> |               <h1 class="leading-5 text-xl text-white hover:underline"> | ||||||
|                 Cannery |                 Cannery | ||||||
|               </h1> |               </h1> | ||||||
| @@ -34,43 +34,43 @@ defmodule CanneryWeb.Components.Topbar do | |||||||
|               <li> |               <li> | ||||||
|                 <%= link(gettext("Tags"), |                 <%= link(gettext("Tags"), | ||||||
|                   class: "hover:underline", |                   class: "hover:underline", | ||||||
|                   to: Routes.tag_index_path(CanneryWeb.Endpoint, :index) |                   to: Routes.tag_index_path(Endpoint, :index) | ||||||
|                 ) %> |                 ) %> | ||||||
|               </li> |               </li> | ||||||
|               <li> |               <li> | ||||||
|                 <%= link(gettext("Containers"), |                 <%= link(gettext("Containers"), | ||||||
|                   class: "hover:underline", |                   class: "hover:underline", | ||||||
|                   to: Routes.container_index_path(CanneryWeb.Endpoint, :index) |                   to: Routes.container_index_path(Endpoint, :index) | ||||||
|                 ) %> |                 ) %> | ||||||
|               </li> |               </li> | ||||||
|               <li> |               <li> | ||||||
|                 <%= link(gettext("Ammo"), |                 <%= link(gettext("Ammo"), | ||||||
|                   class: "hover:underline", |                   class: "hover:underline", | ||||||
|                   to: Routes.ammo_type_index_path(CanneryWeb.Endpoint, :index) |                   to: Routes.ammo_type_index_path(Endpoint, :index) | ||||||
|                 ) %> |                 ) %> | ||||||
|               </li> |               </li> | ||||||
|               <li> |               <li> | ||||||
|                 <%= link(gettext("Manage"), |                 <%= link(gettext("Manage"), | ||||||
|                   class: "hover:underline", |                   class: "hover:underline", | ||||||
|                   to: Routes.ammo_group_index_path(CanneryWeb.Endpoint, :index) |                   to: Routes.ammo_group_index_path(Endpoint, :index) | ||||||
|                 ) %> |                 ) %> | ||||||
|               </li> |               </li> | ||||||
|               <%= if @current_user.role == :admin do %> |               <%= if @current_user.role == :admin do %> | ||||||
|                 <li> |                 <li> | ||||||
|                   <%= link(gettext("Invites"), |                   <%= link(gettext("Invites"), | ||||||
|                     class: "hover:underline", |                     class: "hover:underline", | ||||||
|                     to: Routes.invite_index_path(CanneryWeb.Endpoint, :index) |                     to: Routes.invite_index_path(Endpoint, :index) | ||||||
|                   ) %> |                   ) %> | ||||||
|                 </li> |                 </li> | ||||||
|               <% end %> |               <% end %> | ||||||
|               <li> |               <li> | ||||||
|                 <%= link(@current_user.email, |                 <%= link(@current_user.email, | ||||||
|                   class: "hover:underline truncate", |                   class: "hover:underline truncate", | ||||||
|                   to: Routes.user_settings_path(CanneryWeb.Endpoint, :edit) |                   to: Routes.user_settings_path(Endpoint, :edit) | ||||||
|                 ) %> |                 ) %> | ||||||
|               </li> |               </li> | ||||||
|               <li> |               <li> | ||||||
|                 <%= link to: Routes.user_session_path(CanneryWeb.Endpoint, :delete), |                 <%= link to: Routes.user_session_path(Endpoint, :delete), | ||||||
|                      method: :delete, |                      method: :delete, | ||||||
|                      data: [confirm: dgettext("prompts", "Are you sure you want to log out?")] do %> |                      data: [confirm: dgettext("prompts", "Are you sure you want to log out?")] do %> | ||||||
|                   <i class="fas fa-sign-out-alt"></i> |                   <i class="fas fa-sign-out-alt"></i> | ||||||
| @@ -78,7 +78,7 @@ defmodule CanneryWeb.Components.Topbar do | |||||||
|               </li> |               </li> | ||||||
|               <%= if @current_user.role == :admin and function_exported?(Routes, :live_dashboard_path, 2) do %> |               <%= if @current_user.role == :admin and function_exported?(Routes, :live_dashboard_path, 2) do %> | ||||||
|                 <li> |                 <li> | ||||||
|                   <%= link to: Routes.live_dashboard_path(CanneryWeb.Endpoint, :home) do %> |                   <%= link to: Routes.live_dashboard_path(Endpoint, :home) do %> | ||||||
|                     <i class="fas fa-tachometer-alt"></i> |                     <i class="fas fa-tachometer-alt"></i> | ||||||
|                   <% end %> |                   <% end %> | ||||||
|                 </li> |                 </li> | ||||||
| @@ -88,14 +88,14 @@ defmodule CanneryWeb.Components.Topbar do | |||||||
|                 <li> |                 <li> | ||||||
|                   <%= link(dgettext("actions", "Register"), |                   <%= link(dgettext("actions", "Register"), | ||||||
|                     class: "hover:underline", |                     class: "hover:underline", | ||||||
|                     to: Routes.user_registration_path(CanneryWeb.Endpoint, :new) |                     to: Routes.user_registration_path(Endpoint, :new) | ||||||
|                   ) %> |                   ) %> | ||||||
|                 </li> |                 </li> | ||||||
|               <% end %> |               <% end %> | ||||||
|               <li> |               <li> | ||||||
|                 <%= link(dgettext("actions", "Log in"), |                 <%= link(dgettext("actions", "Log in"), | ||||||
|                   class: "hover:underline", |                   class: "hover:underline", | ||||||
|                   to: Routes.user_session_path(CanneryWeb.Endpoint, :new) |                   to: Routes.user_session_path(Endpoint, :new) | ||||||
|                 ) %> |                 ) %> | ||||||
|               </li> |               </li> | ||||||
|             <% end %> |             <% end %> | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| <nav role="navigation"> | <nav role="navigation"> | ||||||
|   <div class="flex flex-row justify-between items-center space-x-4 overflow-x-hidden"> |   <div class="flex flex-row justify-between items-center space-x-4 overflow-x-hidden"> | ||||||
|     <%= link to: Routes.live_path(CanneryWeb.Endpoint, HomeLive) do %> |     <%= link to: Routes.live_path(Endpoint, HomeLive) do %> | ||||||
|       <h1 class="leading-5 text-xl text-white hover:underline"> |       <h1 class="leading-5 text-xl text-white hover:underline"> | ||||||
|         Cannery |         Cannery | ||||||
|       </h1> |       </h1> | ||||||
| @@ -12,43 +12,43 @@ | |||||||
|         <li> |         <li> | ||||||
|           <%= link(gettext("Tags"), |           <%= link(gettext("Tags"), | ||||||
|             class: "hover:underline", |             class: "hover:underline", | ||||||
|             to: Routes.tag_index_path(CanneryWeb.Endpoint, :index) |             to: Routes.tag_index_path(Endpoint, :index) | ||||||
|           ) %> |           ) %> | ||||||
|         </li> |         </li> | ||||||
|         <li> |         <li> | ||||||
|           <%= link(gettext("Containers"), |           <%= link(gettext("Containers"), | ||||||
|             class: "hover:underline", |             class: "hover:underline", | ||||||
|             to: Routes.container_index_path(CanneryWeb.Endpoint, :index) |             to: Routes.container_index_path(Endpoint, :index) | ||||||
|           ) %> |           ) %> | ||||||
|         </li> |         </li> | ||||||
|         <li> |         <li> | ||||||
|           <%= link(gettext("Ammo"), |           <%= link(gettext("Ammo"), | ||||||
|             class: "hover:underline", |             class: "hover:underline", | ||||||
|             to: Routes.ammo_type_index_path(CanneryWeb.Endpoint, :index) |             to: Routes.ammo_type_index_path(Endpoint, :index) | ||||||
|           ) %> |           ) %> | ||||||
|         </li> |         </li> | ||||||
|         <li> |         <li> | ||||||
|           <%= link(gettext("Manage"), |           <%= link(gettext("Manage"), | ||||||
|             class: "hover:underline", |             class: "hover:underline", | ||||||
|             to: Routes.ammo_group_index_path(CanneryWeb.Endpoint, :index) |             to: Routes.ammo_group_index_path(Endpoint, :index) | ||||||
|           ) %> |           ) %> | ||||||
|         </li> |         </li> | ||||||
|         <%= if @current_user.role == :admin do %> |         <%= if @current_user.role == :admin do %> | ||||||
|           <li> |           <li> | ||||||
|             <%= link(gettext("Invites"), |             <%= link(gettext("Invites"), | ||||||
|               class: "hover:underline", |               class: "hover:underline", | ||||||
|               to: Routes.invite_index_path(CanneryWeb.Endpoint, :index) |               to: Routes.invite_index_path(Endpoint, :index) | ||||||
|             ) %> |             ) %> | ||||||
|           </li> |           </li> | ||||||
|         <% end %> |         <% end %> | ||||||
|         <li> |         <li> | ||||||
|           <%= link(@current_user.email, |           <%= link(@current_user.email, | ||||||
|             class: "hover:underline", |             class: "hover:underline", | ||||||
|             to: Routes.user_settings_path(CanneryWeb.Endpoint, :edit) |             to: Routes.user_settings_path(Endpoint, :edit) | ||||||
|           ) %> |           ) %> | ||||||
|         </li> |         </li> | ||||||
|         <li> |         <li> | ||||||
|           <%= link to: Routes.user_session_path(CanneryWeb.Endpoint, :delete), |           <%= link to: Routes.user_session_path(Endpoint, :delete), | ||||||
|                method: :delete, |                method: :delete, | ||||||
|                data: [confirm: dgettext("prompts", "Are you sure you want to log out?")] do %> |                data: [confirm: dgettext("prompts", "Are you sure you want to log out?")] do %> | ||||||
|             <i class="fas fa-sign-out-alt"></i> |             <i class="fas fa-sign-out-alt"></i> | ||||||
| @@ -56,7 +56,7 @@ | |||||||
|         </li> |         </li> | ||||||
|         <%= if @current_user.role == :admin and function_exported?(Routes, :live_dashboard_path, 2) do %> |         <%= if @current_user.role == :admin and function_exported?(Routes, :live_dashboard_path, 2) do %> | ||||||
|           <li> |           <li> | ||||||
|             <%= link to: Routes.live_dashboard_path(CanneryWeb.Endpoint, :home) do %> |             <%= link to: Routes.live_dashboard_path(Endpoint, :home) do %> | ||||||
|               <i class="fas fa-tachometer-alt"></i> |               <i class="fas fa-tachometer-alt"></i> | ||||||
|             <% end %> |             <% end %> | ||||||
|           </li> |           </li> | ||||||
| @@ -66,7 +66,7 @@ | |||||||
|           <li> |           <li> | ||||||
|             <%= link(dgettext("actions", "Register"), |             <%= link(dgettext("actions", "Register"), | ||||||
|               class: "hover:underline", |               class: "hover:underline", | ||||||
|               to: Routes.user_registration_path(CanneryWeb.Endpoint, :new) |               to: Routes.user_registration_path(Endpoint, :new) | ||||||
|             ) %> |             ) %> | ||||||
|           </li> |           </li> | ||||||
|         <% end %> |         <% end %> | ||||||
| @@ -74,7 +74,7 @@ | |||||||
|         <li> |         <li> | ||||||
|           <%= link(dgettext("actions", "Log in"), |           <%= link(dgettext("actions", "Log in"), | ||||||
|             class: "hover:underline", |             class: "hover:underline", | ||||||
|             to: Routes.user_session_path(CanneryWeb.Endpoint, :new) |             to: Routes.user_session_path(Endpoint, :new) | ||||||
|           ) %> |           ) %> | ||||||
|         </li> |         </li> | ||||||
|       <% end %> |       <% end %> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user