views: convert /notes to table builder.
This commit is contained in:
@@ -2,36 +2,26 @@
|
|||||||
<div id="a-index">
|
<div id="a-index">
|
||||||
<h1>Notes</h1>
|
<h1>Notes</h1>
|
||||||
|
|
||||||
<table width="100%" class="striped autofit">
|
<%= table_for @notes, class: "striped autofit" do |t| %>
|
||||||
<thead>
|
<% t.column "Post" do |note| %>
|
||||||
<tr>
|
<%= link_to note.post_id, note.post %>
|
||||||
<th>Post</th>
|
<% end %>
|
||||||
<th>Note</th>
|
<% t.column "Note" do |note| %>
|
||||||
<th>Created by</th>
|
<%= link_to "#{note.id}.#{note.version}", post_path(note.post_id, anchor: "note-#{note.id}") %>
|
||||||
<th>Created at</th>
|
<%= link_to "»", note_versions_path(search: { note_id: note.id }) %>
|
||||||
<th>Body</th>
|
<% end %>
|
||||||
</tr>
|
<% t.column "Body", class: "col-expand" do |note| %>
|
||||||
</thead>
|
<%= note.body %>
|
||||||
<tbody>
|
<% unless note.is_active? %>
|
||||||
<% @notes.each do |note| %>
|
<span class="inactive">(deleted)</span>
|
||||||
<tr>
|
|
||||||
<td><%= link_to note.post_id, post_path(note.post_id) %></td>
|
|
||||||
<td>
|
|
||||||
<%= link_to "#{note.id}.#{note.version}", post_path(note.post_id, anchor: "note-#{note.id}") %>
|
|
||||||
<%= link_to "»", note_versions_path(search: {note_id: note.id}) %>
|
|
||||||
</td>
|
|
||||||
<td><%= link_to_user note.creator %></td>
|
|
||||||
<td><%= compact_time(note.created_at) %></td>
|
|
||||||
<td class="col-expand">
|
|
||||||
<%= h(note.body) %>
|
|
||||||
<% unless note.is_active? %>
|
|
||||||
<span class="inactive">(deleted)</span>
|
|
||||||
<% end %>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
<% end %>
|
||||||
</table>
|
<% t.column "Created" do |note| %>
|
||||||
|
<%= link_to_user note.creator %>
|
||||||
|
<%= link_to "»", notes_path(search: { creator_name: note.creator.name }) %>
|
||||||
|
<div><%= time_ago_in_words_tagged(note.created_at) %></div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<%= numbered_paginator(@notes) %>
|
<%= numbered_paginator(@notes) %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user