Commit af6238af115a3600fbeeeb15df14cbfa72af6589

Authored by Victor Costa
2 parents 5d152dc4 318eef83

Merge branch 'master' into rails3

app/views/content_viewer/view_page.html.erb
@@ -83,17 +83,7 @@ @@ -83,17 +83,7 @@
83 <% if @page.accept_comments? && @comments.count > 1 %> 83 <% if @page.accept_comments? && @comments.count > 1 %>
84 <%= link_to(_('Post a comment'), '#', :class => 'display-comment-form', :id => 'top-post-comment-button', :onclick => "jQuery('#page-comment-form .display-comment-form').first().click();") %> 84 <%= link_to(_('Post a comment'), '#', :class => 'display-comment-form', :id => 'top-post-comment-button', :onclick => "jQuery('#page-comment-form .display-comment-form').first().click();") %>
85 85
86 - <%= hidden_field_tag("page_url", url_for(:controller=>'content_viewer', :action=>'view_page', :profile=>profile.identifier)) %>  
87 - <%= javascript_include_tag "comment_order.js" %>  
88 - <div class="comment-order">  
89 - <%= form_tag({:controller=>'content_viewer' , :action=>'view_page'}, {:method=>'get', :id=>"form_order"}) do %>  
90 - <%= select_tag 'comment_order', options_for_select({_('Oldest first')=>'oldest', _('Newest first')=>'newest'}, @comment_order) %>  
91 - <% end %>  
92 - </div>  
93 - <% end %>  
94 -  
95 - <% if @page.accept_comments? and @comments.count > 1 %>  
96 - <%= hidden_field_tag("page_url", url_for(:controller=>'content_viewer', :action=>'view_page', :profile=>profile.identifier)) %> 86 + <%= hidden_field_tag("page_url", url_for(:controller=>'content_viewer', :action=>'view_page', :profile=>profile.identifier, :page => @page.explode_path)) %>
97 <%= javascript_include_tag "comment_order.js" %> 87 <%= javascript_include_tag "comment_order.js" %>
98 <div class="comment-order"> 88 <div class="comment-order">
99 <%= form_tag({:controller=>'content_viewer' , :action=>'view_page'}, {:method=>'get', :id=>"form_order"}) do %> 89 <%= form_tag({:controller=>'content_viewer' , :action=>'view_page'}, {:method=>'get', :id=>"form_order"}) do %>
features/comment.feature
@@ -97,41 +97,3 @@ Feature: comment @@ -97,41 +97,3 @@ Feature: comment
97 Given I am on /booking/article-to-comment 97 Given I am on /booking/article-to-comment
98 And I follow "Post a comment" 98 And I follow "Post a comment"
99 Then "Post a comment" should not be visible within "#article" 99 Then "Post a comment" should not be visible within "#article"
100 -  
101 - @selenium  
102 - Scenario: the newest post from a forum should be displayed first.  
103 - Given the following users  
104 - | login | name |  
105 - | joaosilva | Joao Silva |  
106 - And the following forums  
107 - | owner | name |  
108 - | joaosilva | Forum |  
109 - And the following articles  
110 - | owner | name | parent |  
111 - | joaosilva | Post one | Forum |  
112 - And the following comments  
113 - | article | author | title | body |  
114 - | Post one | joaosilva | Hi all | Hi all |  
115 - | Post one | joaosilva | Hello | Hello |  
116 - When I go to /joaosilva/forum/post-one  
117 - And I select "Newest first" from "comment_order" within ".comment-order"  
118 - Then I should see "Hello" within ".article-comment"  
119 -  
120 - @selenium  
121 - Scenario: the oldest post from a forum should be displayed first.  
122 - Given the following users  
123 - | login | name |  
124 - | joaosilva | Joao Silva |  
125 - And the following forums  
126 - | owner | name |  
127 - | joaosilva | Forum |  
128 - And the following articles  
129 - | owner | name | parent |  
130 - | joaosilva | Post one | Forum |  
131 - And the following comments  
132 - | article | author | title | body |  
133 - | Post one | joaosilva | Hi all | Hi all |  
134 - | Post one | joaosilva | Hello | Hello |  
135 - When I go to /joaosilva/forum/post-one  
136 - And I select "Oldest first" from "comment_order" within ".comment-order"  
137 - Then I should see "Hi all" within ".article-comment"  
features/edit_article.feature
@@ -35,7 +35,9 @@ Feature: edit article @@ -35,7 +35,9 @@ Feature: edit article
35 And "Maria Silva" is a member of "Free Software" 35 And "Maria Silva" is a member of "Free Software"
36 And I am on freesoftware's control panel 36 And I am on freesoftware's control panel
37 And I follow "Manage Content" 37 And I follow "Manage Content"
  38 + And I should see "New content"
38 And I follow "New content" 39 And I follow "New content"
  40 + And I should see "Folder"
39 When I follow "Folder" 41 When I follow "Folder"
40 And I fill in "Title" with "My Folder" 42 And I fill in "Title" with "My Folder"
41 And I choose "article_published_false" 43 And I choose "article_published_false"
@@ -57,7 +59,9 @@ Feature: edit article @@ -57,7 +59,9 @@ Feature: edit article
57 And "Maria Silva" is a member of "Free Software" 59 And "Maria Silva" is a member of "Free Software"
58 And I am on freesoftware's control panel 60 And I am on freesoftware's control panel
59 And I follow "Manage Content" 61 And I follow "Manage Content"
  62 + And I should see "New content"
60 And I follow "New content" 63 And I follow "New content"
  64 + And I should see "Folder"
61 When I follow "Folder" 65 When I follow "Folder"
62 And I fill in "Title" with "My Folder" 66 And I fill in "Title" with "My Folder"
63 And I choose "article_published_false" 67 And I choose "article_published_false"
@@ -108,14 +112,17 @@ Feature: edit article @@ -108,14 +112,17 @@ Feature: edit article
108 Scenario: display tag list field when creating event 112 Scenario: display tag list field when creating event
109 Given I am on joaosilva's control panel 113 Given I am on joaosilva's control panel
110 And I follow "Manage Content" 114 And I follow "Manage Content"
  115 + And I should see "New content"
111 And I follow "New content" 116 And I follow "New content"
112 - When I follow "Event" 117 + And I should see "Event" within ".article-types"
  118 + When I follow "Event" within ".article-types"
113 Then I should see "Tag list" 119 Then I should see "Tag list"
114 120
115 Scenario: display tag list field when creating folder 121 Scenario: display tag list field when creating folder
116 Given I am on joaosilva's control panel 122 Given I am on joaosilva's control panel
117 And I follow "Manage Content" 123 And I follow "Manage Content"
118 And I follow "New content" 124 And I follow "New content"
  125 + And I should see "Folder"
119 When I follow "Folder" 126 When I follow "Folder"
120 Then I should see "Tag list" 127 Then I should see "Tag list"
121 128
@@ -163,12 +170,15 @@ Feature: edit article @@ -163,12 +170,15 @@ Feature: edit article
163 Scenario: create an article inside a folder 170 Scenario: create an article inside a folder
164 Given I am on joaosilva's control panel 171 Given I am on joaosilva's control panel
165 When I follow "Manage Content" 172 When I follow "Manage Content"
  173 + And I should see "New content"
166 And I follow "New content" 174 And I follow "New content"
  175 + And I should see "Folder"
167 And I follow "Folder" 176 And I follow "Folder"
168 And I fill in "Title" with "My Folder" 177 And I fill in "Title" with "My Folder"
169 And I press "Save" 178 And I press "Save"
170 Then I should be on /joaosilva/my-folder 179 Then I should be on /joaosilva/my-folder
171 When I follow "New article" 180 When I follow "New article"
  181 + And I should see "Text article with visual editor"
172 And I follow "Text article with visual editor" 182 And I follow "Text article with visual editor"
173 And I fill in "Title" with "My Article" 183 And I fill in "Title" with "My Article"
174 And I press "Save" 184 And I press "Save"
@@ -179,12 +189,15 @@ Feature: edit article @@ -179,12 +189,15 @@ Feature: edit article
179 Scenario: cancel button back to folder after giving up creating 189 Scenario: cancel button back to folder after giving up creating
180 Given I am on joaosilva's control panel 190 Given I am on joaosilva's control panel
181 When I follow "Manage Content" 191 When I follow "Manage Content"
  192 + And I should see "New content"
182 And I follow "New content" 193 And I follow "New content"
  194 + And I should see "Folder"
183 And I follow "Folder" 195 And I follow "Folder"
184 And I fill in "Title" with "My Folder" 196 And I fill in "Title" with "My Folder"
185 And I press "Save" 197 And I press "Save"
186 Then I should be on /joaosilva/my-folder 198 Then I should be on /joaosilva/my-folder
187 When I follow "New article" 199 When I follow "New article"
  200 + And I should see "Text article with visual editor"
188 And I follow "Text article with visual editor" 201 And I follow "Text article with visual editor"
189 And I follow "Cancel" within ".no-boxes" 202 And I follow "Cancel" within ".no-boxes"
190 Then I should be on /joaosilva/my-folder 203 Then I should be on /joaosilva/my-folder
@@ -202,6 +215,7 @@ Feature: edit article @@ -202,6 +215,7 @@ Feature: edit article
202 Given I am on joaosilva's control panel 215 Given I am on joaosilva's control panel
203 When I follow "Manage Content" 216 When I follow "Manage Content"
204 And I follow "New content" 217 And I follow "New content"
  218 + And I should see "Text article with visual editor"
205 And I follow "Text article with visual editor" 219 And I follow "Text article with visual editor"
206 And I fill in "Title" with "My new article" 220 And I fill in "Title" with "My new article"
207 And I fill in "Text" with "text for the new article" 221 And I fill in "Text" with "text for the new article"
public/javascripts/comment_order.js
1 function send_order(order, url) { 1 function send_order(order, url) {
2 - open_loading(DEFAULT_LOADING_MESSAGE);  
3 - 2 + jQuery('.article-comments-list').addClass('fetching');
4 jQuery.ajax({ 3 jQuery.ajax({
5 url:url, 4 url:url,
6 data: {"comment_order":order}, 5 data: {"comment_order":order},
7 success: function(response) { 6 success: function(response) {
8 - close_loading();  
9 jQuery(".article-comments-list").html(response); 7 jQuery(".article-comments-list").html(response);
10 }, 8 },
11 - error: function() { close_loading() } 9 + complete: function(){ jQuery('.article-comments-list').removeClass('fetching') }
12 }); 10 });
13 } 11 }
14 12
public/stylesheets/application.css
@@ -6690,3 +6690,7 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { @@ -6690,3 +6690,7 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img {
6690 #signup-form #result-strong { 6690 #signup-form #result-strong {
6691 color: green; 6691 color: green;
6692 } 6692 }
  6693 +
  6694 +.fetching {
  6695 + opacity: 0.3;
  6696 +}