-
Notifications
You must be signed in to change notification settings - Fork 433
/
reports_modal_component.html.haml
28 lines (28 loc) · 1.35 KB
/
reports_modal_component.html.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
.modal.fade{ tabindex: -1, id: "reports-modal-#{reportable_name}-#{reportable.id}" }
.modal-dialog
.modal-content
.modal-header
%h5.modal-title Reports
%button.btn-close{ type: 'button', 'data-bs-dismiss': 'modal', 'aria-label': 'Close' }
.modal-body
- reports.each do |report|
.info
= render UserAvatarComponent.new(report.user.login)
reported
= render TimeComponent.new(time: report.created_at)
.ms-4
= report.reason
- if policy(Decision.new).create?
= form_for(:decision, url: decisions_path, method: :post) do |form|
.modal-body{ 'data-canned-controller': '' }
%h5 Decision
.d-flex.align-items-center.justify-content-between.mb-1
= form.label(:reason)
-# Decision-related canned responses exclusively:
= render CannedResponsesDropdownComponent.new(canned_responses)
= form.text_area(:reason, class: 'form-control mb-3', required: true, placeholder: 'Reason for the decision')
= form.select(:type, Decision.types(reportable), {}, class: 'form-select')
.modal-footer
- reports.each do |report|
= form.hidden_field(:report_ids, multiple: true, value: report.id)
= submit_tag('Submit', class: 'btn btn-primary')