Permalink
Browse files

fix xml_sidebar

  • Loading branch information...
1 parent 3eddcf8 commit 07111d9199c7c162f9f64e204ee2393d5c8d7990 @shingara shingara committed Nov 19, 2008
Showing with 15 additions and 3 deletions.
  1. +12 −0 app/helpers/sidebar_helper.rb
  2. +3 −3 vendor/plugins/xml_sidebar/views/content.rhtml
@@ -28,4 +28,16 @@ def render_sidebar(sidebar)
end
end
+ def articles?
+ not Article.first.nil?
+ end
+
+ def trackbacks?
+ not Trackback.first.nil?
+ end
+
+ def comments?
+ not Comment.first.nil?
+ end
+
end
@@ -1,12 +1,12 @@
<h3><%= _("Syndicate")%></h3>
<ul>
- <% if articles -%>
+ <% if articles? -%>
<li><a href="<%= url_for :controller=>'xml', :action=>'feed', :format => format, :type => 'feed' %>" title="Articles feed"><%= _("Articles")%></a></li>
<% end %>
- <% if comments -%>
+ <% if comments? -%>
<li><a href="<%= url_for :controller=>'xml', :action=>'feed', :format => format, :type => 'comments' %>" title="Comments feed"><%= _("Comments")%></a></li>
<% end %>
- <% if trackbacks -%>
+ <% if trackbacks? -%>
<li><a href="<%= url_for :controller=>'xml', :action=>'feed', :format => format, :type => 'trackbacks' %>" title="Trackbacks feed"><%= _("Trackbacks")%></a></li>
<% end %>
</ul>

0 comments on commit 07111d9

Please sign in to comment.