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 83 <% if @page.accept_comments? && @comments.count > 1 %>
84 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 87 <%= javascript_include_tag "comment_order.js" %>
98 88 <div class="comment-order">
99 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 97 Given I am on /booking/article-to-comment
98 98 And I follow "Post a comment"
99 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 35 And "Maria Silva" is a member of "Free Software"
36 36 And I am on freesoftware's control panel
37 37 And I follow "Manage Content"
  38 + And I should see "New content"
38 39 And I follow "New content"
  40 + And I should see "Folder"
39 41 When I follow "Folder"
40 42 And I fill in "Title" with "My Folder"
41 43 And I choose "article_published_false"
... ... @@ -57,7 +59,9 @@ Feature: edit article
57 59 And "Maria Silva" is a member of "Free Software"
58 60 And I am on freesoftware's control panel
59 61 And I follow "Manage Content"
  62 + And I should see "New content"
60 63 And I follow "New content"
  64 + And I should see "Folder"
61 65 When I follow "Folder"
62 66 And I fill in "Title" with "My Folder"
63 67 And I choose "article_published_false"
... ... @@ -108,14 +112,17 @@ Feature: edit article
108 112 Scenario: display tag list field when creating event
109 113 Given I am on joaosilva's control panel
110 114 And I follow "Manage Content"
  115 + And I should see "New content"
111 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 119 Then I should see "Tag list"
114 120  
115 121 Scenario: display tag list field when creating folder
116 122 Given I am on joaosilva's control panel
117 123 And I follow "Manage Content"
118 124 And I follow "New content"
  125 + And I should see "Folder"
119 126 When I follow "Folder"
120 127 Then I should see "Tag list"
121 128  
... ... @@ -163,12 +170,15 @@ Feature: edit article
163 170 Scenario: create an article inside a folder
164 171 Given I am on joaosilva's control panel
165 172 When I follow "Manage Content"
  173 + And I should see "New content"
166 174 And I follow "New content"
  175 + And I should see "Folder"
167 176 And I follow "Folder"
168 177 And I fill in "Title" with "My Folder"
169 178 And I press "Save"
170 179 Then I should be on /joaosilva/my-folder
171 180 When I follow "New article"
  181 + And I should see "Text article with visual editor"
172 182 And I follow "Text article with visual editor"
173 183 And I fill in "Title" with "My Article"
174 184 And I press "Save"
... ... @@ -179,12 +189,15 @@ Feature: edit article
179 189 Scenario: cancel button back to folder after giving up creating
180 190 Given I am on joaosilva's control panel
181 191 When I follow "Manage Content"
  192 + And I should see "New content"
182 193 And I follow "New content"
  194 + And I should see "Folder"
183 195 And I follow "Folder"
184 196 And I fill in "Title" with "My Folder"
185 197 And I press "Save"
186 198 Then I should be on /joaosilva/my-folder
187 199 When I follow "New article"
  200 + And I should see "Text article with visual editor"
188 201 And I follow "Text article with visual editor"
189 202 And I follow "Cancel" within ".no-boxes"
190 203 Then I should be on /joaosilva/my-folder
... ... @@ -202,6 +215,7 @@ Feature: edit article
202 215 Given I am on joaosilva's control panel
203 216 When I follow "Manage Content"
204 217 And I follow "New content"
  218 + And I should see "Text article with visual editor"
205 219 And I follow "Text article with visual editor"
206 220 And I fill in "Title" with "My new article"
207 221 And I fill in "Text" with "text for the new article"
... ...
public/javascripts/comment_order.js
1 1 function send_order(order, url) {
2   - open_loading(DEFAULT_LOADING_MESSAGE);
3   -
  2 + jQuery('.article-comments-list').addClass('fetching');
4 3 jQuery.ajax({
5 4 url:url,
6 5 data: {"comment_order":order},
7 6 success: function(response) {
8   - close_loading();
9 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 6690 #signup-form #result-strong {
6691 6691 color: green;
6692 6692 }
  6693 +
  6694 +.fetching {
  6695 + opacity: 0.3;
  6696 +}
... ...