diff --git a/app/assets/tailwind/application.css b/app/assets/tailwind/application.css index a59fc06..87e453a 100644 --- a/app/assets/tailwind/application.css +++ b/app/assets/tailwind/application.css @@ -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; } diff --git a/app/views/flight_logs/_fields.html.erb b/app/views/flight_logs/_fields.html.erb index a705148..0da5162 100644 --- a/app/views/flight_logs/_fields.html.erb +++ b/app/views/flight_logs/_fields.html.erb @@ -10,13 +10,13 @@
<%= t("flight_logs.fields.meters_locked_html", link: link_to(t("flight_logs.fields.update_hours"), aircraft_path(@aircraft), class: "link")) %>
<% end %> <%= tag.fieldset class: "grid gap-4 sm:grid-cols-3", disabled: meters_locked do %> - + <%= 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 %> - + <%= 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") %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 7176584..c44f146 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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 diff --git a/test/integration/flight_edit_test.rb b/test/integration/flight_edit_test.rb index 5f069d3..c82a054 100644 --- a/test/integration/flight_edit_test.rb +++ b/test/integration/flight_edit_test.rb @@ -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" } }