noosfero | 2 new commits pushed to repository

Antonio Terceiro gitlab at gitlab.com
Tue Jan 27 17:06:42 BRST 2015


Antonio Terceiro pushed to refs/heads/master at <a href="https://gitlab.com/noosfero/noosfero">Noosfero / noosfero</a>

Commits:
<a href="https://gitlab.com/noosfero/noosfero/commit/9cd1500309fb730a44e08ed027bf69923d3e4857">9cd15003</a> by Gabriela Navarro
Fix view to hide all tags related to comments when the article doesn't accept and have comments

Signed-off-by: Arthur Del Esposte <arthurmde at gmail.com>
Signed-off-by: Gabriela Navarro <navarro1703 at gmail.com>

- - - - -
<a href="https://gitlab.com/noosfero/noosfero/commit/01c2e8721d6560e3667d430a22171d7bbce07b02">01c2e872</a> by Antonio Terceiro
Merge branch 'comment_bug' into 'master'

Comment view bug

When an article doesn't accept comments, it still used to show the comment div. In some themes it can be a problem.

i.e https://beta.softwarepublico.gov.br/social/spb/ajuda

This is an example of a theme environment with this problem. Note that there is an empty border div in the bottom of the page.

See merge request !431

- - - - -


Changes:

=====================================
app/views/content_viewer/view_page.html.erb
=====================================
--- a/app/views/content_viewer/view_page.html.erb
+++ b/app/views/content_viewer/view_page.html.erb
@@ -70,37 +70,36 @@
 
 <%= @plugins.dispatch(:article_extra_contents, @page).collect { |content| instance_exec(&content) }.join("") %>
 
-<div class="comments" id="comments_list">
-
-  <% if @page.accept_comments? || @comments_count > 0 %>
+<% if @page.accept_comments? || @comments_count > 0 %>
+  <div class="comments" id="comments_list">
     <h3 <%= 'class="no-comments-yet"' if @comments_count == 0 %>>
       <%= display_number_of_comments(@comments_count) %>
     </h3>
-  <% end %>
 
-  <% if @comments.present? && @comments.count > 1 %>
-    <%= link_to(_('Post a comment'), '#', :class => 'display-comment-form', :id => 'top-post-comment-button', :onclick => "jQuery('#page-comment-form .display-comment-form').first().click();") if @page.accept_comments? %>
+    <% if @comments.present? && @comments.count > 1 %>
+      <%= link_to(_('Post a comment'), '#', :class => 'display-comment-form', :id => 'top-post-comment-button', :onclick => "jQuery('#page-comment-form .display-comment-form').first().click();") if @page.accept_comments? %>
+
+      <%= hidden_field_tag("page_url", url_for(:controller=>'content_viewer', :action=>'view_page', :profile=>profile.identifier, :page => @page.explode_path)) %>
+      <%= javascript_include_tag "comment_order.js" %>
+      <div class="comment-order">
+        <%= form_tag({:controller=>'content_viewer' , :action=>'view_page'}, {:method=>'get', :id=>"form_order"}) do %>
+          <%= select_tag 'comment_order', options_for_select({_('Oldest first')=>'oldest', _('Newest first')=>'newest'}, @comment_order) %>
+        <% end %>
+      </div>
+    <% end %>
 
-    <%= hidden_field_tag("page_url", url_for(:controller=>'content_viewer', :action=>'view_page', :profile=>profile.identifier, :page => @page.explode_path)) %>
-    <%= javascript_include_tag "comment_order.js" %>
-    <div class="comment-order">
-      <%= form_tag({:controller=>'content_viewer' , :action=>'view_page'}, {:method=>'get', :id=>"form_order"}) do %>
-        <%= select_tag 'comment_order', options_for_select({_('Oldest first')=>'oldest', _('Newest first')=>'newest'}, @comment_order) %>
+    <ul class="article-comments-list">
+      <% if @comments.present? %>
+        <%= render :partial => 'comment/comment', :collection => @comments %>
+        <%= pagination_links @comments, :param_name => 'comment_page' %>
       <% end %>
-    </div>
-  <% end %>
+    </ul>
 
-  <ul class="article-comments-list">
-    <% if @comments.present? %>
-      <%= render :partial => 'comment/comment', :collection => @comments %>
-      <%= pagination_links @comments, :param_name => 'comment_page' %>
+    <% if @page.accept_comments? %>
+      <div id='page-comment-form' class='page-comment-form'><%= render :partial => 'comment/comment_form', :locals =>{:url => {:controller => :comment, :action => :create}, :display_link => true, :cancel_triggers_hide => true}%></div>
     <% end %>
-  </ul>
-
-  <% if @page.accept_comments? %>
-    <div id='page-comment-form' class='page-comment-form'><%= render :partial => 'comment/comment_form', :locals =>{:url => {:controller => :comment, :action => :create}, :display_link => true, :cancel_triggers_hide => true}%></div>
-  <% end %>
-</div><!-- end class="comments" -->
+  </div><!-- end class="comments" -->
+<% end %>
 
 </div><!-- end id="article" -->
 <%= add_zoom_to_article_images %>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150127/be6e2ba6/attachment.html>


More information about the Noosfero-dev mailing list