Commit bd48c156db1100b6b3cd2463461b6075aae6ba62
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
Merge branch 'AI3205-comment-paragraph' into stable
Showing
3 changed files
with
76 additions
and
55 deletions
Show diff stats
plugins/comment_paragraph/lib/ext/article.rb
| ... | ... | @@ -8,7 +8,7 @@ class Article |
| 8 | 8 | |
| 9 | 9 | def body_change_with_comments |
| 10 | 10 | if body && body_changed? && !self.comments.empty? |
| 11 | - paragraphs_with_comments = self.comments.where("'paragraph_id' IS NOT NULL") | |
| 11 | + paragraphs_with_comments = self.comments.where("paragraph_id IS NOT NULL") | |
| 12 | 12 | errors[:base] << (N_('You are unable to change the body of the article when paragraphs are commented')) unless (paragraphs_with_comments).empty? |
| 13 | 13 | end |
| 14 | 14 | end | ... | ... |
plugins/comment_paragraph/public/style.css
| ... | ... | @@ -34,6 +34,11 @@ div.article-comments-list-more{ |
| 34 | 34 | |
| 35 | 35 | .comment_paragraph{ |
| 36 | 36 | padding: 0px; |
| 37 | + position: relative; | |
| 38 | + left: -20px; | |
| 39 | + width: 450px; | |
| 40 | + font-weight: bold; | |
| 41 | + text-align: justify; | |
| 37 | 42 | } |
| 38 | 43 | |
| 39 | 44 | .triangle-right { |
| ... | ... | @@ -81,8 +86,6 @@ div.article-comments-list-more{ |
| 81 | 86 | .side-comment .comment_title{display: none;} |
| 82 | 87 | .side-comment label[for="comment_title"] {display: none;} |
| 83 | 88 | |
| 84 | - | |
| 85 | - | |
| 86 | 89 | div[class^='comments_list_toggle_paragraph_'] { |
| 87 | 90 | border-style: solid; |
| 88 | 91 | border-width: 1px; |
| ... | ... | @@ -93,9 +96,9 @@ div[class^='comments_list_toggle_paragraph_'] { |
| 93 | 96 | } |
| 94 | 97 | |
| 95 | 98 | div[class^='comment-paragraph-loading-'] { |
| 96 | - background-color: whitesmoke; | |
| 99 | + position: relative; | |
| 100 | + left: 470px; | |
| 97 | 101 | z-index: 99; |
| 98 | - right: -230px; | |
| 99 | 102 | } |
| 100 | 103 | |
| 101 | 104 | #content .side-comment .comment-balloon div[class^='comment-wrapper-']{ |
| ... | ... | @@ -146,9 +149,6 @@ div[class^='comment-paragraph-loading-'] { |
| 146 | 149 | |
| 147 | 150 | .comment-replies .comment-from-owner.comment-content {background: none;} |
| 148 | 151 | |
| 149 | - | |
| 150 | - | |
| 151 | - | |
| 152 | 152 | .side-comment .comment-balloon-content { |
| 153 | 153 | margin: 0; |
| 154 | 154 | } |
| ... | ... | @@ -210,4 +210,29 @@ div[class^='comment-paragraph-loading-'] { |
| 210 | 210 | |
| 211 | 211 | .side-comment .comment-count { |
| 212 | 212 | bg-color: #b3b2d4; |
| 213 | +} | |
| 214 | + | |
| 215 | +.comment-paragraph-rowset{ | |
| 216 | + padding: 0; | |
| 217 | + margin: 0; | |
| 218 | + list-style: none; | |
| 219 | + | |
| 220 | + display: -webkit-box; | |
| 221 | + display: -moz-box; | |
| 222 | + display: -ms-flexbox; | |
| 223 | + display: -webkit-flex; | |
| 224 | + display: flex; | |
| 225 | + | |
| 226 | + -webkit-flex-flow: row wrap; | |
| 227 | + justify-content: space-around; | |
| 228 | + | |
| 229 | +} | |
| 230 | +.comment-paragraph-comments{ | |
| 231 | + background: lightblue; | |
| 232 | + padding: 5px; | |
| 233 | + width: 150px; | |
| 234 | + margin-top: 10px; | |
| 235 | + color: white; | |
| 236 | + font-weight: bold; | |
| 237 | + text-align: center; | |
| 213 | 238 | } |
| 214 | 239 | \ No newline at end of file | ... | ... |
plugins/comment_paragraph/views/comment_paragraph_plugin_profile/_comment_paragraph.html.erb
| 1 | -<div class="comments"> | |
| 2 | - <table border="0"> | |
| 3 | - <tr> | |
| 4 | - <td width="90%"> | |
| 5 | - <div class="comment_paragraph" id="comment_paragraph_<%= paragraph_id %>" data-paragraph="<%= paragraph_id %>"> | |
| 6 | - <%= inner_html %> | |
| 7 | - </div> | |
| 8 | - </td> | |
| 9 | - <td> | |
| 10 | - <div align="center" class="side-comments-counter" id="side_comments_counter_<%= paragraph_id %>" data-paragraph="<%= paragraph_id %>" style="vertical-align: middle; padding-left: 3px; padding-right: 5px;"> | |
| 11 | - <span id="comment-count-<%= paragraph_id %>" class='comment-count'> | |
| 12 | - <%= count %> | |
| 13 | - </span> | |
| 14 | - </div> | |
| 15 | - </td> | |
| 16 | - <td valign="top"> | |
| 17 | - <div align="center"> | |
| 18 | - <%= | |
| 19 | - url = { :profile => profile_identifier, :controller => 'comment_paragraph_plugin_profile', :action => 'view_comments', :paragraph_id => paragraph_id, :article_id => article_id} | |
| 20 | - link_to_remote( | |
| 21 | - '', | |
| 22 | - { | |
| 23 | - :url => url, | |
| 24 | - :method => :post, | |
| 25 | - :condition => "!toggleParagraph(#{paragraph_id})", | |
| 26 | - :complete => "loadCompleted(#{paragraph_id})" | |
| 27 | - }, | |
| 28 | - { | |
| 29 | - :id => "link_to_ajax_comments_#{paragraph_id}", | |
| 30 | - :'data-url' => url_for(url) | |
| 31 | - } | |
| 32 | - )%> | |
| 33 | - </div> | |
| 34 | - <div class="side-comment" id="side_comment_<%= paragraph_id %>" data-paragraph="<%= paragraph_id %>" style="display:none"> | |
| 35 | - <div class="comment-paragraph-loading-<%= paragraph_id %>" style="position: absolute;"> | |
| 36 | - <div class="comments_list_toggle_paragraph_<%= paragraph_id %>" > | |
| 37 | - <div class="article-comments-list" id="comments_list_paragraph_<%= paragraph_id %>"></div> | |
| 38 | - <div class ="article-comments-list-more" id="comments_list_paragraph_<%= paragraph_id %>_more"></div> | |
| 39 | - <div id="page-comment-form-<%= paragraph_id %>" class='post_comment_box closed'> | |
| 40 | - <%= render :partial => 'comment/comment_form', :locals => {:comment => Comment.new, :display_link => true, :cancel_triggers_hide => true, :paragraph_id => paragraph_id}%> | |
| 41 | - </div> | |
| 42 | - </div> | |
| 43 | - </div> | |
| 44 | - </div> | |
| 45 | - </td> | |
| 46 | - </tr> | |
| 47 | - </table> | |
| 1 | +<ul class="comments comment-paragraph-rowset"> | |
| 2 | + <li class="comment_paragraph" id="comment_paragraph_<%= paragraph_id %>" data-paragraph="<%= paragraph_id %>"> | |
| 3 | + <%= inner_html %> | |
| 4 | + </li> | |
| 5 | + | |
| 6 | + <li align="center" class="side-comments-counter" id="side_comments_counter_<%= paragraph_id %>" data-paragraph="<%= paragraph_id %>" style="vertical-align: middle; padding-left: 3px; padding-right: 5px;"> | |
| 7 | + <span id="comment-count-<%= paragraph_id %>" class='comment-count'> | |
| 8 | + <%= count %> | |
| 9 | + </span> | |
| 10 | + </li> | |
| 11 | + | |
| 12 | + <div align="center"> | |
| 13 | + <%= | |
| 14 | + url = { :profile => profile_identifier, :controller => 'comment_paragraph_plugin_profile', :action => 'view_comments', :paragraph_id => paragraph_id, :article_id => article_id} | |
| 15 | + link_to_remote( | |
| 16 | + '', | |
| 17 | + { | |
| 18 | + :url => url, | |
| 19 | + :method => :post, | |
| 20 | + :condition => "!toggleParagraph(#{paragraph_id})", | |
| 21 | + :complete => "loadCompleted(#{paragraph_id})" | |
| 22 | + }, | |
| 23 | + { | |
| 24 | + :id => "link_to_ajax_comments_#{paragraph_id}", | |
| 25 | + :'data-url' => url_for(url) | |
| 26 | + } | |
| 27 | + )%> | |
| 28 | + </div> | |
| 29 | + | |
| 30 | + <div class="side-comment" id="side_comment_<%= paragraph_id %>" data-paragraph="<%= paragraph_id %>" style="display:none"> | |
| 31 | + <div class="comment-paragraph-loading-<%= paragraph_id %>" style="position: absolute;"> | |
| 32 | + <div class="comments_list_toggle_paragraph_<%= paragraph_id %>" > | |
| 33 | + <div class="article-comments-list" id="comments_list_paragraph_<%= paragraph_id %>"></div> | |
| 34 | + <div class ="article-comments-list-more" id="comments_list_paragraph_<%= paragraph_id %>_more"></div> | |
| 35 | + <div id="page-comment-form-<%= paragraph_id %>" class='post_comment_box closed'> | |
| 36 | + <%= render :partial => 'comment/comment_form', :locals => {:comment => Comment.new, :display_link => true, :cancel_triggers_hide => true, :paragraph_id => paragraph_id}%> | |
| 37 | + </div> | |
| 38 | + </div> | |
| 39 | + </div> | |
| 40 | + </div> | |
| 41 | + </ul> | |
| 42 | + | |
| 43 | + | ... | ... |