fixin.me/app/views/layouts/application.html.erb

54 lines
2.0 KiB
Plaintext

<!DOCTYPE html>
<!-- Hide content until Turbo is loaded completely. There exist (mostly
unnoticeable) delay after a page is shown and before Turbo has started to
service frame/stream requests. If user (or more probably: system test) clicks
link during this period, request will be sent outside of Turbo, resulting in
e.g. stream request sent as HTML instead of TURBO_STREAM.
Content is shown on 'turbo:load' event. -->
<html style="visibility: hidden;">
<head>
<title>fixin.me</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= stylesheet_link_tag "application" %>
<%= javascript_importmap_tags %>
<%# TODO: replace with: turbo_page_requires_reload_tag when available %>
<%#= tag.meta(name: "turbo-visit-control", content: "reload") %>
<%# TODO: replace with: turbo_exempts_page_from_cache_tag when available %>
<%= tag.meta(name: "turbo-cache-control", content: "no-cache") %>
</head>
<body>
<header class="header">
<% if user_signed_in? %>
<%= image_link_to current_user.email, "account-wrench-outline",
edit_user_registration_path, current: :hide %>
<% if current_user_disguised? %>
<%= image_button_to t(".revert"), "incognito-off", revert_users_path %>
<% else %>
<%= image_button_to t(".sign_out"), "logout", destroy_user_session_path,
method: :delete %>
<% end %>
<% else %>
<%= image_link_to t(:sign_in), "login", new_user_session_path, current: :hide %>
<%= image_link_to t(:register), "account-plus-outline", new_user_registration_path,
current: :hide %>
<% end %>
</header>
<div id="flashes">
<%= render_flash_messages %>
</div>
<%# Allow overwriting/clearing navigation menu for some views %>
<nav class="navigation">
<%= content_for(:navigation) || (navigation_menu if user_signed_in?) %>
</nav>
<%= yield %>
</body>
</html>