Link to diary comments using anchors, rather than showing them alone
Neither way is perfect, but this is less surprising than seeing a diary entry with only one comment visible.
This commit is contained in:
parent
75e178e6b8
commit
b955a7e78e
3 changed files with 3 additions and 10 deletions
|
@ -186,9 +186,6 @@ class DiaryEntryController < ApplicationController
|
||||||
@entry = @this_user.diary_entries.visible.where(:id => params[:id]).first
|
@entry = @this_user.diary_entries.visible.where(:id => params[:id]).first
|
||||||
if @entry
|
if @entry
|
||||||
@title = t "diary_entry.view.title", :user => params[:display_name], :title => @entry.title
|
@title = t "diary_entry.view.title", :user => params[:display_name], :title => @entry.title
|
||||||
if params[:comment_id]
|
|
||||||
@reported_comment = DiaryComment.where(:id => params[:comment_id])
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
@title = t "diary_entry.no_such_entry.title", :id => params[:id]
|
@title = t "diary_entry.no_such_entry.title", :id => params[:id]
|
||||||
render :action => "no_such_entry", :status => :not_found
|
render :action => "no_such_entry", :status => :not_found
|
||||||
|
|
|
@ -7,7 +7,7 @@ module IssuesHelper
|
||||||
when "User"
|
when "User"
|
||||||
link_to reportable.display_name.to_s, :controller => reportable.class.name.underscore, :action => :view, :display_name => reportable.display_name
|
link_to reportable.display_name.to_s, :controller => reportable.class.name.underscore, :action => :view, :display_name => reportable.display_name
|
||||||
when "DiaryComment"
|
when "DiaryComment"
|
||||||
link_to "#{reportable.diary_entry.title}, Comment id ##{reportable.id}", :controller => reportable.diary_entry.class.name.underscore, :action => :view, :display_name => reportable.diary_entry.user.display_name, :id => reportable.diary_entry.id, :comment_id => reportable.id
|
link_to "#{reportable.diary_entry.title}, Comment id ##{reportable.id}", :controller => reportable.diary_entry.class.name.underscore, :action => :view, :display_name => reportable.diary_entry.user.display_name, :id => reportable.diary_entry.id, :anchor => "comment#{reportable.id}"
|
||||||
when "Changeset"
|
when "Changeset"
|
||||||
link_to "Changeset ##{reportable.id}", :controller => :browse, :action => :changeset, :id => reportable.id
|
link_to "Changeset ##{reportable.id}", :controller => :browse, :action => :changeset, :id => reportable.id
|
||||||
when "Note"
|
when "Note"
|
||||||
|
@ -39,7 +39,7 @@ module IssuesHelper
|
||||||
when "User"
|
when "User"
|
||||||
link_to "Show Instance", :controller => reportable.class.name.underscore, :action => :view, :display_name => reportable.display_name
|
link_to "Show Instance", :controller => reportable.class.name.underscore, :action => :view, :display_name => reportable.display_name
|
||||||
when "DiaryComment"
|
when "DiaryComment"
|
||||||
link_to "Show Instance", :controller => reportable.diary_entry.class.name.underscore, :action => :view, :display_name => reportable.diary_entry.user.display_name, :id => reportable.diary_entry.id, :comment_id => reportable.id
|
link_to "Show Instance", :controller => reportable.diary_entry.class.name.underscore, :action => :view, :display_name => reportable.diary_entry.user.display_name, :id => reportable.diary_entry.id, :anchor => "comment#{reportable.id}"
|
||||||
when "Changeset"
|
when "Changeset"
|
||||||
link_to "Show Instance", :controller => :browse, :action => :changeset, :id => reportable.id
|
link_to "Show Instance", :controller => :browse, :action => :changeset, :id => reportable.id
|
||||||
when "Note"
|
when "Note"
|
||||||
|
|
|
@ -10,11 +10,7 @@
|
||||||
|
|
||||||
<a id="comments"></a>
|
<a id="comments"></a>
|
||||||
<div class='comments'>
|
<div class='comments'>
|
||||||
<% if @reported_comment %>
|
<%= render :partial => 'diary_comment', :collection => @entry.visible_comments %>
|
||||||
<%= render :partial => 'diary_comment', :collection => @reported_comment %>
|
|
||||||
<% else %>
|
|
||||||
<%= render :partial => 'diary_comment', :collection => @entry.visible_comments %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
<%= if_logged_in(:div) do %>
|
<%= if_logged_in(:div) do %>
|
||||||
<h3 id="newcomment"><%= t 'diary_entry.view.leave_a_comment' %></h3>
|
<h3 id="newcomment"><%= t 'diary_entry.view.leave_a_comment' %></h3>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue