* Update data exporter to handle admin send * Match button with everything else * Use proper redirect path * Stub SiteConfig definition instead of setting it Co-authored-by: Mac Siri <krairit.siri@gmail.com> * Removed if statement by accident oops * Remove non-functional boolean param and pass email directly * Use refinement to conv to boolean instead of JSON.parse * Rename to StringToBoolean * Use 'using' in proper scope (not in method) * Rename to_bool to to_boolean * Refactor if statement, thanks rhymes! * Fix small bugs in tests * Remove tracking for export_email b/c no @user Co-authored-by: Mac Siri <krairit.siri@gmail.com>
26 lines
926 B
Text
26 lines
926 B
Text
<div class="crayons-card p-6">
|
|
<h2 class="mb-6">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 %>
|
|
<div class="crayons-notice mb-6">No notes yet...</div>
|
|
<% end %>
|
|
<%= form_with model: @user, url: admin_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: "crayons-btn float-right" %>
|
|
<% end %>
|
|
</div>
|