1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/app/views/staffs/people/person_comments/index.html.erb

64 lines
1.8 KiB
Text

<div class="container">
<%= render partial: 'staffs/people/nav_tabs',
locals: { person: @person, tab: :person_comments } %>
<% @person_comments&.each_with_index do |person_comment, index| %>
<% unless index.zero? %>
<hr class="my-0"/>
<% end %>
<div class="card border-light">
<div class="card-body">
<p class="card-text">
<% if person_comment.origin %>
<strong>
<%= translate person_comment.origin,
scope: %i[enums person_comment_origin] %>
</strong>
<br/>
<% end %>
<%= person_comment.text %>
<% if person_comment.attachment.attached? %>
<br/>
<small>
<i class="fas fa-paperclip"></i>
<%= link_to person_comment.attachment.blob.filename.to_s,
rails_blob_path(person_comment.attachment.blob,
disposition: 'download') %>
</small>
<% end %>
</p>
<p class="card-text">
<small class="text-muted">
<%= localize person_comment.created_at, format: :long %>
<% if person_comment.account %>
&bull;
<%= link_to person_comment.account.nickname,
person_comment.account %>
<% end %>
</small>
</p>
</div>
</div>
<% end %>
<div class="mt-2">
<%= simple_form_for [:staff, @person, @person_comment] do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.input :text %>
<%= f.input :attachment, direct_upload: true %>
</div>
<div class="form-actions">
<%= f.button :submit %>
</div>
<% end %>
</div>
</div>