-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dennis Deli
authored and
Dennis Deli
committed
Dec 16, 2024
1 parent
3846b36
commit 71dd64e
Showing
7 changed files
with
101 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
|
||
<% if @aud.comment.blank? %> | ||
$("#history_log_error").text("Note is blank. Please fill it in.").removeClass("hide"); | ||
$("#item_history_popup_<%= @aud.associated_id %> #history_log_error").text("Note is blank. Please fill it in.").removeClass("hide"); | ||
|
||
|
||
<% elsif @aud.comment.length > 255 %> | ||
$("#history_log_error").text("Note is more than 255 characters!").removeClass("hide"); | ||
$("#item_history_popup_<%= @aud.associated_id %> #history_log_error").text("Note is blank. Please fill it in.").removeClass("hide"); | ||
<% else %> | ||
$("#history_log_error").addClass("hide"); | ||
$('#history_popup form').trigger("reset"); | ||
$("#item_history_popup_<%= @aud.associated_id %> #note-textarea").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 --> | ||
|
||
var url = $("#request_history_log").data("url"); | ||
$( "#request_history_log" ).load( url); | ||
var url = $("#request_history_log_<%= @aud.associated_id %>").data("url"); <!-- Get the URL for the specific item --> | ||
$("#request_history_log_<%= @aud.associated_id %>").load(url); <!-- Load the data for the specific item --> | ||
|
||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<% if can?(:add_note, @request) %> | ||
|
||
<div class="modal fade" id="item_history_popup_<%= item.id %>" tabindex="-1" role="dialog"> | ||
<div class="modal-dialog"> | ||
<div class="modal-content"> | ||
|
||
<div class="modal-header"> | ||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | ||
<h4 class="modal-title" id="myModalLabel">Item History</h4> | ||
</div> | ||
|
||
<div class="modal-body"> | ||
|
||
<div class="panel panel-default"> | ||
<div class="panel-heading"> | ||
Add a note | ||
</div> | ||
<div class="panel-body"> | ||
<%= render partial: 'request_history/form', locals: { remote: true, item_id: item.id } %> | ||
</div> | ||
</div> | ||
|
||
<div id="request_history_log_<%= item.id %>" data-url="<%= item_history_request_path(@request, item_id: item.id, format: "js") %>"></div> | ||
|
||
</div> | ||
|
||
</div> | ||
|
||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters