|
| 1 | +<div class="title-wrapper pt-30"> |
| 2 | + <div class="row align-items-center"> |
| 3 | + <div class="title mb-30"> |
| 4 | + <h1>Case Contacts</h1> |
| 5 | + </div> |
| 6 | + </div> |
| 7 | +</div> |
| 8 | + |
| 9 | +<div class="card-style mb-30"> |
| 10 | + <div class="table-wrapper"> |
| 11 | + <table |
| 12 | + id="case_contacts" |
| 13 | + class="table" |
| 14 | + data-source="<%= datatable_case_contacts_path format: :json %>"> |
| 15 | + <thead> |
| 16 | + <tr> |
| 17 | + <th data-orderable="false"></th> |
| 18 | + <th data-orderable="false"></th> |
| 19 | + <th><h6>Date</h6></th> |
| 20 | + <th><h6>Case</h6></th> |
| 21 | + <th><h6>Relationship</h6></th> |
| 22 | + <th><h6>Medium</h6></th> |
| 23 | + <th><h6>Created By</h6></th> |
| 24 | + <th><h6>Contacted</h6></th> |
| 25 | + <th><h6>Topics</h6></th> |
| 26 | + <th><h6>Draft</h6></th> |
| 27 | + <th data-orderable="false"></th> |
| 28 | + </tr> |
| 29 | + <!-- end table row--> |
| 30 | + </thead> |
| 31 | + <tbody> |
| 32 | + <% @presenter.case_contacts.each do |casa_case_id, case_contacts| %> |
| 33 | + <% case_contacts.each do |case_contact| %> |
| 34 | + <tr data-testid="case_contact-row"> |
| 35 | + <td> |
| 36 | + <i class='fas fa-bell'></i> |
| 37 | + </td> |
| 38 | + <td> |
| 39 | + <i class="fa-solid fa-chevron-down"></i> |
| 40 | + </td> |
| 41 | + <td> |
| 42 | + <%= I18n.l(case_contact[:occurred_at], format: :full) if case_contact[:occurred_at].present? %> |
| 43 | + </td> |
| 44 | + <td> |
| 45 | + <%= @presenter.display_case_number(casa_case_id) %> |
| 46 | + </td> |
| 47 | + <td> |
| 48 | + <%= case_contact.decorate.contact_types_comma_separated %> |
| 49 | + </td> |
| 50 | + <td> |
| 51 | + <%= case_contact.medium_type&.capitalize %> |
| 52 | + </td> |
| 53 | + <td> |
| 54 | + <% if policy(case_contact).edit? %> |
| 55 | + <% if current_user.volunteer? %> |
| 56 | + <%= case_contact.creator&.display_name %> |
| 57 | + <% else %> |
| 58 | + <% if case_contact.creator&.supervisor? %> |
| 59 | + <%= link_to case_contact.creator&.display_name, edit_supervisor_path(case_contact.creator), data: { turbo: false } %> |
| 60 | + <% elsif case_contact.creator&.casa_admin? %> |
| 61 | + <%= link_to case_contact.creator&.display_name, edit_users_path, data: { turbo: false } %> |
| 62 | + <% else %> |
| 63 | + <%= link_to case_contact.creator&.display_name, edit_volunteer_path(case_contact.creator), data: { turbo: false } %> |
| 64 | + <% end %> |
| 65 | + <% end %> |
| 66 | + <% else %> |
| 67 | + <%= case_contact.creator&.display_name %> |
| 68 | + <% end %> |
| 69 | + </td> |
| 70 | + <td> |
| 71 | + <% if case_contact.contact_made %> |
| 72 | + <i class="lni lni-checkmark-circle" style="color: green;"></i> |
| 73 | + <% else %> |
| 74 | + <i class="lni lni-cross-circle" style="color: orange;"></i> |
| 75 | + <% end %> |
| 76 | + <%= "(#{"%02d:%02d" % [case_contact.duration_minutes / 60, case_contact.duration_minutes % 60]})" if case_contact.duration_minutes %> |
| 77 | + </td> |
| 78 | + <td> |
| 79 | + <%= case_contact.contact_topics.map(&:question).join(" | ") %> |
| 80 | + </td> |
| 81 | + <td> |
| 82 | + <% if !case_contact.active? %> |
| 83 | + <span class="badge badge-pill light-bg text-black" data-testid="draft-badge"> |
| 84 | + Draft |
| 85 | + </span> |
| 86 | + <% end %> |
| 87 | + </td> |
| 88 | + <td> |
| 89 | + <i class="fas fa-ellipsis-v"></i> |
| 90 | + </td> |
| 91 | + </tr> |
| 92 | + <% end %> |
| 93 | + <% end %> |
| 94 | + </tbody> |
| 95 | + </table> |
| 96 | + <!-- end table --> |
| 97 | + </div> |
| 98 | +</div> |
0 commit comments