Soc/app/views/layouts/application.html.erb

37 lines
1.0 KiB
Plaintext

<!DOCTYPE html>
<html>
<head>
<title><%= @title.present? ? "#{@title} | #{t('site_title')}" : t("site_title") %></title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= javascript_importmap_tags %>
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
</head>
<body>
<header>
<%= link_to root_path do %>
<h1><%= t("site_title") %></h1>
<% end %>
<nav>
<ul>
<% if logged_in? %>
<li><%= link_to t("home"), root_path %></li>
<li><%= link_to t("profile"), user_path(current_user) %></li>
<li><%= link_to t("log_out"), log_out_path, data: { turbo_method: :delete } %></li>
<% else %>
<li><%= link_to t("log_in"), new_session_path %></li>
<li><%= link_to t("register"), new_user_path %></li>
<% end %>
</ul>
</nav>
</header>
<main>
<%= render "shared/flash" %>
<%= yield %>
</main>
</body>
</html>