diff --git a/app/views/content_viewer/view_page.rhtml b/app/views/content_viewer/view_page.rhtml
index 3fee903..d771379 100644
--- a/app/views/content_viewer/view_page.rhtml
+++ b/app/views/content_viewer/view_page.rhtml
@@ -70,23 +70,29 @@
<%= display_source_info(@page) %>
diff --git a/test/functional/content_viewer_controller_test.rb b/test/functional/content_viewer_controller_test.rb
index 0ba1cd9..104c2e1 100644
--- a/test/functional/content_viewer_controller_test.rb
+++ b/test/functional/content_viewer_controller_test.rb
@@ -436,6 +436,14 @@ class ContentViewerControllerTest < ActionController::TestCase
end
end
+ should 'list comments if article has them, even if new comments are not allowed' do
+ page = profile.articles.create!(:name => 'myarticle', :body => 'the body of the text', :accept_comments => false)
+ page.comments.create!(:author => profile, :title => 'list my comment', :body => 'foo bar baz')
+ get :view_page, :profile => profile.identifier, :page => ['myarticle']
+
+ assert_tag :content => /list my comment/
+ end
+
should 'show link to publication on view' do
page = profile.articles.create!(:name => 'myarticle', :body => 'the body of the text')
login_as(profile.identifier)
--
libgit2 0.21.2
> - <%= number_of_comments(@page) %> -
- <% if @comments_count > 1 %> -<%= _('Post a comment') %>
+ + <% if @page.accept_comments? || @comments_count > 0 %> +> + <%= number_of_comments(@page) %> +
+ <% end %> + + <% if @page.accept_comments? && @comments_count > 1 %> +<%= _('Post a comment') %>
<% end %> +<%= render :partial => 'comment', :collection => @comments %>
-