Skip to content

Commit

Permalink
fix xml_sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
shingara committed Nov 19, 2008
1 parent 3eddcf8 commit 07111d9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions app/helpers/sidebar_helper.rb
Expand Up @@ -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
6 changes: 3 additions & 3 deletions vendor/plugins/xml_sidebar/views/content.rhtml
@@ -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.