count-anything/app/views/layouts/application.html.erb
Louis Vallat a56a2854a4
feat: added navbar links
Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
2023-02-04 14:38:27 +01:00

50 lines
1.7 KiB
Plaintext

<!DOCTYPE html>
<html lang="fr">
<head>
<title>CountAnything</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
<%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>
</head>
<body>
<header class="p-3 text-bg-dark">
<div class="container">
<div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
<ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">
<li><%= link_to t("fields.home"), root_path, class: "nav-link px-2 #{current_page?(root_path) ? "text-secondary" : "text-white"}" %></li>
<% if current_user %>
<li><%= link_to t("fields.count"), count_root_path, class: "nav-link px-2 #{current_page?(count_root_path) ? "text-secondary" : "text-white"}" %></li>
<li><%= link_to t("fields.profile"), profile_root_path, class: "nav-link px-2 #{current_page?(profile_root_path) ? "text-secondary" : "text-white"}" %></li>
<% end %>
</ul>
<div class="nav text-end">
<% if current_user %>
<a class="nav-link disabled"><%= current_user.email %></a>
<%= button_to t("fields.logout"), destroy_user_session_path, method: "delete", class: "btn btn-danger me-2" %>
<% else %>
<%= link_to t("fields.login"), new_user_session_path, class: "btn btn-outline-light me-2" %>
<% end %>
</div>
</div>
</div>
</header>
<div class="container">
<% if notice %>
<p class="notice"><%= notice %></p>
<% end %>
<% if alert %>
<p class="alert"><%= alert %></p>
<% end %>
<%= yield %>
</div>
</body>
</html>