From e875f2973a33134168cb76b0b37d634b29cc42b5 Mon Sep 17 00:00:00 2001 From: evazion Date: Fri, 7 Jul 2017 16:22:44 -0500 Subject: [PATCH] /notes, /note_versions: link directly to note within post. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also adds a "»" link, linking to the note's history. --- app/views/note_versions/index.html.erb | 7 +++++-- app/views/notes/index.html.erb | 9 +++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/views/note_versions/index.html.erb b/app/views/note_versions/index.html.erb index 7423a0927..2d5513774 100644 --- a/app/views/note_versions/index.html.erb +++ b/app/views/note_versions/index.html.erb @@ -2,7 +2,7 @@

Note Changes

- +
@@ -25,8 +25,11 @@ - +
<%= link_to note_version.post_id, post_path(note_version.post_id) %><%= link_to "#{note_version.note_id}.#{note_version.version}", note_versions_path(:search => {:note_id => note_version.note_id}) %> + <%= link_to "#{note_version.note_id}.#{note_version.version}", post_path(note_version.post_id, anchor: "note-#{note_version.note_id}") %> + <%= link_to "»", note_versions_path(search: {note_id: note_version.note_id}) %> + <%= h(note_version.body) %> <% unless note_version.is_active? %> (deleted) diff --git a/app/views/notes/index.html.erb b/app/views/notes/index.html.erb index c588ca160..a9140c815 100644 --- a/app/views/notes/index.html.erb +++ b/app/views/notes/index.html.erb @@ -2,10 +2,11 @@

Notes

- +
+ @@ -15,9 +16,13 @@ <% @notes.each do |note| %> + -
PostNote Created by Created at Body
<%= link_to note.post_id, post_path(note.post_id) %> + <%= 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}) %> + <%= link_to_user note.creator %> <%= compact_time(note.created_at) %> + <%= h(note.body) %> <% unless note.is_active? %> (deleted)