From bb905aa28538cb2906fa2edceb81478ec0820ea5 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 18 Jan 2008 10:43:21 +0000 Subject: [PATCH] Include a comment link in the diary RSS feed. --- app/views/diary_entry/_diary_entry.rhtml | 2 +- app/views/diary_entry/rss.rxml | 1 + app/views/diary_entry/view.rhtml | 6 ++++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/views/diary_entry/_diary_entry.rhtml b/app/views/diary_entry/_diary_entry.rhtml index 128ca8998..a4897366d 100644 --- a/app/views/diary_entry/_diary_entry.rhtml +++ b/app/views/diary_entry/_diary_entry.rhtml @@ -5,7 +5,7 @@ Coordinates:
<%= <% end %> Posted by <%= link_to diary_entry.user.display_name, :controller => 'user', :action => 'view', :display_name => diary_entry.user.display_name %> at <%= diary_entry.created_at %>
<% if params[:action] == 'list' %> -<%= link_to 'Comment on this entry', :action => 'view', :display_name => diary_entry.user.display_name, :id => diary_entry.id, :anchor => 'comment' %> +<%= link_to 'Comment on this entry', :action => 'view', :display_name => diary_entry.user.display_name, :id => diary_entry.id, :anchor => 'newcomment' %> | <%= link_to 'Reply to this entry', :controller => 'message', :action => 'new', :user_id => diary_entry.user.id, :title => "Re: #{diary_entry.title}" %> <% end %> diff --git a/app/views/diary_entry/rss.rxml b/app/views/diary_entry/rss.rxml index 9590a4c88..4c9670a6d 100644 --- a/app/views/diary_entry/rss.rxml +++ b/app/views/diary_entry/rss.rxml @@ -23,6 +23,7 @@ xml.rss("version" => "2.0", xml.description htmlize(entry.body) xml.author entry.user.display_name xml.pubDate entry.created_at.to_s(:rfc822) + xml.comments url_for(:action => "view", :id => entry.id, :display_name => entry.user.display_name, :anchor => "comments", :only_path => false) if entry.latitude and entry.longitude xml.geo :lat, entry.latitude.to_s diff --git a/app/views/diary_entry/view.rhtml b/app/views/diary_entry/view.rhtml index fbc316cc1..ca678c50b 100644 --- a/app/views/diary_entry/view.rhtml +++ b/app/views/diary_entry/view.rhtml @@ -2,11 +2,13 @@ <%= render :partial => 'diary_entry', :object => @entry %> + + <%= render :partial => 'diary_comment', :collection => @entry.diary_comments %> <% if @user %> -

Leave a comment

+

Leave a comment

<%= error_messages_for 'diary_comment' %> <% form_for :diary_comment, @diary_comment, :url => { :action => 'comment' } do |f| %> <%= f.text_area :body, :cols => 80, :rows => 5 %> @@ -17,6 +19,6 @@ <% else %> -

<%= link_to "Login", :controller => 'user', :action => 'login', :referer => request.request_uri %> to leave a comment

+

<%= link_to "Login", :controller => 'user', :action => 'login', :referer => request.request_uri %> to leave a comment

<% end %> -- 2.43.2