tabletop-companion/app/views/layouts/application.html.erb

41 lines
1.3 KiB
Plaintext

<!DOCTYPE html>
<html>
<head>
<title><%= "#{yield(:title)} | " if content_for? :title %><%= t("site_name") %></title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= stylesheet_link_tag :all, "data-turbo-track": "reload" %>
<%= javascript_importmap_tags %>
<meta name="turbo-refresh-method" content="morph">
<meta name="turbo-refresh-scroll" content="preserve">
</head>
<body>
<header>
<h1><%= link_to t("site_name"), root_path %></h1>
<nav>
<ul>
<% if logged_in? %>
<li><%= link_to t(".tables"), tables_path %></li>
<li><%= link_to t(".profile"), user_path(Current.user) %></li>
<li><%= link_to t("log_out"), logout_path, data: {turbo_method: :delete} %></li>
<% if Current.user.admin? %>
<li><%= link_to t("administration"), admin_index_path %></li>
<% end %>
<% else %>
<li><%= link_to t("log_in"), login_path %></li>
<li><%= link_to t("sign_up"), new_user_path %></li>
<% end %>
</ul>
</nav>
</header>
<main>
<%= render partial: "shared/flash_messages" %>
<%= yield(:submenu) if content_for?(:submenu) %>
<%= yield %>
</main>
</body>
</html>