mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 23:50:36 -05:00
Secondary actions behind More menus; tidier aircraft header and tabs
- more_menu helper (menu / menu-item styles): each section keeps its main action as a button; imports, exports, printing and tools move under More (flights, logbook, logbook entry, documents, inspections, fleet) - Aircraft header: More with status report and, for owners, access & sharing, edit, .sam.zip and records package; Access & Sharing and Oil Analysis tabs removed (oil analysis is under Oil & Fuel with a switch) - Logbook: Print selected appears once an entry is ticked; filters apply on change; dates use fmt_date (also AirTrail, notes, audits, About) - Header shows the role on the aircraft and hides the usual Available badge; no second Grounded badge on the Overview; AD DRS import listed once - Flights: stat cards 2x2 on phones; By year opens visibly, only with more than one year; duplicate + Log Flight removed - Remove unused hello_controller.js; guide and README updated Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bff6a05173
commit
3f45b557c2
38 files changed
+159
-63
No files matched your search
@@ -12,15 +12,24 @@
|
||||
</h1>
|
||||
<div class="mt-1 flex flex-wrap items-center gap-2 text-sm">
|
||||
<%= airworthiness_badge(aw) %>
|
||||
<%= aircraft_status_badge(aircraft) %>
|
||||
<%= aircraft_status_badge(aircraft) unless aircraft.status == "AVAILABLE" %>
|
||||
<span class="text-slate-500">Tach <%= hours(aircraft.tach_time) %> · Hobbs <%= hours(aircraft.hobbs_time) %></span>
|
||||
<span class="badge-gray"><%= current_role.capitalize %></span>
|
||||
<span class="badge-gray" title="Your access to this aircraft"><%= (current_user.aircraft_roles.find_by(aircraft: aircraft)&.role || current_role).capitalize %></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex w-full gap-2 sm:w-auto [&>*]:flex-1 [&>*]:justify-center [&>*]:whitespace-nowrap max-sm:[&>*]:px-2 sm:[&>*]:flex-none">
|
||||
<div class="flex w-full gap-2 sm:w-auto [&>a]:flex-1 [&>a]:justify-center [&>a]:whitespace-nowrap max-sm:[&>a]:px-2 sm:[&>a]:flex-none">
|
||||
<%= link_to "Log Flight", new_aircraft_flight_log_path(aircraft), class: "btn-primary" %>
|
||||
<%= link_to "Report Squawk", new_aircraft_squawk_path(aircraft), class: "btn-secondary" %>
|
||||
<%= more_menu do %>
|
||||
<%= link_to "Status report", aircraft_report_path(aircraft), class: "menu-item" %>
|
||||
<% if owner? %>
|
||||
<%= link_to "Access & sharing", aircraft_aircraft_roles_path(aircraft), class: "menu-item" %>
|
||||
<%= link_to "Edit aircraft", edit_aircraft_path(aircraft), class: "menu-item" %>
|
||||
<%= link_to "Download .sam.zip", aircraft_export_path(aircraft), class: "menu-item", data: { turbo: false } %>
|
||||
<%= link_to "Download records package", aircraft_records_package_path(aircraft), class: "menu-item", data: { turbo: false } %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% tabs = aircraft_tabs(aircraft) %>
|
||||
@@ -28,7 +37,7 @@
|
||||
<%# Phones: the current section, with every section a tap away. %>
|
||||
<details class="relative mb-5 md:hidden" data-controller="dropdown" data-action="click@window->dropdown#closeOutside keydown.esc@window->dropdown#close">
|
||||
<summary class="flex cursor-pointer list-none items-center justify-between rounded-md bg-surface px-4 py-3 font-medium shadow-sm ring-1 ring-slate-200 [&::-webkit-details-marker]:hidden">
|
||||
<span><span class="text-xs font-normal text-slate-500">Section</span><br><%= current_tab&.first || "Overview" %></span>
|
||||
<span><span class="text-xs font-normal text-slate-500">Section</span><br><%= current_tab&.first || "Choose a section" %></span>
|
||||
<span aria-hidden="true" class="text-slate-500">▾</span>
|
||||
</summary>
|
||||
<nav class="absolute inset-x-0 z-30 mt-2 grid grid-cols-2 gap-1 rounded-md bg-surface p-2 shadow-lg ring-1 ring-slate-200" aria-label="Aircraft sections">
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<%# Oil & Fuel tab: consumption and oil analysis are two pages under one tab. %>
|
||||
<nav class="mb-4 inline-flex rounded-md bg-surface p-1 text-sm shadow-sm ring-1 ring-slate-200" aria-label="Oil and fuel">
|
||||
<% [ [ "Consumption", aircraft_consumable_records_path(aircraft), "consumable_records" ], [ "Oil analysis", aircraft_oil_analyses_path(aircraft), "oil_analyses" ] ].each do |label, path, name| %>
|
||||
<%= link_to label, path, class: [ "rounded px-3 py-1.5", (controller_name == name ? "bg-slate-100 font-semibold text-sky-700" : "text-slate-600 hover:text-slate-900") ],
|
||||
aria: { current: (controller_name == name ? "page" : nil) } %>
|
||||
<% end %>
|
||||
</nav>
|
||||
Reference in new issue
Block a user