Files
simple-aircraft-manager-rails/app/views/layouts/application.html.erb
T
rickyandClaude Opus 5.5 21ef577653 Make the app an installable PWA with an offline page
Manifest, service worker (offline fallback, cached static assets only, no
aircraft pages), new plane icon in all PWA/Apple sizes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 09:51:04 -05:00

58 lines
2.9 KiB
ERB

<!DOCTYPE html>
<html class="h-full bg-page">
<head>
<%= render "shared/theme_script" %>
<title><%= [content_for(:title), "Simple Aircraft Manager"].compact.join(" · ") %></title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= yield :head %>
<link rel="manifest" href="/manifest.json">
<meta name="theme-color" content="#0f172a">
<meta name="apple-mobile-web-app-title" content="SAM">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="icon" href="/icon.png" type="image/png">
<link rel="icon" href="/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
<%= javascript_importmap_tags %>
</head>
<body class="min-h-full text-slate-800">
<header class="bg-header text-white">
<div class="mx-auto flex max-w-7xl items-center justify-between gap-4 px-4 py-3">
<%= link_to root_path, class: "flex items-center gap-2 font-semibold tracking-tight" do %>
<span class="text-xl">✈</span> Simple Aircraft Manager
<% end %>
<% if current_user %>
<nav class="flex items-center gap-4 text-sm">
<%= link_to "Fleet", root_path, class: "hover:text-sky-300" %>
<% if current_user.admin? %>
<details class="relative" data-controller="dropdown" data-action="click@window->dropdown#closeOutside keydown.esc@window->dropdown#close">
<summary class="flex cursor-pointer list-none items-center gap-1 hover:text-sky-300 [&::-webkit-details-marker]:hidden">
Admin <span aria-hidden="true" class="text-xs">▾</span>
</summary>
<div class="absolute right-0 z-30 mt-2 w-48 rounded-md bg-surface py-1 text-slate-700 shadow-lg ring-1 ring-slate-200">
<% [ [ "Users", admin_users_path ], [ "Component Types", admin_component_types_path ], [ "Airports", admin_airports_path ] ].each do |label, path| %>
<%= link_to label, path, class: [ "block px-4 py-2 text-sm hover:bg-slate-100", ("font-semibold text-sky-700" if current_page?(path)) ] %>
<% end %>
</div>
</details>
<% end %>
<%= link_to current_user.display_name, edit_profile_path, class: "text-white/70 hover:text-sky-300 hidden sm:inline" %>
<%= render "shared/theme_toggle" %>
<%= button_to "Sign out", session_path, method: :delete, class: "rounded bg-white/10 px-2 py-1 hover:bg-white/20" %>
</nav>
<% end %>
</div>
</header>
<main class="mx-auto max-w-7xl px-4 py-6">
<%= render "shared/flash" %>
<%= yield %>
</main>
</body>
</html>