mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 15:50:36 -05:00
Locked flight readings look locked
The tach and Hobbs fields of an earlier flight were disabled but looked like any other field. Disabled fields now look it everywhere (grey, muted text, a not-allowed cursor), and the flight form marks its locked readings "Locked". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d8cd462194
commit
3e5d896662
4 files changed
+5
-3
No files matched your search
@@ -26,7 +26,7 @@
|
||||
@utility card-body { @apply p-4; }
|
||||
|
||||
@utility label { @apply block text-sm font-medium text-slate-700 mb-1; }
|
||||
@utility input { @apply block w-full rounded-md border-0 px-2.5 py-1.5 text-sm text-slate-900 shadow-sm ring-1 ring-slate-300 ring-inset placeholder:text-slate-400 focus:ring-2 focus:ring-sky-600 focus:outline-none bg-surface; }
|
||||
@utility input { @apply block w-full rounded-md border-0 px-2.5 py-1.5 text-sm text-slate-900 shadow-sm ring-1 ring-slate-300 ring-inset placeholder:text-slate-400 focus:ring-2 focus:ring-sky-600 focus:outline-none bg-surface disabled:cursor-not-allowed disabled:bg-slate-100 disabled:text-slate-500 disabled:shadow-none disabled:ring-slate-200; }
|
||||
@utility hint { @apply mt-1 text-xs text-slate-500; }
|
||||
@utility field-error { @apply mt-1 text-xs text-red-600; }
|
||||
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
<p class="hint"><%= t("flight_logs.fields.meters_locked_html", link: link_to(t("flight_logs.fields.update_hours"), aircraft_path(@aircraft), class: "link")) %></p>
|
||||
<% end %>
|
||||
<%= tag.fieldset class: "grid gap-4 sm:grid-cols-3", disabled: meters_locked do %>
|
||||
<legend class="mb-2 text-sm font-semibold"><%= t("flight_logs.new.tach_required") %></legend>
|
||||
<legend class="mb-2 text-sm font-semibold"><%= t("flight_logs.new.tach_required") %><% if meters_locked %> <span class="badge-gray ml-1"><%= t("flight_logs.fields.locked") %></span><% end %></legend>
|
||||
<%= f.field :tach_out, as: :number, step: 0.1, label: t("flight_logs.new.tach_out") %>
|
||||
<%= f.field :tach_in, as: :number, step: 0.1, label: t("flight_logs.new.tach_in") %>
|
||||
<%= f.field :tach_time, as: :number, step: 0.1, label: t("flight_logs.new.or_duration"), hint: t("flight_logs.new.calculated_from_out_in_if") %>
|
||||
<% end %>
|
||||
<%= tag.fieldset class: "grid gap-4 sm:grid-cols-3", disabled: meters_locked do %>
|
||||
<legend class="mb-2 text-sm font-semibold"><%= t("flight_logs.new.hobbs_optional") %></legend>
|
||||
<legend class="mb-2 text-sm font-semibold"><%= t("flight_logs.new.hobbs_optional") %><% if meters_locked %> <span class="badge-gray ml-1"><%= t("flight_logs.fields.locked") %></span><% end %></legend>
|
||||
<%= f.field :hobbs_out, as: :number, step: 0.1, label: t("flight_logs.new.hobbs_out") %>
|
||||
<%= f.field :hobbs_in, as: :number, step: 0.1, label: t("flight_logs.new.hobbs_in") %>
|
||||
<%= f.field :hobbs_time, as: :number, step: 0.1, label: t("flight_logs.new.or_duration") %>
|
||||
|
||||
@@ -2386,6 +2386,7 @@ en:
|
||||
fields:
|
||||
meters_locked_html: The readings can be corrected only on the latest flight, before the hours change again. To correct the hours, use %{link} on the Overview.
|
||||
update_hours: Update Hours
|
||||
locked: Locked
|
||||
days:
|
||||
gps_track_attached: GPS track attached
|
||||
engine_data_attached: Engine data attached
|
||||
|
||||
@@ -45,6 +45,7 @@ class FlightEditTest < ActionDispatch::IntegrationTest
|
||||
|
||||
get edit_aircraft_flight_log_path(@a, first)
|
||||
assert_select "fieldset[disabled]", 2
|
||||
assert_select "fieldset[disabled] legend .badge-gray", text: "Locked", count: 2
|
||||
assert_select ".hint a[href=?]", aircraft_path(@a), text: "Update Hours"
|
||||
|
||||
patch aircraft_flight_log_path(@a, first), params: { flight_log: { tach_in: 1009, tach_time: 9, destination_location: "kbos" } }
|
||||
|
||||
Reference in new issue
Block a user