From f70d14ebb69d22c8c2c1312d8b0823f53dfbe570 Mon Sep 17 00:00:00 2001 From: Dennis Deli Date: Tue, 17 Dec 2024 10:44:22 -0500 Subject: [PATCH] made fix for disabled dates and reset note field --- app/views/request_history/create.js.erb | 2 +- app/views/requests/_form_fields.html.erb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/request_history/create.js.erb b/app/views/request_history/create.js.erb index 84eda17..4591c3a 100644 --- a/app/views/request_history/create.js.erb +++ b/app/views/request_history/create.js.erb @@ -6,7 +6,7 @@ <% elsif @aud.comment.length > 255 %> $("#item_history_popup_<%= @aud.associated_id %> #history_log_error").text("Note is blank. Please fill it in.").removeClass("hide"); <% else %> - $("#item_history_popup_<%= @aud.associated_id %> #note-textarea").val(""); + $("#note-textarea_<%= @aud.associated_id %>").val(""); $("#item_history_popup_<%= @aud.associated_id %> #history_log_error").addClass("hide"); $('#history_popup_<%= @aud.associated_id %> form').trigger("reset"); diff --git a/app/views/requests/_form_fields.html.erb b/app/views/requests/_form_fields.html.erb index ffb6488..582abb5 100644 --- a/app/views/requests/_form_fields.html.erb +++ b/app/views/requests/_form_fields.html.erb @@ -86,11 +86,11 @@ <%= f.input :reserve_location_id, collection: Location.active, required: true, hint: "Where do you want students to pick up your items?" %>
- <%= f.input :reserve_start_date, as: :string, disabled: true, readonly: ! current_user.admin?, required: false, hint: "Prefilled after term selection.", + <%= f.input :reserve_start_date, as: :string, readonly: true, required: false, hint: "Prefilled after term selection.", input_html: { id: "request_reserve_start_date", class: current_user.admin? ? "datepicker" : "" } %>
- <%= f.input :reserve_end_date, as: :string, disabled: true, readonly: ! current_user.admin?, required: false, + <%= f.input :reserve_end_date, as: :string, readonly: true, required: false, input_html: { id: "request_reserve_end_date", class: current_user.admin? ? "datepicker" : "" } %>