]> git.openstreetmap.org Git - rails.git/commitdiff
Include a comment link in the diary RSS feed.
authorTom Hughes <tom@compton.nu>
Fri, 18 Jan 2008 10:43:21 +0000 (10:43 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 18 Jan 2008 10:43:21 +0000 (10:43 +0000)
app/views/diary_entry/_diary_entry.rhtml
app/views/diary_entry/rss.rxml
app/views/diary_entry/view.rhtml

index 128ca89987ac3230a99a833dddeb2ae30247d97a..a4897366d22407b07dc97094e9e322e0a67c5966 100644 (file)
@@ -5,7 +5,7 @@ Coordinates: <div class="geo" style="display: inline"><span class="latitude"><%=
 <% end %>
 Posted by <b><%= link_to diary_entry.user.display_name, :controller => 'user', :action => 'view', :display_name => diary_entry.user.display_name %></b> at <%= diary_entry.created_at %><br />
 <% 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 %>
index 9590a4c8860cc6372c6496eae9a6d37b6e69d28d..4c9670a6d5f118230a536fe24961723cf769fb88 100644 (file)
@@ -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
index fbc316cc1d61e84bdc6cbdf8a9eff00429774110..ca678c50b02472dd9eedcf5f6d95d18d600e9898 100644 (file)
@@ -2,11 +2,13 @@
 
 <%= render :partial => 'diary_entry', :object => @entry %>
 
+<a id="comments"></a>
+
 <%= render :partial => 'diary_comment', :collection => @entry.diary_comments %>
 
 <% if @user %>
 
-<h4 id="comment">Leave a comment</h4>
+<h4 id="newcomment">Leave a comment</h4>
 <%= 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 %>
 
-<h4 id="comment"><%= link_to "Login", :controller => 'user', :action => 'login', :referer => request.request_uri %> to leave a comment</h4>
+<h4 id="newcomment"><%= link_to "Login", :controller => 'user', :action => 'login', :referer => request.request_uri %> to leave a comment</h4>
 
 <% end %>