docbrown/app/views/internal/users/_notes.erb
rhymes b94dea9b70
Upgrade erb_lint to support latest Rubocop and fix violations (#9663)
* Upgrade erb_lint to support latest Rubocop and fix violations

* Wrong template name
2020-08-07 15:36:48 +02:00

28 lines
960 B
Text

<div class="row">
<div class="col-12">
<h2>Recent Notes (last 10)</h2>
<% unless @notes.load.empty? %>
<% @notes.each do |note| %>
<p>
<em>
<%= note.created_at.strftime("%d %B %Y %H:%M UTC") %> by <%= User.find(note.author_id).username if note.author_id.present? %>
</em> -
<% unless note.reason.blank? %>
<strong><%= note.reason %>:</strong>
<% end %>
<%= note.content %>
</p>
<% end %>
<% else %>
<p><em>No notes yet!</em></p>
<% end %>
<%= form_with model: @user, url: internal_user_path(@user), method: :patch, html: { class: "mb-2" }, local: true do |f| %>
<div class="form-group">
<%= f.label "Add new note: ", class: "d-block" %>
<%= f.text_area :new_note, class: "form-control" %>
</div>
<%= f.submit "Submit Note", class: "btn btn-primary float-right" %>
<% end %>
</div>
</div>