Commit 8af46e7252b67f7b5e4feac7a3ef32ce3b4bf7bb
Exists in
master
and in
27 other branches
Merge branch 'master' into search-improvements
Conflicts: public/stylesheets/application.css
Showing
47 changed files
with
144 additions
and
188 deletions
Show diff stats
Gemfile.lock
@@ -62,7 +62,7 @@ GEM | @@ -62,7 +62,7 @@ GEM | ||
62 | database_cleaner (1.2.0) | 62 | database_cleaner (1.2.0) |
63 | diff-lcs (1.1.3) | 63 | diff-lcs (1.1.3) |
64 | erubis (2.7.0) | 64 | erubis (2.7.0) |
65 | - eventmachine (1.0.3) | 65 | + eventmachine (0.12.11) |
66 | fast_gettext (0.6.8) | 66 | fast_gettext (0.6.8) |
67 | ffi (1.0.11) | 67 | ffi (1.0.11) |
68 | gherkin (2.4.21) | 68 | gherkin (2.4.21) |
@@ -76,7 +76,7 @@ GEM | @@ -76,7 +76,7 @@ GEM | ||
76 | i18n (>= 0.4.0) | 76 | i18n (>= 0.4.0) |
77 | mime-types (~> 1.16) | 77 | mime-types (~> 1.16) |
78 | treetop (~> 1.4.8) | 78 | treetop (~> 1.4.8) |
79 | - metaclass (0.0.4) | 79 | + metaclass (0.0.1) |
80 | mime-types (1.19) | 80 | mime-types (1.19) |
81 | mocha (0.11.3) | 81 | mocha (0.11.3) |
82 | metaclass (~> 0.0.1) | 82 | metaclass (~> 0.0.1) |
app/controllers/my_profile/cms_controller.rb
@@ -232,7 +232,7 @@ class CmsController < MyProfileController | @@ -232,7 +232,7 @@ class CmsController < MyProfileController | ||
232 | @current_category = Category.find(params[:category_id]) | 232 | @current_category = Category.find(params[:category_id]) |
233 | @categories = @current_category.children | 233 | @categories = @current_category.children |
234 | end | 234 | end |
235 | - render :template => 'shared/update_categories', :locals => { :category => @current_category } | 235 | + render :template => 'shared/update_categories', :locals => { :category => @current_category, :object_name => 'article' } |
236 | end | 236 | end |
237 | 237 | ||
238 | def publish | 238 | def publish |
app/controllers/my_profile/profile_editor_controller.rb
@@ -54,7 +54,7 @@ class ProfileEditorController < MyProfileController | @@ -54,7 +54,7 @@ class ProfileEditorController < MyProfileController | ||
54 | @current_category = Category.find(params[:category_id]) | 54 | @current_category = Category.find(params[:category_id]) |
55 | @categories = @current_category.children | 55 | @categories = @current_category.children |
56 | end | 56 | end |
57 | - render :template => 'shared/update_categories', :locals => { :category => @current_category } | 57 | + render :template => 'shared/update_categories', :locals => { :category => @current_category, :object_name => 'profile_data' } |
58 | end | 58 | end |
59 | 59 | ||
60 | def header_footer | 60 | def header_footer |
app/controllers/public/content_viewer_controller.rb
@@ -33,6 +33,7 @@ class ContentViewerController < ApplicationController | @@ -33,6 +33,7 @@ class ContentViewerController < ApplicationController | ||
33 | process_forum_terms_of_use(user, params[:terms_accepted]) | 33 | process_forum_terms_of_use(user, params[:terms_accepted]) |
34 | elsif is_a_forum_topic?(@page) | 34 | elsif is_a_forum_topic?(@page) |
35 | redirect_to @page.parent.url unless @page.parent.agrees_with_terms?(user) | 35 | redirect_to @page.parent.url unless @page.parent.agrees_with_terms?(user) |
36 | + return | ||
36 | end | 37 | end |
37 | 38 | ||
38 | # At this point the page will be showed | 39 | # At this point the page will be showed |
app/helpers/application_helper.rb
@@ -671,7 +671,7 @@ module ApplicationHelper | @@ -671,7 +671,7 @@ module ApplicationHelper | ||
671 | 671 | ||
672 | def theme_javascript_ng | 672 | def theme_javascript_ng |
673 | script = File.join(theme_path, 'theme.js') | 673 | script = File.join(theme_path, 'theme.js') |
674 | - if File.exists?(Rails.root.join('public', script)) | 674 | + if File.join(Rails.root, 'public', script) |
675 | javascript_include_tag script | 675 | javascript_include_tag script |
676 | else | 676 | else |
677 | nil | 677 | nil |
app/models/article.rb
@@ -2,7 +2,7 @@ require 'hpricot' | @@ -2,7 +2,7 @@ require 'hpricot' | ||
2 | 2 | ||
3 | class Article < ActiveRecord::Base | 3 | class Article < ActiveRecord::Base |
4 | 4 | ||
5 | - attr_accessible :name, :body, :abstract, :profile, :tag_list, :parent, :allow_members_to_edit, :translation_of_id, :language, :license_id, :parent_id, :display_posts_in_current_language, :category_ids, :posts_per_page, :moderate_comments, :accept_comments, :feed, :published, :source, :highlighted, :notify_comments, :display_hits, :slug, :external_feed_builder, :display_versions | 5 | + attr_accessible :name, :body, :abstract, :profile, :tag_list, :parent, :allow_members_to_edit, :translation_of_id, :language, :license_id, :parent_id, :display_posts_in_current_language, :category_ids, :posts_per_page, :moderate_comments, :accept_comments, :feed, :published, :source, :highlighted, :notify_comments, :display_hits, :slug, :external_feed_builder, :display_versions, :external_link |
6 | 6 | ||
7 | acts_as_having_image | 7 | acts_as_having_image |
8 | 8 |
app/models/forum.rb
@@ -3,7 +3,7 @@ class Forum < Folder | @@ -3,7 +3,7 @@ class Forum < Folder | ||
3 | acts_as_having_posts :order => 'updated_at DESC' | 3 | acts_as_having_posts :order => 'updated_at DESC' |
4 | include PostsLimit | 4 | include PostsLimit |
5 | 5 | ||
6 | - attr_accessible :has_terms_of_use, :terms_of_use | 6 | + attr_accessible :has_terms_of_use, :terms_of_use, :allows_members_to_create_topics |
7 | 7 | ||
8 | settings_items :terms_of_use, :type => :string, :default => "" | 8 | settings_items :terms_of_use, :type => :string, :default => "" |
9 | settings_items :has_terms_of_use, :type => :boolean, :default => false | 9 | settings_items :has_terms_of_use, :type => :boolean, :default => false |
app/models/input.rb
1 | class Input < ActiveRecord::Base | 1 | class Input < ActiveRecord::Base |
2 | 2 | ||
3 | - attr_accessible :product, :product_category | 3 | + attr_accessible :product, :product_category, :product_category_id, :amount_used, :unit_id, :price_per_unit, :relevant_to_price |
4 | 4 | ||
5 | belongs_to :product | 5 | belongs_to :product |
6 | belongs_to :product_category | 6 | belongs_to :product_category |
app/views/box_organizer/_link_list_block.html.erb
@@ -10,40 +10,15 @@ | @@ -10,40 +10,15 @@ | ||
10 | </ul> | 10 | </ul> |
11 | <ul id="dropable-link-list"> | 11 | <ul id="dropable-link-list"> |
12 | <% for link in @block.links do %> | 12 | <% for link in @block.links do %> |
13 | - <li> | ||
14 | - <ul class="link-list-row"> | ||
15 | - <li> | ||
16 | - <%= icon_selector(link['icon']) %> | ||
17 | - </li> | ||
18 | - <li> | ||
19 | - <%= text_field_tag 'block[links][][name]', link[:name], :class => 'link-name', :maxlength => 20 %> | ||
20 | - </li> | ||
21 | - <li> | ||
22 | - <%= text_field_tag 'block[links][][address]', link[:address], :class => 'link-address' %> | ||
23 | - </li> | ||
24 | - <li> | ||
25 | - <%= select_tag('block[links][][target]', options_for_select(LinkListBlock::TARGET_OPTIONS, link[:target])) %> | ||
26 | - </li> | ||
27 | - <li> | ||
28 | - <%= button_without_text(:delete, _('Delete'), "#" , :class=>"delete-link-list-row") %> | ||
29 | - </li> | ||
30 | - </ul> | ||
31 | - </li> | 13 | + <%= render :partial => 'link_list_item', :locals => {:link => link} %> |
32 | <% end %> | 14 | <% end %> |
33 | </ul> | 15 | </ul> |
34 | <input type="hidden" id="page_url" value="<%=url_for(:action=>'search_autocomplete')%>" /> | 16 | <input type="hidden" id="page_url" value="<%=url_for(:action=>'search_autocomplete')%>" /> |
17 | + | ||
18 | + <div id="new-template"> | ||
19 | + <% template_link = {'icon' => 'ok'} %> | ||
20 | + <%= render :partial => 'link_list_item', :locals => {:link => template_link} %> | ||
21 | + </div> | ||
35 | </div> | 22 | </div> |
36 | 23 | ||
37 | -<%= link_to_function(_('New link'), nil, :class => 'button icon-add with-text') do |page| | ||
38 | - page.insert_html :bottom, 'dropable-link-list', content_tag('li', | ||
39 | - content_tag('ul', | ||
40 | - content_tag('li', icon_selector('ok')) + | ||
41 | - content_tag('li', text_field_tag('block[links][][name]', '', :maxlength => 20)) + | ||
42 | - content_tag('li', text_field_tag('block[links][][address]', nil, :class => 'link-address')) + | ||
43 | - content_tag('li', select_tag('block[links][][target]', | ||
44 | - options_for_select(LinkListBlock::TARGET_OPTIONS, '_self'))) + | ||
45 | - content_tag('li', button_without_text(:delete, _('Delete'), "#" , :class=>"delete-link-list-row")), | ||
46 | - :class=>"link-list-row new_link_row") | ||
47 | - ) + | ||
48 | - javascript_tag("new_link_action()") | ||
49 | -end %> | 24 | +<%= link_to_function(_('New link'), 'add_new_link();', :class => 'button icon-add with-text') %> |
@@ -0,0 +1,19 @@ | @@ -0,0 +1,19 @@ | ||
1 | +<li> | ||
2 | + <ul class="link-list-row"> | ||
3 | + <li> | ||
4 | + <%= icon_selector(link['icon']) %> | ||
5 | + </li> | ||
6 | + <li> | ||
7 | + <%= text_field_tag 'block[links][][name]', link[:name], :class => 'link-name', :maxlength => 20 %> | ||
8 | + </li> | ||
9 | + <li> | ||
10 | + <%= text_field_tag 'block[links][][address]', link[:address], :class => 'link-address' %> | ||
11 | + </li> | ||
12 | + <li> | ||
13 | + <%= select_tag('block[links][][target]', options_for_select(LinkListBlock::TARGET_OPTIONS, link[:target])) %> | ||
14 | + </li> | ||
15 | + <li> | ||
16 | + <%= button_without_text(:delete, _('Delete'), "#" , :class=>"delete-link-list-row") %> | ||
17 | + </li> | ||
18 | + </ul> | ||
19 | +</li> |
app/views/comment/_comment_form.html.erb
@@ -46,14 +46,16 @@ function check_captcha(button, confirm_action) { | @@ -46,14 +46,16 @@ function check_captcha(button, confirm_action) { | ||
46 | } | 46 | } |
47 | </script> | 47 | </script> |
48 | 48 | ||
49 | -<% if @comment && @comment.errors.any? %> | 49 | +<% @comment ||= Comment.new %> |
50 | + | ||
51 | +<% if @comment.errors.any? %> | ||
50 | <%= error_messages_for :comment %> | 52 | <%= error_messages_for :comment %> |
51 | <% end %> | 53 | <% end %> |
52 | 54 | ||
53 | <div class="post_comment_box <%= ((defined? show_form) && show_form) ? 'opened' : 'closed' %>"> | 55 | <div class="post_comment_box <%= ((defined? show_form) && show_form) ? 'opened' : 'closed' %>"> |
54 | 56 | ||
55 | <%= link_to(_('Post a comment'), '#', :class => 'display-comment-form') if display_link && @comment.reply_of_id.blank? %> | 57 | <%= link_to(_('Post a comment'), '#', :class => 'display-comment-form') if display_link && @comment.reply_of_id.blank? %> |
56 | -<%= remote_form_for(:comment, comment, :url => {:profile => profile.identifier, :controller => 'comment', :action => (edition_mode ? 'update' : 'create'), :id => (edition_mode ? comment.id : @page.id)}, :html => { :class => 'comment_form' } ) do |f| %> | 58 | +<%= remote_form_for(:comment, @comment, :url => {:profile => profile.identifier, :controller => 'comment', :action => (edition_mode ? 'update' : 'create'), :id => (edition_mode ? @comment.id : @page.id)}, :html => { :class => 'comment_form' } ) do |f| %> |
57 | 59 | ||
58 | <%= required_fields_message %> | 60 | <%= required_fields_message %> |
59 | 61 | ||
@@ -79,7 +81,7 @@ function check_captcha(button, confirm_action) { | @@ -79,7 +81,7 @@ function check_captcha(button, confirm_action) { | ||
79 | <%= hidden_field_tag(:view, params[:view])%> | 81 | <%= hidden_field_tag(:view, params[:view])%> |
80 | <%= f.hidden_field(:reply_of_id) %> | 82 | <%= f.hidden_field(:reply_of_id) %> |
81 | 83 | ||
82 | - <%= @plugins.dispatch(:comment_form_extra_contents, local_assigns).collect { |content| instance_exec(&content) }.join("") %> | 84 | + <%= @plugins.dispatch(:comment_form_extra_contents, local_assigns.merge(:comment => @comment)).collect { |content| instance_exec(&content) }.join("") %> |
83 | 85 | ||
84 | <% button_bar do %> | 86 | <% button_bar do %> |
85 | <%= submit_button('add', _('Post comment'), :onclick => "if(check_captcha(this)) { save_comment(this) } else { check_captcha(this, save_comment)};return false;") %> | 87 | <%= submit_button('add', _('Post comment'), :onclick => "if(check_captcha(this)) { save_comment(this) } else { check_captcha(this, save_comment)};return false;") %> |
app/views/content_viewer/view_page.html.erb
@@ -80,35 +80,25 @@ | @@ -80,35 +80,25 @@ | ||
80 | </h3> | 80 | </h3> |
81 | <% end %> | 81 | <% end %> |
82 | 82 | ||
83 | - <% if @page.accept_comments? && @comments.count > 1 %> | 83 | + <% if @page.accept_comments? && @comments.present? && @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)) %> | 86 | + <%= hidden_field_tag("page_url", url_for(:controller=>'content_viewer', :action=>'view_page', :profile=>profile.identifier, :page => @page.explode_path)) %> |
87 | <%= javascript_include_tag "comment_order.js" %> | 87 | <%= javascript_include_tag "comment_order.js" %> |
88 | <div class="comment-order"> | 88 | <div class="comment-order"> |
89 | <%= 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 %> |
90 | <%= select_tag 'comment_order', options_for_select({_('Oldest first')=>'oldest', _('Newest first')=>'newest'}, @comment_order) %> | 90 | <%= select_tag 'comment_order', options_for_select({_('Oldest first')=>'oldest', _('Newest first')=>'newest'}, @comment_order) %> |
91 | <% end %> | 91 | <% end %> |
92 | </div> | 92 | </div> |
93 | - <% end %> | ||
94 | 93 | ||
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)) %> | ||
97 | - <%= javascript_include_tag "comment_order.js" %> | ||
98 | - <div class="comment-order"> | ||
99 | - <%= form_tag({:controller=>'content_viewer' , :action=>'view_page'}, {:method=>'get', :id=>"form_order"}) do %> | ||
100 | - <%= select_tag 'comment_order', options_for_select({_('Oldest first')=>'oldest', _('Newest first')=>'newest'}, @comment_order) %> | ||
101 | - <% end %> | ||
102 | - </div> | 94 | + <ul class="article-comments-list"> |
95 | + <%= render :partial => 'comment/comment', :collection => @comments %> | ||
96 | + <%= pagination_links @comments, :param_name => 'comment_page' %> | ||
97 | + </ul> | ||
103 | <% end %> | 98 | <% end %> |
104 | 99 | ||
105 | - <ul class="article-comments-list"> | ||
106 | - <%= render :partial => 'comment/comment', :collection => @comments %> | ||
107 | - <%= pagination_links @comments, :param_name => 'comment_page' %> | ||
108 | - </ul> | ||
109 | - | ||
110 | <% if @page.accept_comments? %> | 100 | <% if @page.accept_comments? %> |
111 | - <div id='page-comment-form' class='page-comment-form'><%= render :partial => 'comment/comment_form', :locals =>{:comment => Comment.new, :url => {:controller => :comment, :action => :create}, :display_link => true, :cancel_triggers_hide => true}%></div> | 101 | + <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> |
112 | <% end %> | 102 | <% end %> |
113 | </div><!-- end class="comments" --> | 103 | </div><!-- end class="comments" --> |
114 | 104 |
app/views/invite/_dialog_wait_loading.html.erb
app/views/invite/select_friends.html.erb
@@ -32,9 +32,7 @@ | @@ -32,9 +32,7 @@ | ||
32 | 32 | ||
33 | <br/> | 33 | <br/> |
34 | 34 | ||
35 | - <%= link_to_function(_('Personalize invitation mail'), nil) do |page| | ||
36 | - page['invitation-mail_template'].show | ||
37 | - end %> | 35 | + <%= link_to ('Personalize invitation mail'), nil, :onclick => "jQuery('#invitation-mail_template').show(); return false;" %> |
38 | 36 | ||
39 | <div id='invitation-mail_template' style='display:none'> | 37 | <div id='invitation-mail_template' style='display:none'> |
40 | <%= h _("Now enter an invitation message. You must keep the <url> code in your invitation text. When your friends receive the invitation e-mail, <url> will be replaced by a link that they need to click to activate their account. <user> and <friend> codes will be replaced by your name and friend name, but they are optional.") %> | 38 | <%= h _("Now enter an invitation message. You must keep the <url> code in your invitation text. When your friends receive the invitation e-mail, <url> will be replaced by a link that they need to click to activate their account. <user> and <friend> codes will be replaced by your name and friend name, but they are optional.") %> |
app/views/manage_products/_add_input.html.erb
1 | <div id='request_result_message' style='display: none'></div> | 1 | <div id='request_result_message' style='display: none'></div> |
2 | 2 | ||
3 | -<%= form_for(@input, | 3 | +<%= form_for(:input, |
4 | :url => {:action => 'add_input', :id => @product}, | 4 | :url => {:action => 'add_input', :id => @product}, |
5 | :html => {:method => 'post', :id => 'input-category-form'} | 5 | :html => {:method => 'post', :id => 'input-category-form'} |
6 | ) do |f| %> | 6 | ) do |f| %> |
app/views/manage_products/_categories_for_selection.html.erb
1 | <%= select_for_categories(categories, level) %> | 1 | <%= select_for_categories(categories, level) %> |
2 | 2 | ||
3 | -<% javascript_tag do %> | 3 | +<%= javascript_tag do %> |
4 | jQuery('#categories_container_wrapper').scrollTo('100%', 1000) | 4 | jQuery('#categories_container_wrapper').scrollTo('100%', 1000) |
5 | $('selected_category_id').value = <%= @category && @category.id %> | 5 | $('selected_category_id').value = <%= @category && @category.id %> |
6 | $('hierarchy_navigation').update('<%= escape_javascript(hierarchy_category_navigation(@category, :make_links => true)) %>') | 6 | $('hierarchy_navigation').update('<%= escape_javascript(hierarchy_category_navigation(@category, :make_links => true)) %>') |
app/views/manage_products/_certifiers_for_selection.html.erb
1 | <%= select_certifiers(@qualifier) + remove_qualifier_button %> | 1 | <%= select_certifiers(@qualifier) + remove_qualifier_button %> |
2 | -<% javascript_tag do %> | 2 | +<%= javascript_tag do %> |
3 | jQuery('#product-qualifiers-list *').removeClass('small-loading') | 3 | jQuery('#product-qualifiers-list *').removeClass('small-loading') |
4 | <% end %> | 4 | <% end %> |
app/views/manage_products/_display_name.html.erb
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | <h2><%= @product.name_with_unit %></h2> | 2 | <h2><%= @product.name_with_unit %></h2> |
3 | <%= edit_product_link_to_remote(@product, 'name', _('Edit name and unit'), :title => _('Click here to edit the name of your product and the unit')) %> | 3 | <%= edit_product_link_to_remote(@product, 'name', _('Edit name and unit'), :title => _('Click here to edit the name of your product and the unit')) %> |
4 | </div> | 4 | </div> |
5 | -<% javascript_tag do %> | 5 | +<%= javascript_tag do %> |
6 | $$('#display-product-category .hierarchy-category')[0].update('<%= | 6 | $$('#display-product-category .hierarchy-category')[0].update('<%= |
7 | escape_javascript(hierarchy_category_navigation( | 7 | escape_javascript(hierarchy_category_navigation( |
8 | @product.product_category, | 8 | @product.product_category, |
app/views/manage_products/_edit_input.html.erb
1 | -<%= form_for(@input, :url => {:controller => 'manage_products', :action => 'edit_input', :id => @input}, | 1 | +<%= form_for(:input, :url => {:controller => 'manage_products', :action => 'edit_input', :id => @input}, |
2 | :html => {:method => 'post', :id => "edit-input-#{ @input.id }-form"}) do |f| %> | 2 | :html => {:method => 'post', :id => "edit-input-#{ @input.id }-form"}) do |f| %> |
3 | 3 | ||
4 | <%= hidden_field_tag 'input-bar-update-url', @input.product.price_composition_bar_display_url, :class => 'bar-update-url' %> | 4 | <%= hidden_field_tag 'input-bar-update-url', @input.product.price_composition_bar_display_url, :class => 'bar-update-url' %> |
app/views/manage_products/_form.html.erb
1 | <%= error_messages_for :product %> <br/> | 1 | <%= error_messages_for :product %> <br/> |
2 | 2 | ||
3 | -<%= form_for :product, @product, :html => {:multipart => true }, :url => {:action => mode} do |f| %> | 3 | +<%= form_for :product, :html => {:multipart => true }, :url => {:action => mode} do |f| %> |
4 | <%= required_fields_message %> | 4 | <%= required_fields_message %> |
5 | 5 | ||
6 | <%= display_form_field( _('Name:'), f.text_field(:name) ) %> | 6 | <%= display_form_field( _('Name:'), f.text_field(:name) ) %> |
app/views/manage_products/_price_composition_bar.html.erb
1 | -<% javascript_tag do %> | 1 | +<%= javascript_tag do %> |
2 | var value = <%= @product.price_description_percentage %>; | 2 | var value = <%= @product.price_description_percentage %>; |
3 | var total_cost = <%= @product.total_production_cost %>; | 3 | var total_cost = <%= @product.total_production_cost %>; |
4 | var price = '<%= @product.formatted_value(:price) %>'; | 4 | var price = '<%= @product.formatted_value(:price) %>'; |
app/views/manage_products/new.html.erb
@@ -25,6 +25,6 @@ | @@ -25,6 +25,6 @@ | ||
25 | 25 | ||
26 | <% end %> | 26 | <% end %> |
27 | 27 | ||
28 | -<% javascript_tag do %> | 28 | +<%= javascript_tag do %> |
29 | toggleDisabled(<%= @category && @category.accept_products? ? 'true' : 'false' %>, $('save_and_continue')) | 29 | toggleDisabled(<%= @category && @category.accept_products? ? 'true' : 'false' %>, $('save_and_continue')) |
30 | <% end %> | 30 | <% end %> |
app/views/profile/report_abuse.html.erb
1 | -<%= form_for @abuse_report, :url => {:action => 'register_report'}, | 1 | +<%= form_for :abuse_report, :url => {:action => 'register_report'}, |
2 | :html => {:onsubmit => "return send_request(this)", :id => 'report-abuse-form'} do |f| %> | 2 | :html => {:onsubmit => "return send_request(this)", :id => 'report-abuse-form'} do |f| %> |
3 | <%= labelled_form_field('* ' + _('Report reasons'), f.text_area(:reason, :rows => 6, :cols => 60, :class => 'required')) %> | 3 | <%= labelled_form_field('* ' + _('Report reasons'), f.text_area(:reason, :rows => 6, :cols => 60, :class => 'required')) %> |
4 | <%= hidden_field_tag(:content_type, params[:content_type]) %> | 4 | <%= hidden_field_tag(:content_type, params[:content_type]) %> |
app/views/search/_image.html.erb
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | <% if ['jpg', 'jpeg', 'gif', 'png', 'tiff', 'svg'].include? extension %> | 5 | <% if ['jpg', 'jpeg', 'gif', 'png', 'tiff', 'svg'].include? extension %> |
6 | <%= link_to '', image.view_url, :class => "search-image-pic", :style => 'background-image: url(%s)'% image.public_filename(:thumb) %> | 6 | <%= link_to '', image.view_url, :class => "search-image-pic", :style => 'background-image: url(%s)'% image.public_filename(:thumb) %> |
7 | <% if image.width && image.height %> | 7 | <% if image.width && image.height %> |
8 | - <% javascript_tag do %> | 8 | + <%= javascript_tag do %> |
9 | image = jQuery('script').last().parent().find('.search-image-pic'); | 9 | image = jQuery('script').last().parent().find('.search-image-pic'); |
10 | des_width = parseInt(image.css('width')); | 10 | des_width = parseInt(image.css('width')); |
11 | des_height = parseInt(image.css('height')); | 11 | des_height = parseInt(image.css('height')); |
app/views/search/search_page.html.erb
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | <div style="clear: both"></div> | 4 | <div style="clear: both"></div> |
5 | 5 | ||
6 | <% if @asset == :product %> | 6 | <% if @asset == :product %> |
7 | - <% javascript_tag do %> | 7 | + <%= javascript_tag do %> |
8 | jQuery('.search-product-price-details').altBeautify(); | 8 | jQuery('.search-product-price-details').altBeautify(); |
9 | <% end %> | 9 | <% end %> |
10 | <% end %> | 10 | <% end %> |
app/views/shared/_dialog_error_messages.html.erb
app/views/shared/_numbers_only_javascript.html.erb
1 | -<% javascript_tag do %> | 1 | +<%= javascript_tag do %> |
2 | jQuery(".numbers-only").keypress(function(event) { | 2 | jQuery(".numbers-only").keypress(function(event) { |
3 | var separator = "<%= environment.currency_separator %>" | 3 | var separator = "<%= environment.currency_separator %>" |
4 | return numbersonly(event, separator) | 4 | return numbersonly(event, separator) |
app/views/shared/_redirect_via_javascript.html.erb
app/views/shared/update_categories.js.erb
1 | <% | 1 | <% |
2 | content = render :partial => 'shared/select_categories', | 2 | content = render :partial => 'shared/select_categories', |
3 | - :locals => {:object_name => 'article', :multiple => true}, :layout => false | 3 | + :locals => {:object_name => object_name, :multiple => true}, :layout => false |
4 | %> | 4 | %> |
5 | jQuery('#select-categories').html('<%= j(content) %>'); | 5 | jQuery('#select-categories').html('<%= j(content) %>'); |
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/delete_profile.feature
@@ -13,7 +13,6 @@ Feature: delete profile | @@ -13,7 +13,6 @@ Feature: delete profile | ||
13 | | sample-community | Sample Community | | 13 | | sample-community | Sample Community | |
14 | And "Maria Silva" is a member of "Sample Community" | 14 | And "Maria Silva" is a member of "Sample Community" |
15 | 15 | ||
16 | - @selenium | ||
17 | Scenario: deleting profile | 16 | Scenario: deleting profile |
18 | Given I am logged in as "joaosilva" | 17 | Given I am logged in as "joaosilva" |
19 | And I am on joaosilva's control panel | 18 | And I am on joaosilva's control panel |
@@ -46,7 +45,6 @@ Feature: delete profile | @@ -46,7 +45,6 @@ Feature: delete profile | ||
46 | When I follow "Community Info and settings" | 45 | When I follow "Community Info and settings" |
47 | Then I should see "Delete profile" | 46 | Then I should see "Delete profile" |
48 | 47 | ||
49 | - @selenium | ||
50 | Scenario: community admin deletes the community | 48 | Scenario: community admin deletes the community |
51 | Given "Joao Silva" is admin of "Sample Community" | 49 | Given "Joao Silva" is admin of "Sample Community" |
52 | And I am logged in as "joaosilva" | 50 | And I am logged in as "joaosilva" |
@@ -75,7 +73,6 @@ Feature: delete profile | @@ -75,7 +73,6 @@ Feature: delete profile | ||
75 | When I follow "Enterprise Info and settings" | 73 | When I follow "Enterprise Info and settings" |
76 | Then I should see "Delete profile" | 74 | Then I should see "Delete profile" |
77 | 75 | ||
78 | - @selenium | ||
79 | Scenario: enterprise admin deletes the enterprise | 76 | Scenario: enterprise admin deletes the enterprise |
80 | Given the following enterprise | 77 | Given the following enterprise |
81 | | identifier | name | | 78 | | identifier | name | |
@@ -101,7 +98,6 @@ Feature: delete profile | @@ -101,7 +98,6 @@ Feature: delete profile | ||
101 | And I go to /myprofile/sample-enterprise/profile_editor/destroy_profile | 98 | And I go to /myprofile/sample-enterprise/profile_editor/destroy_profile |
102 | Then I should see "Access denied" | 99 | Then I should see "Access denied" |
103 | 100 | ||
104 | - @selenium | ||
105 | Scenario: environment admin deletes profile | 101 | Scenario: environment admin deletes profile |
106 | Given I am logged in as admin | 102 | Given I am logged in as admin |
107 | And I am on joaosilva's control panel | 103 | And I am on joaosilva's control panel |
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" |
features/edit_profile.feature
@@ -34,11 +34,12 @@ Feature: edit profile | @@ -34,11 +34,12 @@ Feature: edit profile | ||
34 | | identifier | name | owner | | 34 | | identifier | name | owner | |
35 | | o-rappa | O Rappa | joao | | 35 | | o-rappa | O Rappa | joao | |
36 | And feature "enable_organization_url_change" is enabled on environment | 36 | And feature "enable_organization_url_change" is enabled on environment |
37 | - When I go to o-rappa's control panel | ||
38 | - And I follow "Community Info and settings" | ||
39 | - And I should not see "identifier-change-confirmation" | ||
40 | - When I fill in "Address" with "banda-o-rappa" | ||
41 | - And I should see "identifier-change-confirmation" | 37 | + And I go to o-rappa's control panel |
38 | + When I follow "Community Info and settings" | ||
39 | + Then I should not see "WARNING" within "#identifier-change-confirmation" | ||
40 | + And I fill in "Address" with "banda-o-rappa" | ||
41 | + When I leave the "#profile_data_identifier" field | ||
42 | + Then I should see "WARNING" within "#identifier-change-confirmation" | ||
42 | 43 | ||
43 | @selenium | 44 | @selenium |
44 | Scenario: Confirm url change | 45 | Scenario: Confirm url change |
@@ -46,12 +47,13 @@ Feature: edit profile | @@ -46,12 +47,13 @@ Feature: edit profile | ||
46 | | identifier | name | owner | | 47 | | identifier | name | owner | |
47 | | o-rappa | O Rappa | joao | | 48 | | o-rappa | O Rappa | joao | |
48 | And feature "enable_organization_url_change" is enabled on environment | 49 | And feature "enable_organization_url_change" is enabled on environment |
49 | - When I go to o-rappa's control panel | 50 | + And I go to o-rappa's control panel |
50 | And I follow "Community Info and settings" | 51 | And I follow "Community Info and settings" |
51 | - When I fill in "Address" with "banda-o-rappa" | ||
52 | - Then I should see "identifier-change-confirmation" | 52 | + And I fill in "Address" with "banda-o-rappa" |
53 | + When I leave the "#profile_data_identifier" field | ||
54 | + Then I should see "WARNING" within "#identifier-change-confirmation" | ||
53 | When I follow "Yes" | 55 | When I follow "Yes" |
54 | - Then "identifier-change-confirmation" should not be visible within "profile-identifier-formitem" | 56 | + Then I should not see "WARNING" within "#identifier-change-confirmation" |
55 | 57 | ||
56 | @selenium | 58 | @selenium |
57 | Scenario: Cancel url change | 59 | Scenario: Cancel url change |
@@ -59,9 +61,10 @@ Feature: edit profile | @@ -59,9 +61,10 @@ Feature: edit profile | ||
59 | | identifier | name | owner | | 61 | | identifier | name | owner | |
60 | | o-rappa | O Rappa | joao | | 62 | | o-rappa | O Rappa | joao | |
61 | And feature "enable_organization_url_change" is enabled on environment | 63 | And feature "enable_organization_url_change" is enabled on environment |
62 | - When I go to o-rappa's control panel | 64 | + And I go to o-rappa's control panel |
63 | And I follow "Community Info and settings" | 65 | And I follow "Community Info and settings" |
64 | - When I fill in "Address" with "banda-o-rappa" | ||
65 | - Then I should see "identifier-change-confirmation" | 66 | + And I fill in "Address" with "banda-o-rappa" |
67 | + When I leave the "#profile_data_identifier" field | ||
68 | + Then I should see "WARNING" within "#identifier-change-confirmation" | ||
66 | When I follow "No" | 69 | When I follow "No" |
67 | - Then "identifier-change-confirmation" should not be visible within "profile-identifier-formitem" | 70 | + Then I should not see "WARNING" within "#identifier-change-confirmation" |
features/forum.feature
@@ -14,7 +14,9 @@ Feature: forum | @@ -14,7 +14,9 @@ Feature: forum | ||
14 | Scenario: create a forum | 14 | Scenario: create a forum |
15 | Given I am on joaosilva's control panel | 15 | Given I am on joaosilva's control panel |
16 | And I follow "Manage Content" | 16 | And I follow "Manage Content" |
17 | + And I should see "New content" | ||
17 | And I follow "New content" | 18 | And I follow "New content" |
19 | + And I should see "Forum" | ||
18 | When I follow "Forum" | 20 | When I follow "Forum" |
19 | And I fill in "Title" with "My Forum" | 21 | And I fill in "Title" with "My Forum" |
20 | And I press "Save" | 22 | And I press "Save" |
@@ -97,6 +99,7 @@ Feature: forum | @@ -97,6 +99,7 @@ Feature: forum | ||
97 | And I check "Has terms of use:" | 99 | And I check "Has terms of use:" |
98 | And I press "Save" | 100 | And I press "Save" |
99 | When I follow "New discussion topic" | 101 | When I follow "New discussion topic" |
102 | + And I should see "Text article with visual editor" | ||
100 | And I follow "Text article with visual editor" | 103 | And I follow "Text article with visual editor" |
101 | And I fill in "Title" with "Topic" | 104 | And I fill in "Title" with "Topic" |
102 | And I press "Save" | 105 | And I press "Save" |
@@ -249,6 +252,7 @@ Feature: forum | @@ -249,6 +252,7 @@ Feature: forum | ||
249 | And I am logged in as "mariasilva" | 252 | And I am logged in as "mariasilva" |
250 | And I go to /sample-community/forum | 253 | And I go to /sample-community/forum |
251 | And I follow "New discussion topic" | 254 | And I follow "New discussion topic" |
255 | + And I should see "Text article with visual editor" | ||
252 | And I follow "Text article with visual editor" | 256 | And I follow "Text article with visual editor" |
253 | And I fill in "Title" with "Test" | 257 | And I fill in "Title" with "Test" |
254 | And I press "Save" | 258 | And I press "Save" |
@@ -274,11 +278,13 @@ Feature: forum | @@ -274,11 +278,13 @@ Feature: forum | ||
274 | And I am logged in as "mariasilva" | 278 | And I am logged in as "mariasilva" |
275 | And I go to /sample-community/forum | 279 | And I go to /sample-community/forum |
276 | And I follow "New discussion topic" | 280 | And I follow "New discussion topic" |
281 | + And I should see "Text article with visual editor" | ||
277 | And I follow "Text article with visual editor" | 282 | And I follow "Text article with visual editor" |
278 | And I fill in "Title" with "Test" | 283 | And I fill in "Title" with "Test" |
279 | And I press "Save" | 284 | And I press "Save" |
280 | And I go to /sample-community/forum/test | 285 | And I go to /sample-community/forum/test |
281 | And I follow "New discussion topic" | 286 | And I follow "New discussion topic" |
287 | + And I should see "Text article with visual editor" | ||
282 | And I follow "Text article with visual editor" | 288 | And I follow "Text article with visual editor" |
283 | And I fill in "Title" with "Test inside the topic page" | 289 | And I fill in "Title" with "Test inside the topic page" |
284 | And I press "Save" | 290 | And I press "Save" |
features/manage_fields.feature
@@ -58,6 +58,7 @@ Feature: check all manage fields | @@ -58,6 +58,7 @@ Feature: check all manage fields | ||
58 | Given I follow "Community's fields" | 58 | Given I follow "Community's fields" |
59 | And I check "community_active" | 59 | And I check "community_active" |
60 | And I press "save_community_fields" | 60 | And I press "save_community_fields" |
61 | + And I follow "Community's fields" | ||
61 | And I uncheck "community_active" | 62 | And I uncheck "community_active" |
62 | And I press "save_community_fields" | 63 | And I press "save_community_fields" |
63 | When I go to mycommunity's control panel | 64 | When I go to mycommunity's control panel |
@@ -69,6 +70,7 @@ Feature: check all manage fields | @@ -69,6 +70,7 @@ Feature: check all manage fields | ||
69 | Given I follow "Enterprise's fields" | 70 | Given I follow "Enterprise's fields" |
70 | And I check "enterprise_active" | 71 | And I check "enterprise_active" |
71 | And I press "save_enterprise_fields" | 72 | And I press "save_enterprise_fields" |
73 | + And I follow "Enterprise's fields" | ||
72 | And I uncheck "enterprise_active" | 74 | And I uncheck "enterprise_active" |
73 | And I press "save_enterprise_fields" | 75 | And I press "save_enterprise_fields" |
74 | When I go to paper-street's control panel | 76 | When I go to paper-street's control panel |
features/manage_inputs.feature
@@ -58,6 +58,7 @@ Feature: manage inputs | @@ -58,6 +58,7 @@ Feature: manage inputs | ||
58 | When I go to Rede Moinho's page of product Abbey Road | 58 | When I go to Rede Moinho's page of product Abbey Road |
59 | And I follow "Inputs" | 59 | And I follow "Inputs" |
60 | And I follow "Add the inputs or raw material used by this product" | 60 | And I follow "Add the inputs or raw material used by this product" |
61 | + And I should see "Cancel" within "#categories_selection_actionbar" | ||
61 | And I follow "Cancel" within "#categories_selection_actionbar" | 62 | And I follow "Cancel" within "#categories_selection_actionbar" |
62 | Then I should see "Abbey Road" | 63 | Then I should see "Abbey Road" |
63 | And I should see "Add the inputs or raw material used by this product" | 64 | And I should see "Add the inputs or raw material used by this product" |
@@ -199,6 +200,7 @@ Feature: manage inputs | @@ -199,6 +200,7 @@ Feature: manage inputs | ||
199 | When I go to Rede Moinho's page of product Abbey Road | 200 | When I go to Rede Moinho's page of product Abbey Road |
200 | And I follow "Inputs" | 201 | And I follow "Inputs" |
201 | And I follow "Edit" within ".input-details" | 202 | And I follow "Edit" within ".input-details" |
203 | + And I should see "Cancel" within ".edit_input" | ||
202 | And I follow "Cancel" within ".edit_input" | 204 | And I follow "Cancel" within ".edit_input" |
203 | And I follow "Edit" within ".input-details" | 205 | And I follow "Edit" within ".input-details" |
204 | Then I should see "Amount used" | 206 | Then I should see "Amount used" |
@@ -218,25 +220,6 @@ Feature: manage inputs | @@ -218,25 +220,6 @@ Feature: manage inputs | ||
218 | And I confirm the browser dialog | 220 | And I confirm the browser dialog |
219 | Then I should see "Add the inputs or raw material used by this product" | 221 | Then I should see "Add the inputs or raw material used by this product" |
220 | 222 | ||
221 | - @selenium | ||
222 | - Scenario: Remember in which tab I was | ||
223 | - Given the following products | ||
224 | - | owner | category | name | | ||
225 | - | redemoinho | Music | Depeche Mode | | ||
226 | - | redemoinho | Music | Manu Chao | | ||
227 | - And I am logged in as "joaosilva" | ||
228 | - When I go to Rede Moinho's page of product Depeche Mode | ||
229 | - Then I should see "Add some description to your product" | ||
230 | - And "Add the inputs or raw material used by this product" should not be visible within "#show_product" | ||
231 | - When I follow "Inputs and raw material" | ||
232 | - Then I should see "Add the inputs or raw material used by this product" | ||
233 | - And "Add some description to your product" should not be visible within "#show_product" | ||
234 | - When I go to Rede Moinho's page of product Manu Chao | ||
235 | - Then I should see "Add some description to your product" | ||
236 | - When I go to Rede Moinho's page of product Depeche Mode | ||
237 | - Then I should see "Add the inputs or raw material used by this product" | ||
238 | - And "Add some description to your product" should not be visible within "#show_product" | ||
239 | - | ||
240 | @selenium-fixme | 223 | @selenium-fixme |
241 | Scenario: Order input list | 224 | Scenario: Order input list |
242 | Given the following product_category | 225 | Given the following product_category |
features/step_definitions/invitation_steps.rb
1 | Given /^I invite email "(.+)" to join community "(.+)"$/ do |email, community| | 1 | Given /^I invite email "(.+)" to join community "(.+)"$/ do |email, community| |
2 | identifier = Community.find_by_name(community).identifier | 2 | identifier = Community.find_by_name(community).identifier |
3 | visit("/myprofile/#{identifier}/profile_members") | 3 | visit("/myprofile/#{identifier}/profile_members") |
4 | - click_link('Invite your friends to join 26 Bsslines') | 4 | + first(:link, "Invite your friends to join #{community}").click |
5 | click_button('Next') | 5 | click_button('Next') |
6 | fill_in('manual_import_addresses', :with => "#{email}") | 6 | fill_in('manual_import_addresses', :with => "#{email}") |
7 | click_link('Personalize invitation mail') | 7 | click_link('Personalize invitation mail') |
features/step_definitions/noosfero_steps.rb
@@ -4,7 +4,8 @@ Given /^the following users?$/ do |table| | @@ -4,7 +4,8 @@ Given /^the following users?$/ do |table| | ||
4 | person_data = item.dup | 4 | person_data = item.dup |
5 | person_data.delete("login") | 5 | person_data.delete("login") |
6 | category = Category.find_by_slug person_data.delete("category") | 6 | category = Category.find_by_slug person_data.delete("category") |
7 | - user = User.create!(:login => item[:login], :password => '123456', :password_confirmation => '123456', :email => item[:login] + "@example.com", :person_data => person_data) | 7 | + email = item[:email] || item[:login] + "@example.com" |
8 | + user = User.create!(:login => item[:login], :password => '123456', :password_confirmation => '123456', :email => email, :person_data => person_data) | ||
8 | user.activate | 9 | user.activate |
9 | p = user.person | 10 | p = user.person |
10 | p.categories << category if category | 11 | p.categories << category if category |
features/upload_files.feature
@@ -8,7 +8,6 @@ Feature: upload files | @@ -8,7 +8,6 @@ Feature: upload files | ||
8 | | joaosilva | Joao Silva | | 8 | | joaosilva | Joao Silva | |
9 | And I am logged in as "joaosilva" | 9 | And I am logged in as "joaosilva" |
10 | 10 | ||
11 | - @selenium | ||
12 | Scenario: provile links to upload files to community's gallery | 11 | Scenario: provile links to upload files to community's gallery |
13 | Given the following communities | 12 | Given the following communities |
14 | | identifier | name | owner | | 13 | | identifier | name | owner | |
@@ -16,12 +15,9 @@ Feature: upload files | @@ -16,12 +15,9 @@ Feature: upload files | ||
16 | And the following galleries | 15 | And the following galleries |
17 | | owner | name | | 16 | | owner | name | |
18 | | sample-community | Gallery test | | 17 | | sample-community | Gallery test | |
19 | - And I go to sample-community's profile | ||
20 | - And I follow "Profile" | ||
21 | - And I follow "0 pictures" | ||
22 | - And I should see "Upload files" | 18 | + And I go to article "Gallery test" |
19 | + Then I should see "Upload files" | ||
23 | 20 | ||
24 | - @selenium | ||
25 | Scenario: provile links to upload files to enterprise's gallery | 21 | Scenario: provile links to upload files to enterprise's gallery |
26 | Given the following enterprises | 22 | Given the following enterprises |
27 | | identifier | name | owner | | 23 | | identifier | name | owner | |
@@ -29,10 +25,8 @@ Feature: upload files | @@ -29,10 +25,8 @@ Feature: upload files | ||
29 | And the following galleries | 25 | And the following galleries |
30 | | owner | name | | 26 | | owner | name | |
31 | | sample-enterprise | Gallery test | | 27 | | sample-enterprise | Gallery test | |
32 | - And I go to sample-enterprise's profile | ||
33 | - And I follow "Profile" | ||
34 | - And I follow "0 pictures" | ||
35 | - And I should see "Upload files" | 28 | + And I go to article "Gallery test" |
29 | + Then I should see "Upload files" | ||
36 | 30 | ||
37 | Scenario: not provile links to upload files on blogs | 31 | Scenario: not provile links to upload files on blogs |
38 | Given the following communities | 32 | Given the following communities |
plugins/display_content/lib/display_content_block.rb
@@ -26,7 +26,7 @@ class DisplayContentBlock < Block | @@ -26,7 +26,7 @@ class DisplayContentBlock < Block | ||
26 | settings_items :display_folder_children, :type => :boolean, :default => true | 26 | settings_items :display_folder_children, :type => :boolean, :default => true |
27 | settings_items :types, :type => Array, :default => ['TextileArticle', 'TinyMceArticle', 'RawHTMLArticle'] | 27 | settings_items :types, :type => Array, :default => ['TextileArticle', 'TinyMceArticle', 'RawHTMLArticle'] |
28 | 28 | ||
29 | - attr_accessible :sections, :checked_nodes, :display_folder_children | 29 | + attr_accessible :sections, :checked_nodes, :display_folder_children, :types |
30 | 30 | ||
31 | def self.description | 31 | def self.description |
32 | _('Display your contents') | 32 | _('Display your contents') |
plugins/display_content/test/unit/display_content_block_test.rb
@@ -350,10 +350,11 @@ class DisplayContentBlockTest < ActiveSupport::TestCase | @@ -350,10 +350,11 @@ class DisplayContentBlockTest < ActiveSupport::TestCase | ||
350 | should 'list links for all articles title defined in nodes' do | 350 | should 'list links for all articles title defined in nodes' do |
351 | profile = create_user('testuser').person | 351 | profile = create_user('testuser').person |
352 | Article.delete_all | 352 | Article.delete_all |
353 | - a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id) | ||
354 | - a2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => profile.id) | 353 | + a1 = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id) |
354 | + a2 = fast_create(TextileArticle, :name => 'test article 2', :profile_id => profile.id) | ||
355 | 355 | ||
356 | block = DisplayContentBlock.new | 356 | block = DisplayContentBlock.new |
357 | + block.sections = [{:value => 'title', :checked => true}] | ||
357 | block.nodes = [a1.id, a2.id] | 358 | block.nodes = [a1.id, a2.id] |
358 | box = mock() | 359 | box = mock() |
359 | block.stubs(:box).returns(box) | 360 | block.stubs(:box).returns(box) |
@@ -366,8 +367,8 @@ class DisplayContentBlockTest < ActiveSupport::TestCase | @@ -366,8 +367,8 @@ class DisplayContentBlockTest < ActiveSupport::TestCase | ||
366 | should 'list content for all articles lead defined in nodes' do | 367 | should 'list content for all articles lead defined in nodes' do |
367 | profile = create_user('testuser').person | 368 | profile = create_user('testuser').person |
368 | Article.delete_all | 369 | Article.delete_all |
369 | - a1 = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id, :abstract => 'abstract article 1') | ||
370 | - a2 = fast_create(TextArticle, :name => 'test article 2', :profile_id => profile.id, :abstract => 'abstract article 2') | 370 | + a1 = fast_create(TinyMceArticle, :name => 'test article 1', :profile_id => profile.id, :abstract => 'abstract article 1') |
371 | + a2 = fast_create(TinyMceArticle, :name => 'test article 2', :profile_id => profile.id, :abstract => 'abstract article 2') | ||
371 | 372 | ||
372 | block = DisplayContentBlock.new | 373 | block = DisplayContentBlock.new |
373 | block.sections = [{:value => 'abstract', :checked => true}] | 374 | block.sections = [{:value => 'abstract', :checked => true}] |
@@ -421,7 +422,7 @@ class DisplayContentBlockTest < ActiveSupport::TestCase | @@ -421,7 +422,7 @@ class DisplayContentBlockTest < ActiveSupport::TestCase | ||
421 | 422 | ||
422 | should 'show title if defined by user' do | 423 | should 'show title if defined by user' do |
423 | profile = create_user('testuser').person | 424 | profile = create_user('testuser').person |
424 | - a = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id) | 425 | + a = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id) |
425 | 426 | ||
426 | block = DisplayContentBlock.new | 427 | block = DisplayContentBlock.new |
427 | block.nodes = [a.id] | 428 | block.nodes = [a.id] |
@@ -435,7 +436,7 @@ class DisplayContentBlockTest < ActiveSupport::TestCase | @@ -435,7 +436,7 @@ class DisplayContentBlockTest < ActiveSupport::TestCase | ||
435 | 436 | ||
436 | should 'show abstract if defined by user' do | 437 | should 'show abstract if defined by user' do |
437 | profile = create_user('testuser').person | 438 | profile = create_user('testuser').person |
438 | - a = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id, :abstract => 'some abstract') | 439 | + a = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id, :abstract => 'some abstract') |
439 | 440 | ||
440 | block = DisplayContentBlock.new | 441 | block = DisplayContentBlock.new |
441 | block.nodes = [a.id] | 442 | block.nodes = [a.id] |
@@ -449,7 +450,7 @@ class DisplayContentBlockTest < ActiveSupport::TestCase | @@ -449,7 +450,7 @@ class DisplayContentBlockTest < ActiveSupport::TestCase | ||
449 | 450 | ||
450 | should 'show body if defined by user' do | 451 | should 'show body if defined by user' do |
451 | profile = create_user('testuser').person | 452 | profile = create_user('testuser').person |
452 | - a = fast_create(TextArticle, :name => 'test article 1', :profile_id => profile.id, :body => 'some body') | 453 | + a = fast_create(TextileArticle, :name => 'test article 1', :profile_id => profile.id, :body => 'some body') |
453 | 454 | ||
454 | block = DisplayContentBlock.new | 455 | block = DisplayContentBlock.new |
455 | block.nodes = [a.id] | 456 | block.nodes = [a.id] |
@@ -577,7 +578,7 @@ class DisplayContentBlockTest < ActiveSupport::TestCase | @@ -577,7 +578,7 @@ class DisplayContentBlockTest < ActiveSupport::TestCase | ||
577 | block.types = ['TinyMceArticle'] | 578 | block.types = ['TinyMceArticle'] |
578 | 579 | ||
579 | block.types = ['TinyMceArticle', 'Folder'] | 580 | block.types = ['TinyMceArticle', 'Folder'] |
580 | - assert_equal [TinyMceArticle, Folder, UploadedFile, Event, TextileArticle, RawHTMLArticle, Blog, Forum, Gallery, RssFeed], block.available_content_types | 581 | + assert_equivalent [TinyMceArticle, Folder, UploadedFile, Event, TextileArticle, RawHTMLArticle, Blog, Forum, Gallery, RssFeed], block.available_content_types |
581 | end | 582 | end |
582 | 583 | ||
583 | should 'return available content types' do | 584 | should 'return available content types' do |
@@ -585,7 +586,7 @@ class DisplayContentBlockTest < ActiveSupport::TestCase | @@ -585,7 +586,7 @@ class DisplayContentBlockTest < ActiveSupport::TestCase | ||
585 | block = DisplayContentBlock.create! | 586 | block = DisplayContentBlock.create! |
586 | block.types = ['TinyMceArticle'] | 587 | block.types = ['TinyMceArticle'] |
587 | block.types = [] | 588 | block.types = [] |
588 | - assert_equal [UploadedFile, Event, TinyMceArticle, TextileArticle, RawHTMLArticle, Folder, Blog, Forum, Gallery, RssFeed], block.available_content_types | 589 | + assert_equivalent [UploadedFile, Event, TinyMceArticle, TextileArticle, RawHTMLArticle, Folder, Blog, Forum, Gallery, RssFeed], block.available_content_types |
589 | end | 590 | end |
590 | 591 | ||
591 | should 'return first 2 content types' do | 592 | should 'return first 2 content types' do |
@@ -629,7 +630,7 @@ class DisplayContentBlockTest < ActiveSupport::TestCase | @@ -629,7 +630,7 @@ class DisplayContentBlockTest < ActiveSupport::TestCase | ||
629 | Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([SomePlugin.new]) | 630 | Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([SomePlugin.new]) |
630 | 631 | ||
631 | block.types = [] | 632 | block.types = [] |
632 | - assert_equal [UploadedFile, Event, TinyMceArticle, TextileArticle, RawHTMLArticle, Folder, Blog, Forum, Gallery, RssFeed, SomePluginContent], block.available_content_types | 633 | + assert_equivalent [UploadedFile, Event, TinyMceArticle, TextileArticle, RawHTMLArticle, Folder, Blog, Forum, Gallery, RssFeed, SomePluginContent], block.available_content_types |
633 | end | 634 | end |
634 | 635 | ||
635 | should 'do not fail if a selected article was removed' do | 636 | should 'do not fail if a selected article was removed' do |
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/javascripts/edit-link-list.js
@@ -29,6 +29,13 @@ function new_link_action(){ | @@ -29,6 +29,13 @@ function new_link_action(){ | ||
29 | jQuery(document).scrollTop(jQuery('#dropable-link-list').scrollTop()); | 29 | jQuery(document).scrollTop(jQuery('#dropable-link-list').scrollTop()); |
30 | } | 30 | } |
31 | 31 | ||
32 | +function add_new_link() { | ||
33 | + var new_link = jQuery('#edit-link-list-block #new-template>li').clone(); | ||
34 | + new_link.show(); | ||
35 | + jQuery('#dropable-link-list').append(new_link); | ||
36 | + new_link_action(); | ||
37 | +} | ||
38 | + | ||
32 | jQuery(document).ready(function(){ | 39 | jQuery(document).ready(function(){ |
33 | new_link_action(); | 40 | new_link_action(); |
34 | 41 | ||
@@ -36,4 +43,4 @@ jQuery(document).ready(function(){ | @@ -36,4 +43,4 @@ jQuery(document).ready(function(){ | ||
36 | revert: true, | 43 | revert: true, |
37 | axis: "y" | 44 | axis: "y" |
38 | }); | 45 | }); |
39 | -}); | ||
40 | \ No newline at end of file | 46 | \ No newline at end of file |
47 | +}); |
public/javascripts/search.js
@@ -3,8 +3,8 @@ | @@ -3,8 +3,8 @@ | ||
3 | $('#search-content .pagination a').live('click', function () { | 3 | $('#search-content .pagination a').live('click', function () { |
4 | $.ajax({ | 4 | $.ajax({ |
5 | url: this.href, | 5 | url: this.href, |
6 | - beforeSend: function(){$('#search-content').addClass('searching')}, | ||
7 | - complete: function() {$('#search-content').removeClass('searching')}, | 6 | + beforeSend: function(){$('#search-content').addClass('fetching')}, |
7 | + complete: function() {$('#search-content').removeClass('fetching')}, | ||
8 | dataType: 'script' | 8 | dataType: 'script' |
9 | }) | 9 | }) |
10 | return false; | 10 | return false; |
@@ -23,8 +23,8 @@ | @@ -23,8 +23,8 @@ | ||
23 | $.ajax({ | 23 | $.ajax({ |
24 | url: this.action, | 24 | url: this.action, |
25 | data: $(this).serialize(), | 25 | data: $(this).serialize(), |
26 | - beforeSend: function(){$('#search-content').addClass('searching')}, | ||
27 | - complete: function() {$('#search-content').removeClass('searching')}, | 26 | + beforeSend: function(){$('#search-content').addClass('fetching')}, |
27 | + complete: function() {$('#search-content').removeClass('fetching')}, | ||
28 | dataType: 'script' | 28 | dataType: 'script' |
29 | }) | 29 | }) |
30 | return false; | 30 | return false; |
public/stylesheets/application.css
@@ -1864,6 +1864,9 @@ a.button.disabled, input.disabled { | @@ -1864,6 +1864,9 @@ a.button.disabled, input.disabled { | ||
1864 | position: relative; | 1864 | position: relative; |
1865 | left: -24px; | 1865 | left: -24px; |
1866 | } | 1866 | } |
1867 | +#edit-link-list-block #new-template { | ||
1868 | + display: none; | ||
1869 | +} | ||
1867 | .link-list-header { | 1870 | .link-list-header { |
1868 | width: 98%; | 1871 | width: 98%; |
1869 | height: 25px; | 1872 | height: 25px; |
@@ -6691,6 +6694,6 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { | @@ -6691,6 +6694,6 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { | ||
6691 | color: green; | 6694 | color: green; |
6692 | } | 6695 | } |
6693 | 6696 | ||
6694 | -#search-content.searching { | 6697 | +.fetching { |
6695 | opacity: 0.3; | 6698 | opacity: 0.3; |
6696 | } | 6699 | } |
script/install-dependencies/debian-wheezy.sh
@@ -131,4 +131,4 @@ packages=$(grep-dctrl -n -s Build-Depends,Depends,Recommends -S -X noosfero debi | @@ -131,4 +131,4 @@ packages=$(grep-dctrl -n -s Build-Depends,Depends,Recommends -S -X noosfero debi | ||
131 | run sudo apt-get -y install $packages | 131 | run sudo apt-get -y install $packages |
132 | sudo apt-get -y install iceweasel || sudo apt-get -y install firefox | 132 | sudo apt-get -y install iceweasel || sudo apt-get -y install firefox |
133 | 133 | ||
134 | -run bundle --local | 134 | +run bundle install |
script/quick-start
@@ -52,6 +52,7 @@ else | @@ -52,6 +52,7 @@ else | ||
52 | # special case Debian-based systems; in others people will have to install | 52 | # special case Debian-based systems; in others people will have to install |
53 | # lsb-release by themselves | 53 | # lsb-release by themselves |
54 | if which apt-get >/dev/null 2>&1; then | 54 | if which apt-get >/dev/null 2>&1; then |
55 | + sudo apt-get update | ||
55 | sudo apt-get -y install lsb-release | 56 | sudo apt-get -y install lsb-release |
56 | else | 57 | else |
57 | complain "E: lsb_release not available! (Try installing the lsb-release package)" | 58 | complain "E: lsb_release not available! (Try installing the lsb-release package)" |