docbrown/app/views/admin/users/show/reports/_index.html.erb
Ridhwana 32abc2160e
Update the directory structure for Admin Member View (#16608)
* feat: update the directory structure for partial

* feat: update the current tab
2022-02-17 14:37:17 +02:00

34 lines
1.7 KiB
Text

<h2 class="crayons-subtitle-1">Reports submitted by @<%= @user.username %> (<%= @related_reports.count %>)</h2>
<% unless @related_reports.empty? %>
<div class="pt-3">
<% @related_reports.each do |report| %>
<article class="c-list-item c-list-item--interactive flex justify-between gap-4">
<div class="w-100">
<header>
<h3 class="crayons-subtitle-3 w-100 flex items-center justify-between">
<span class="flex gap-3">
<a href="<%= admin_report_path(report.id) %>" class="c-link">
<%= report.category.capitalize %>
</a>
<span class="c-indicator c-indicator--relaxed <%= "c-indicator--danger" if report.status.casecmp("open").zero? %> <%= "c-indicator--success" if report.status.casecmp("resolved").zero? %>">
<%= report.status %>
</span>
</span>
<time datetime="<%= report.created_at&.strftime("%Y-%m-%dT%H:%M:%S%z") %>" class="color-secondary fs-s shrink-0 fw-normal" title="<%= report.created_at&.strftime("%Y-%m-%d, %H:%M") %>">
<%= report.created_at&.strftime("%b %e '%y") %>
</time>
</h3>
</header>
<p class="mb-1"><%= report.message %></p>
<p class="fs-s color-secondary">For <a href="<%= report.reported_url %>" class="c-link" target="_blank" rel="noopener"><%= report.reported_url %></a></p>
</div>
</article>
<% end %>
</div>
<% else %>
<div class="align-center flex flex-col justify-center my-auto py-8">
<h3 class="fs-xl fw-normal mb-2">🧐 No reports submitted.</h3>
<p class="color-secondary">This user hasn't reported anything yet.</p>
</div>
<% end %>