fix notes typo + correctly add event listener to correct buttons (#20459)
This commit is contained in:
parent
59ee1461a4
commit
199a88a254
2 changed files with 8 additions and 8 deletions
|
|
@ -37,7 +37,7 @@ module Admin
|
||||||
def show
|
def show
|
||||||
@feedback_message = FeedbackMessage.find_by(id: params[:id])
|
@feedback_message = FeedbackMessage.find_by(id: params[:id])
|
||||||
@email_messages = EmailMessage.find_for_reports(@feedback_message.id)
|
@email_messages = EmailMessage.find_for_reports(@feedback_message.id)
|
||||||
@notes = Note.find_for_reports(@feedback_messages)
|
@notes = Note.find_for_reports(@feedback_message)
|
||||||
end
|
end
|
||||||
|
|
||||||
def send_email
|
def send_email
|
||||||
|
|
|
||||||
|
|
@ -97,18 +97,18 @@
|
||||||
<% case feedback_message.status %>
|
<% case feedback_message.status %>
|
||||||
<% when 'Open' %>
|
<% when 'Open' %>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<%= button_tag "✅ Resolved", type: "button", data: { status: "Resolved", id: feedback_message.id }, class: "c-btn c-btn--primary block mt-3 mr-2" %>
|
<%= button_tag "✅ Resolved", type: "button", data: { status: "Resolved", id: feedback_message.id }, class: "c-btn c-btn--primary block mt-3 mr-2 status-button" %>
|
||||||
<%= button_tag "❌ Invalid", type: "button", data: { status: "Invalid", id: feedback_message.id }, class: "c-btn c-btn--primary block mt-3" %>
|
<%= button_tag "❌ Invalid", type: "button", data: { status: "Invalid", id: feedback_message.id }, class: "c-btn c-btn--primary block mt-3 status-button" %>
|
||||||
</div>
|
</div>
|
||||||
<% when 'Invalid' %>
|
<% when 'Invalid' %>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<%= button_tag "❔ Open", type: "button", data: { status: "Open", id: feedback_message.id }, class: "c-btn c-btn--primary block mt-3 mr-2" %>
|
<%= button_tag "❔ Open", type: "button", data: { status: "Open", id: feedback_message.id }, class: "c-btn c-btn--primary block mt-3 mr-2 status-button" %>
|
||||||
<%= button_tag "✅ Resolved", type: "button", data: { status: "Resolved", id: feedback_message.id }, class: "c-btn c-btn--primary block mt-3" %>
|
<%= button_tag "✅ Resolved", type: "button", data: { status: "Resolved", id: feedback_message.id }, class: "c-btn c-btn--primary block mt-3 status-button" %>
|
||||||
</div>
|
</div>
|
||||||
<% when 'Resolved' %>
|
<% when 'Resolved' %>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<%= button_tag "❔Open", type: "button", data: { status: "Open", id: feedback_message.id }, class: "c-btn c-btn--primary block mt-3 mr-2" %>
|
<%= button_tag "❔Open", type: "button", data: { status: "Open", id: feedback_message.id }, class: "c-btn c-btn--primary block mt-3 mr-2 status-button" %>
|
||||||
<%= button_tag "❌ Invalid", type: "button", data: { status: "Invalid", id: feedback_message.id }, class: "c-btn c-btn--primary block mt-3" %>
|
<%= button_tag "❌ Invalid", type: "button", data: { status: "Invalid", id: feedback_message.id }, class: "c-btn c-btn--primary block mt-3 status-button" %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="mt-2 fs-italic hidden" id="update_message__<%= feedback_message.id %>">You have marked this as Resolved</div>
|
<div class="mt-2 fs-italic hidden" id="update_message__<%= feedback_message.id %>">You have marked this as Resolved</div>
|
||||||
|
|
@ -286,7 +286,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('accordion-<%= feedback_message.id %>').addEventListener('click', function(event) {
|
document.getElementById('accordion-<%= feedback_message.id %>').addEventListener('click', function(event) {
|
||||||
if (event.target.classList.contains('c-btn')) {
|
if (event.target.classList.contains('status-button')) {
|
||||||
var status = event.target.dataset.status;
|
var status = event.target.dataset.status;
|
||||||
var id = event.target.dataset.id;
|
var id = event.target.dataset.id;
|
||||||
saveStatus(id, status);
|
saveStatus(id, status);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue