Skip to content

Commit

Permalink
made fix for disabled dates and reset note field
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Deli authored and Dennis Deli committed Dec 17, 2024
1 parent 6a63305 commit f70d14e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/views/request_history/create.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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"); <!-- Reset the form for the specific item -->

Expand Down
4 changes: 2 additions & 2 deletions app/views/requests/_form_fields.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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?" %>
</div>
<div class="col-sm-3">
<%= 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" : "" } %>
</div>
<div class="col-sm-3">
<%= 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" : "" } %>
</div>
</div> <!-- row end -->
Expand Down

0 comments on commit f70d14e

Please sign in to comment.