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

65 lines
1.8 KiB
Text

<div class="container">
<%= nav_breadcrumb(
[translate(:staff_services), staff_root_path],
[Person.model_name.human(count: 0), staff_people_path],
@person.full_name,
) %>
<%= 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_enum :person_comment_origin, 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 %>
<%= f.input :text %>
<%= f.input :attachment, direct_upload: true %>
<%= f.button :submit %>
<% end %>
</div>
</div>