2021-03-07 08:01:46 -05:00
|
|
|
<nav class="navbar navbar-expand-lg navbar-dark bg-secondary mb-4">
|
2021-02-25 15:27:31 -05:00
|
|
|
<div class="container">
|
|
|
|
|
2021-03-03 08:15:14 -05:00
|
|
|
<h1 class="fs-4 my-0 py-0 lh-base">
|
2021-03-19 16:38:52 -04:00
|
|
|
<%= link to: "/", class: "navbar-brand fs-4" do %>
|
2022-08-13 07:32:36 -04:00
|
|
|
<i class="bi bi-calendar2-week me-1"></i>
|
2021-03-05 19:23:32 -05:00
|
|
|
<span class="fw-light">Shift73k</span>
|
2021-02-25 17:20:50 -05:00
|
|
|
<% end %>
|
2021-03-03 08:15:14 -05:00
|
|
|
</h1>
|
2021-02-25 15:27:31 -05:00
|
|
|
|
2022-08-14 09:14:42 -04:00
|
|
|
<%# If there's a current user,
|
|
|
|
OR if there are users & we allow registration,
|
|
|
|
THEN we will show a full menu configuration %>
|
|
|
|
|
|
|
|
<%= if @current_user || (Repo.exists?(User) && allow_registration()) do %>
|
|
|
|
|
2021-03-10 11:44:33 -05:00
|
|
|
<button class="hamburger hamburger--squeeze collapsed navbar-toggler" id="navbarSupportedContentToggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
|
|
|
<span class="hamburger-box d-flex">
|
|
|
|
<span class="hamburger-inner"></span>
|
|
|
|
</span>
|
|
|
|
</button>
|
2021-02-26 12:07:33 -05:00
|
|
|
|
2022-08-14 09:14:42 -04:00
|
|
|
|
|
|
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
2021-02-25 18:21:43 -05:00
|
|
|
|
2022-08-14 09:14:42 -04:00
|
|
|
<%# nav LEFT items %>
|
|
|
|
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
2021-03-09 20:18:56 -05:00
|
|
|
|
2022-08-14 09:14:42 -04:00
|
|
|
</ul>
|
2021-02-25 18:21:43 -05:00
|
|
|
|
|
|
|
|
2022-08-14 09:14:42 -04:00
|
|
|
<%# nav RIGHT items %>
|
|
|
|
<ul class="navbar-nav">
|
2021-02-25 18:21:43 -05:00
|
|
|
|
2022-08-14 09:14:42 -04:00
|
|
|
<%= if @current_user do %>
|
2021-02-25 18:21:43 -05:00
|
|
|
|
2022-08-14 09:14:42 -04:00
|
|
|
<%= render "navbar/_shifts_menu.html", assigns %>
|
2021-02-25 18:21:43 -05:00
|
|
|
|
2022-08-14 09:14:42 -04:00
|
|
|
<%= render "navbar/_user_menu.html", assigns %>
|
|
|
|
|
|
|
|
<% else %>
|
2021-02-25 18:21:43 -05:00
|
|
|
|
2022-08-14 09:14:42 -04:00
|
|
|
<%= render "navbar/_nouser_menu.html", assigns %>
|
2021-03-19 16:38:52 -04:00
|
|
|
|
2022-08-14 09:14:42 -04:00
|
|
|
<% end %>
|
2021-03-19 16:38:52 -04:00
|
|
|
|
2022-08-14 09:14:42 -04:00
|
|
|
</ul>
|
2021-03-19 16:38:52 -04:00
|
|
|
|
2022-08-14 09:14:42 -04:00
|
|
|
</div>
|
2021-02-25 18:21:43 -05:00
|
|
|
|
2022-08-14 09:14:42 -04:00
|
|
|
<%# If there's no current user,
|
|
|
|
AND:
|
|
|
|
There are no users -- [REGISTER]
|
|
|
|
OR no registration allowed -- [LOG IN] %>
|
|
|
|
<%= else %>
|
2021-03-19 16:38:52 -04:00
|
|
|
|
2022-08-14 09:14:42 -04:00
|
|
|
<%= if !Repo.exists?(User) || allow_registration() do %>
|
|
|
|
<%= link nav_link_opts(@conn, to: Routes.user_registration_path(@conn, :new), class: "btn btn-outline-light") do %>
|
|
|
|
<i class="bi bi-journal-plus"></i> Register
|
|
|
|
<% end %>
|
|
|
|
<% else %>
|
|
|
|
<%= link nav_link_opts(@conn, to: Routes.user_session_path(@conn, :new), class: "btn btn-outline-light") do %>
|
|
|
|
<i class="bi bi-door-open"></i> Log in
|
2021-03-11 13:30:30 -05:00
|
|
|
<% end %>
|
2022-08-14 09:14:42 -04:00
|
|
|
<% end %>
|
2021-03-11 13:30:30 -05:00
|
|
|
|
2022-08-14 09:14:42 -04:00
|
|
|
<% end %>
|
2021-02-25 18:21:43 -05:00
|
|
|
|
2021-02-25 15:27:31 -05:00
|
|
|
</div>
|
|
|
|
</nav>
|