count-anything/app/views/layouts/application.html.erb

55 lines
1.8 KiB
Plaintext
Raw Normal View History

<!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_index_path, class: "nav-link px-2 #{current_page?(count_index_path) ? "text-secondary" : "text-white"}" %></li>
<li><%= link_to t("fields.profile"), profile_path, class: "nav-link px-2 #{current_page?(profile_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 %>
<div class="alert alert-primary" role="alert">
<%= notice %>
</div>
<% end %>
<% if alert %>
<div class="alert alert-danger" role="alert">
<%= alert %>
</div>
<% end %>
<%= yield %>
</div>
</body>
</html>