diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 8108526..b885133 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -233,13 +233,6 @@ module ApplicationHelper link_to(content_tag('span', text), url, html_options.merge(:class => the_class, :title => text)) end - def button_bar(options = {}, &block) - options[:class].nil? ? - options[:class]='button-bar' : - options[:class]+=' button-bar' - concat(content_tag('div', capture(&block).to_s + tag('br', :style => 'clear: left;'), options)) - end - def render_profile_actions klass name = klass.to_s.underscore begin diff --git a/app/helpers/buttons_helper.rb b/app/helpers/buttons_helper.rb index 7eb46ff..18b5a52 100644 --- a/app/helpers/buttons_helper.rb +++ b/app/helpers/buttons_helper.rb @@ -1,4 +1,17 @@ module ButtonsHelper + + def button_bar(options = {}, &block) + options[:class] ||= '' + options[:class] << ' button-bar' + + content_tag :div, options do + [ + capture(&block).to_s, + tag(:br, style: 'clear: left;'), + ].safe_join + end + end + def button(type, label, url, html_options = {}) html_options ||= {} the_class = 'with-text' diff --git a/app/views/account/_login_form.html.erb b/app/views/account/_login_form.html.erb index 56660c0..2bbb4a9 100644 --- a/app/views/account/_login_form.html.erb +++ b/app/views/account/_login_form.html.erb @@ -11,7 +11,7 @@ <%= hidden_field_tag :terms_accepted, params[:terms_accepted] %> <% end %> -<% button_bar do %> +<%= button_bar do %> <%= submit_button( 'login', _('Log in') )%> <%= modal_close_button _('Cancel') if request.xhr? %> <% end %> diff --git a/app/views/account/accept_terms.html.erb b/app/views/account/accept_terms.html.erb index 404f944..5086668 100644 --- a/app/views/account/accept_terms.html.erb +++ b/app/views/account/accept_terms.html.erb @@ -20,7 +20,7 @@ <%= hidden_field_tag :answer, params[:answer] %> <%= labelled_check_box(environment.terms_of_use_acceptance_text.blank? ? _('I read the terms of use and accepted them') : environment.terms_of_use_acceptance_text, :terms_accepted, '1', false, :id => 'accept-terms') %> - <% button_bar do %> + <%= button_bar do %> <%= button 'cancel', _('Cancel'), :controller => 'home', :action => 'index' %> <%= submit_button 'forward', _('Continue'), {:disabled => true, :class => 'disabled', :id => 'submit-accept-terms'} %> <% end %> diff --git a/app/views/account/activation_question.html.erb b/app/views/account/activation_question.html.erb index 554cbaa..e0fd21f 100644 --- a/app/views/account/activation_question.html.erb +++ b/app/views/account/activation_question.html.erb @@ -24,7 +24,7 @@

<%= _('Enterprise activation') + ' - ' + (logged_in? ? _('part 1 of 2') : _('part 1 of 3')) %>

- <%= form_tag( {:action => 'accept_terms'}, {:method => 'get', :onsubmit => (@question == :foundation_year ? 'return check_valid_year(this)' : 'return check_valid_cnpj(this)')}) do %> + <%= form_tag( {:action => 'accept_terms'}, {:method => 'get', :onsubmit => (@question == :foundation_year ? 'return check_valid_year(this)' : 'return check_valid_cnpj(this)')}) do %>

<%= _('Pay atention! You have only one chance!') %>

@@ -34,7 +34,7 @@ <%= hidden_field_tag :enterprise_code, params[:enterprise_code] %> - <% button_bar do %> + <%= button_bar do %> <%= button 'cancel', _('Cancel'), :action => 'index' %> <%= submit_button 'forward', _('Continue') %> <% end %> diff --git a/app/views/account/forgot_password.html.erb b/app/views/account/forgot_password.html.erb index bbe6cda..eba3c4f 100644 --- a/app/views/account/forgot_password.html.erb +++ b/app/views/account/forgot_password.html.erb @@ -9,7 +9,7 @@ <%= recaptcha_tags(:display => { :theme => 'clean' }, :ajax => true) %>
- <% button_bar do %> + <%= button_bar do %> <%= submit_button('send', _('Send instructions')) %> <% end %>
diff --git a/app/views/account/login.html.erb b/app/views/account/login.html.erb index 42fc127..620c1d8 100644 --- a/app/views/account/login.html.erb +++ b/app/views/account/login.html.erb @@ -22,7 +22,7 @@ <%= safe_join(@plugins.dispatch(:login_extra_contents).collect { |content| instance_exec(&content) }, "") %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button( 'login', _('Log in') )%> <% if is_popin %> <%= modal_close_button(_('Cancel')) %> @@ -31,7 +31,7 @@ <% end %> -<% button_bar do %> +<%= button_bar do %> <% unless @plugins.dispatch(:allow_user_registration).include?(false) %> <%= button :add, _("New user"), :controller => 'account', :action => 'signup' %> <% end %> diff --git a/app/views/account/login_block.html.erb b/app/views/account/login_block.html.erb index 8298c96..86a89e5 100644 --- a/app/views/account/login_block.html.erb +++ b/app/views/account/login_block.html.erb @@ -17,7 +17,7 @@ <%= safe_join(@plugins.dispatch(:login_extra_contents).collect { |content| instance_eval(&content) }, "") %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button( 'login', _('Log in') )%> <% unless @plugins.dispatch(:allow_user_registration).include?(false) %> <%= button(:add, _('New user'), { :controller => 'account', :action => 'signup' }) %> diff --git a/app/views/account/logout_popup.html.erb b/app/views/account/logout_popup.html.erb index a16bbfa..15d8e36 100644 --- a/app/views/account/logout_popup.html.erb +++ b/app/views/account/logout_popup.html.erb @@ -1,6 +1,6 @@

<%= _('Are you sure you want to get out?') %>

-<% button_bar do %> +<%= button_bar do %> <%= button :ok, _('Yes'), { :controller => 'account', :action => 'logout' } %> <%= modal_close_button _('No, I want to stay.') %> <% end %> diff --git a/app/views/account/new_password.html.erb b/app/views/account/new_password.html.erb index e4326c7..6da120b 100644 --- a/app/views/account/new_password.html.erb +++ b/app/views/account/new_password.html.erb @@ -10,7 +10,7 @@ <%= labelled_form_field(_('Enter new password'), (f.password_field :password)) %> <%= labelled_form_field(_('Confirm the new password'), (f.password_field :password_confirmation)) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:ok, _('Change password')) %> <% end %> diff --git a/app/views/account/welcome.html.erb b/app/views/account/welcome.html.erb index 21956a8..17c9ed3 100644 --- a/app/views/account/welcome.html.erb +++ b/app/views/account/welcome.html.erb @@ -3,8 +3,8 @@ <%= _('%s was successfuly activated. Now you may go to your control panel or to the control panel of your enterprise') % @enterprise.name %> - <% button_bar do %> - <%= button 'forward', _('Go to my control panel'), :action => 'index', :controller => 'profile_editor', :profile => current_user.person.identifier %> + <%= button_bar do %> + <%= button 'forward', _('Go to my control panel'), :action => 'index', :controller => 'profile_editor', :profile => current_user.person.identifier %> <%= button 'forward', _('Go to my enterprise control panel') % @enterprise.name, :action => 'index', :controller => 'profile_editor', :profile => @enterprise.identifier %> <% end %> <% end %> diff --git a/app/views/admin_panel/message_for_disabled_enterprise.html.erb b/app/views/admin_panel/message_for_disabled_enterprise.html.erb index ebe1503..10c6947 100644 --- a/app/views/admin_panel/message_for_disabled_enterprise.html.erb +++ b/app/views/admin_panel/message_for_disabled_enterprise.html.erb @@ -6,7 +6,7 @@ <%= f.text_area :message_for_disabled_enterprise, :cols => 40, :style => 'width: 90%' %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:save, _('Save')) %> <%= button(:cancel, _('Cancel'), :action => 'index') %> <% end %> diff --git a/app/views/admin_panel/set_portal_community.html.erb b/app/views/admin_panel/set_portal_community.html.erb index e027d25..0d8c141 100644 --- a/app/views/admin_panel/set_portal_community.html.erb +++ b/app/views/admin_panel/set_portal_community.html.erb @@ -4,14 +4,14 @@ <%= form_tag do %> <%= labelled_form_field(_('Portal identifier'), text_field_tag('portal_community_identifier', @portal_community.identifier, :size => 40) ) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button 'save', _('Save'), :cancel => { :action => 'index' } %> <% end %> <% end %> <% else %> <%= _('Portal identifier: %s').html_safe % link_to(@portal_community.identifier, @portal_community.url) %> - <% button_bar do %> + <%= button_bar do %> <%if @portal_community.environment.enabled?('use_portal_community') %> <%= button 'cancel', _('Disable'), {:action => 'manage_portal_community', :activate => 0} %> <% else %> diff --git a/app/views/admin_panel/set_portal_folders.html.erb b/app/views/admin_panel/set_portal_folders.html.erb index a3f0aaa..56ad834 100644 --- a/app/views/admin_panel/set_portal_folders.html.erb +++ b/app/views/admin_panel/set_portal_folders.html.erb @@ -37,7 +37,7 @@ <%= _('The same order in which you arrange the folders here will be used for arranging the boxes in the environment initial page.') %>

- <% button_bar do %> + <%= button_bar do %> <%= submit_button 'save', _('Save'), :cancel => {:action => 'index'} %> <% end %> <% end %> diff --git a/app/views/admin_panel/set_portal_news_amount.html.erb b/app/views/admin_panel/set_portal_news_amount.html.erb index 9358fce..311c092 100644 --- a/app/views/admin_panel/set_portal_news_amount.html.erb +++ b/app/views/admin_panel/set_portal_news_amount.html.erb @@ -6,7 +6,7 @@ <%= labelled_form_field _('Number of portal news'), select(:environment, :portal_news_amount, (0..10).to_a) %> <%= labelled_form_field _('Number of news by folder'), select(:environment, :news_amount_by_folder, (1..10).to_a) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:save, _('Save')) %> <%= button(:cancel, _('Cancel'), :action => 'index') %> <% end %> diff --git a/app/views/admin_panel/site_info.html.erb b/app/views/admin_panel/site_info.html.erb index 54d3ea8..3d9ee97 100644 --- a/app/views/admin_panel/site_info.html.erb +++ b/app/views/admin_panel/site_info.html.erb @@ -20,7 +20,7 @@ <% tabs << {:title => _('Signup introduction text'), :id => 'signup-intro', :content => (render :partial => 'signup_intro', :locals => {:f => f})} %> <%= render_tabs(tabs) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:save, _('Save'), :cancel => {:action => 'index'}) %> <% end %> <% end %> diff --git a/app/views/box_organizer/edit.html.erb b/app/views/box_organizer/edit.html.erb index fc64686..8eb4aed 100644 --- a/app/views/box_organizer/edit.html.erb +++ b/app/views/box_organizer/edit.html.erb @@ -35,7 +35,7 @@
<% end %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:save, _('Save')) %> <%= modal_close_button(_('Cancel')) %> <% end %> diff --git a/app/views/box_organizer/index.html.erb b/app/views/box_organizer/index.html.erb index 89ab1ee..db13e26 100644 --- a/app/views/box_organizer/index.html.erb +++ b/app/views/box_organizer/index.html.erb @@ -3,7 +3,7 @@

<%= _('Editing sideboxes')%>

-<% button_bar :class=>'design-menu' do %> +<%= button_bar :class=>'design-menu' do %> <%= button(:back, _('Back to control panel'), :controller => (profile.nil? ? 'admin_panel': 'profile_editor')) %> <% end %> diff --git a/app/views/categories/_form.html.erb b/app/views/categories/_form.html.erb index ab0af31..d8e4a8b 100644 --- a/app/views/categories/_form.html.erb +++ b/app/views/categories/_form.html.erb @@ -28,7 +28,7 @@ <%= file_field_or_thumbnail(_('Image:'), @category.image, i) %> <% end %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button('save', _('Save'), :cancel => {:action => 'index'}) %> <% end%> <% end %> diff --git a/app/views/cms/_media_new_folder.html.erb b/app/views/cms/_media_new_folder.html.erb index 17b927d..757fc46 100644 --- a/app/views/cms/_media_new_folder.html.erb +++ b/app/views/cms/_media_new_folder.html.erb @@ -9,7 +9,7 @@ <%= labelled_radio_button _('Folder'), :folder_type, 'Folder', false %> <%= labelled_form_field _('Name:'), text_field_tag(:new_folder, nil, 'data-url' => url_for({:action => 'new', :profile => profile.identifier})) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:newfolder, _('Create')) %> <% end %> <% end %> diff --git a/app/views/cms/_upload_file_form.html.erb b/app/views/cms/_upload_file_form.html.erb index 95c80ff..2400e4c 100644 --- a/app/views/cms/_upload_file_form.html.erb +++ b/app/views/cms/_upload_file_form.html.erb @@ -12,7 +12,7 @@ <%= hidden_field_tag('back_to', @back_to) %> -<% button_bar do %> +<%= button_bar do %> <%= button_to_function :add, _('More files'), "add_new_file_fields()" %> <% if @back_to %> <%= submit_button :save, _('Upload'), :cancel => @back_to %> diff --git a/app/views/cms/destroy.html.erb b/app/views/cms/destroy.html.erb index 953f5c7..6498690 100644 --- a/app/views/cms/destroy.html.erb +++ b/app/views/cms/destroy.html.erb @@ -12,7 +12,7 @@ <% end %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button :save, _('Yes, I want.') %> <%= button :cancel, _("No, I don't want."), @article.url %> <% end %> diff --git a/app/views/cms/edit.html.erb b/app/views/cms/edit.html.erb index e2ddf2f..527df2f 100644 --- a/app/views/cms/edit.html.erb +++ b/app/views/cms/edit.html.erb @@ -21,7 +21,7 @@ <% end %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button :save, _('Save') %> <%= submit_button :save, _('Save and continue'), :name => "continue" %> <% end %> @@ -48,7 +48,7 @@ <%= options_for_article(@article, @tokenized_children) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button :save, _('Save') %> <% if @back_to %> diff --git a/app/views/cms/publish.html.erb b/app/views/cms/publish.html.erb index 39016ee..555311f 100644 --- a/app/views/cms/publish.html.erb +++ b/app/views/cms/publish.html.erb @@ -25,7 +25,7 @@ <%= hidden_field_tag :back_to, @back_to %> <%= labelled_form_field _('Title'), text_field_tag('name', @article.name) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button 'spread', _('Spread this') %> <% end %> <% end %> @@ -41,7 +41,7 @@ <% search_action = url_for(:action => 'search_communities_to_publish') %> <%= token_input_field_tag(:q, 'search-communities-to-publish', search_action, { :hint_text => _('Type in a search for your community'), :zindex => 10000, :focus => false }) %> <%= labelled_form_field _('Title'), text_field_tag('name', @article.name) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button 'spread', _('Spread this') %> <% end %> <% end %> @@ -58,7 +58,7 @@ <%= hidden_field_tag :back_to, @back_to %> <%= labelled_form_field _('Title'), text_field_tag('name', @article.name) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button 'spread', _('Spread this') %> <% end %> <% end %> diff --git a/app/views/cms/publish_on_portal_community.html.erb b/app/views/cms/publish_on_portal_community.html.erb index 3bb375b..2d41c80 100644 --- a/app/views/cms/publish_on_portal_community.html.erb +++ b/app/views/cms/publish_on_portal_community.html.erb @@ -5,7 +5,7 @@ <%= hidden_field_tag :back_to, @back_to %> <%= labelled_text_field _('Title') + ': ', :name, @article.name, :style => 'width: 100%' %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button 'spread', _('Spread this'), :cancel => @back_to %> <% end %> <% end %> @@ -14,7 +14,7 @@ <%= _("There is no portal community in this environment.") %> - <% button_bar do %> + <%= button_bar do %> <%= button :back, _('Back'), :controller => 'cms' %> <% end %> <% end %> diff --git a/app/views/cms/suggest_an_article.html.erb b/app/views/cms/suggest_an_article.html.erb index 885db31..2ea330e 100644 --- a/app/views/cms/suggest_an_article.html.erb +++ b/app/views/cms/suggest_an_article.html.erb @@ -23,7 +23,7 @@ <%= recaptcha_tags(:display => { :theme => 'clean' }, :ajax => true) unless logged_in? %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button :save, _('Save') %> <%= button :cancel, _('Cancel'), @back_to %> <% end %> diff --git a/app/views/cms/view.html.erb b/app/views/cms/view.html.erb index 12c4d77..692a886 100644 --- a/app/views/cms/view.html.erb +++ b/app/views/cms/view.html.erb @@ -14,7 +14,7 @@ <% end %> -<% button_bar(:style => 'margin-bottom: 1em;') do %> +<%= button_bar(:style => 'margin-bottom: 1em;') do %> <% parent_id = ((@article && @article.allow_children?) ? @article : nil) %> <%= modal_button('new', _('New content'), url_for({:action => 'new', :parent_id => parent_id, :cms => true}).html_safe) %> diff --git a/app/views/cms/why_categorize.html.erb b/app/views/cms/why_categorize.html.erb index e15432f..4aabbc4 100644 --- a/app/views/cms/why_categorize.html.erb +++ b/app/views/cms/why_categorize.html.erb @@ -4,6 +4,6 @@ <%= _('By categorizing your content, you increase the possibility that other people access it. When they are looking for, say, articles about Bahia and you categorize your article in "Regions/Bahia", then there is a good change that your article is going to be found.') %>

-<% button_bar do %> +<%= button_bar do %> <%= modal_close_button _('Close') %> <% end %> diff --git a/app/views/comment/_comment_form.html.erb b/app/views/comment/_comment_form.html.erb index 0e206a0..743ce15 100644 --- a/app/views/comment/_comment_form.html.erb +++ b/app/views/comment/_comment_form.html.erb @@ -8,7 +8,7 @@ <% end %> -<% button_bar do %> +<%= button_bar do %> <%= button :back, _('Go back'), { :controller => 'profile' } %> <% if profile.community? and user %> <% if user.has_permission?(:invite_members, profile) %> diff --git a/app/views/profile_editor/destroy_profile.html.erb b/app/views/profile_editor/destroy_profile.html.erb index a79dee2..d8d76d3 100644 --- a/app/views/profile_editor/destroy_profile.html.erb +++ b/app/views/profile_editor/destroy_profile.html.erb @@ -3,7 +3,7 @@

<%= _('Are you sure you want to delete this profile?') %>

<%= _('You must be aware that all content of this profile (articles, events, files and pictures) will also be deleted.') %>

-<% button_bar do %> +<%= button_bar do %> <%= button(:remove, _('Yes, I am sure'), {:action => 'destroy_profile'}, :method => :post) %> <%= button(:cancel, _('No, I gave up'), profile.url) %> <% end %> diff --git a/app/views/profile_editor/edit.html.erb b/app/views/profile_editor/edit.html.erb index b84c53b..2bc3c45 100644 --- a/app/views/profile_editor/edit.html.erb +++ b/app/views/profile_editor/edit.html.erb @@ -67,13 +67,13 @@ <%= select_categories(:profile_data, _('Select the categories of your interest'), 2) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button('save', _('Save'), :cancel => {:action => 'index'}) %> <%= button(:back, _('Back to control panel'), :controller => 'profile_editor') %> <% end %> <% if user && user.has_permission?('destroy_profile', profile) %> - <% button_bar(:id => 'delete-profile') do %> + <%= button_bar(:id => 'delete-profile') do %> <% if !environment.enabled?('forbid_destroy_profile') || user.is_admin?(environment) %> <%= button(:remove, _('Delete profile'), {:action => :destroy_profile}) %> diff --git a/app/views/profile_editor/header_footer.html.erb b/app/views/profile_editor/header_footer.html.erb index 643ff57..cc464ee 100644 --- a/app/views/profile_editor/header_footer.html.erb +++ b/app/views/profile_editor/header_footer.html.erb @@ -24,7 +24,7 @@ <%= text_area_tag(:custom_header, @header, :style => 'width: 100%; height: 150px;', :class => 'mceEditor') %>

<%= _('Content for footer') %>

<%= text_area_tag(:custom_footer, @footer, :style => 'width: 100%; height: 150px;', :class => 'mceEditor') %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:save, _('Save')) %> <%= button(:cancel, _('Cancel'), :action => 'index') %> <% end %> diff --git a/app/views/profile_editor/welcome_page.html.erb b/app/views/profile_editor/welcome_page.html.erb index 7705885..f04add4 100644 --- a/app/views/profile_editor/welcome_page.html.erb +++ b/app/views/profile_editor/welcome_page.html.erb @@ -13,7 +13,7 @@ <%= _('This page will be displayed to the user after his signup with this template.') %> - <% button_bar do%> + <%= button_bar do%> <%= submit_button('save', _('Save'), :cancel => @back_to) %> <% end %> <% end %> diff --git a/app/views/profile_members/_index_buttons.html.erb b/app/views/profile_members/_index_buttons.html.erb index 49ce882..a340821 100644 --- a/app/views/profile_members/_index_buttons.html.erb +++ b/app/views/profile_members/_index_buttons.html.erb @@ -1,4 +1,4 @@ -<% button_bar do %> +<%= button_bar do %> <%= button :back, _('Back'), :controller => 'profile_editor' %> <%= button :add, _('Add members'), :action => 'add_members' if profile.enterprise? %> <% if profile.community? and user.has_permission?(:invite_members, profile) %> diff --git a/app/views/profile_members/_manage_roles.html.erb b/app/views/profile_members/_manage_roles.html.erb index cc41e79..cab667e 100644 --- a/app/views/profile_members/_manage_roles.html.erb +++ b/app/views/profile_members/_manage_roles.html.erb @@ -5,7 +5,7 @@ <%= hidden_field_tag(:last_admin, true) if from == 'last_admin'%> <% end %> - <% button_bar(:style => 'margin-top: 30px;') do %> + <%= button_bar(:style => 'margin-top: 30px;') do %> <%= submit_button('save', _('Save'))%> <%= button('cancel', _('Cancel'), {:controller => 'profile_editor'})%> <% end %> diff --git a/app/views/profile_members/affiliate.html.erb b/app/views/profile_members/affiliate.html.erb index d113aff..2c37284 100644 --- a/app/views/profile_members/affiliate.html.erb +++ b/app/views/profile_members/affiliate.html.erb @@ -3,7 +3,7 @@ <%= form_tag( {:action => 'give_role'}, {:method => :post}) do %> <%= select_tag 'role', options_for_select(@roles.map{|r|[r.name,r.id]}) %> <%= hidden_field_tag 'person', current_user.person.id %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button('affiliate', _('Affiliate'), :cancel => {:action => 'index'}) %> <% end %> <% end %> diff --git a/app/views/profile_members/change_role.html.erb b/app/views/profile_members/change_role.html.erb index 08692f9..f392eef 100644 --- a/app/views/profile_members/change_role.html.erb +++ b/app/views/profile_members/change_role.html.erb @@ -24,7 +24,7 @@ <% end %> <%= hidden_field_tag 'person', @member.id %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button('save', _('Save changes'), :cancel => {:action => 'index'}) %> <% end %> <% end %> diff --git a/app/views/profile_roles/_form.html.erb b/app/views/profile_roles/_form.html.erb index 02b90ee..8640191 100644 --- a/app/views/profile_roles/_form.html.erb +++ b/app/views/profile_roles/_form.html.erb @@ -16,7 +16,7 @@ <% end %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button('save', (mode == :edit) ? _('Save changes') : _('Create role'), :cancel => {:action => 'index'} ) %> <% end %> <% end %> diff --git a/app/views/profile_roles/assign.html.erb b/app/views/profile_roles/assign.html.erb index 51baf7d..bd7d424 100644 --- a/app/views/profile_roles/assign.html.erb +++ b/app/views/profile_roles/assign.html.erb @@ -17,7 +17,7 @@ <%=token_input_field_tag(:person_id, 'search-profile-members', {:action => 'assign_role_by_members'}, {:focus => false, :hint_text => _('Select members to assign the role')}) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:forward, _("Confirm")) %> <% end %> @@ -28,7 +28,7 @@ <% @roles_list.each do |role| %> <%= labelled_radio_button role.name , :selected_role, role.id , false, :class => "selected_role" %>
<% end %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button('save',_('Confirm'), :cancel => {:action => 'index'} ) %> <% end %> diff --git a/app/views/profile_roles/destroy.html.erb b/app/views/profile_roles/destroy.html.erb index 4e5384f..492674b 100644 --- a/app/views/profile_roles/destroy.html.erb +++ b/app/views/profile_roles/destroy.html.erb @@ -4,7 +4,7 @@

<%= _('This role is not being currently used.')%>

<%= _('Are you sure you want to delete this role?') %>

- <% button_bar do %> + <%= button_bar do %> <%= button(:remove, _('Yes, I am sure'), {:action => 'remove', :id => @role.id}, :method => :post) %> <%= button(:cancel, _('No, I gave up'), {:action => 'index'}) %> <% end %> @@ -16,7 +16,7 @@ <%= check_box_tag("roles[]", role.id, false ,{:id => role.key}) %> <%= content_tag(:label, role.name, { :for => role.key }) %>
<% end %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button('save',_('Delete role'), :cancel => {:action => 'index'} ) %> <% end %> <% end %> diff --git a/app/views/profile_roles/index.html.erb b/app/views/profile_roles/index.html.erb index 3720375..0f883d3 100644 --- a/app/views/profile_roles/index.html.erb +++ b/app/views/profile_roles/index.html.erb @@ -21,7 +21,7 @@ <% end %> -<% button_bar do %> +<%= button_bar do %> <%= button :add, _('Create a new role'), :action => 'new' %> <%= button :back, _('Back to control panel'), :controller => 'profile_editor' %> <% end %> diff --git a/app/views/profile_roles/show.html.erb b/app/views/profile_roles/show.html.erb index 97da59e..e78ea96 100644 --- a/app/views/profile_roles/show.html.erb +++ b/app/views/profile_roles/show.html.erb @@ -3,11 +3,11 @@

<%= _('Permissions') %>

-<% button_bar do %> +<%= button_bar do %> <%= button :edit, _('Edit'), :action => 'edit', :id => @role %> <%= button :back, _('Back to roles management'), :action => 'index' %> <% end %> diff --git a/app/views/profile_themes/add_css.html.erb b/app/views/profile_themes/add_css.html.erb index 859594e..d698622 100644 --- a/app/views/profile_themes/add_css.html.erb +++ b/app/views/profile_themes/add_css.html.erb @@ -3,7 +3,7 @@ <%= form_tag do %> <%= labelled_form_field(_('File name'), text_field_tag('css')) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:add, _('Add')) %> <%= modal_close_button _('Cancel') %> <% end %> diff --git a/app/views/profile_themes/add_image.html.erb b/app/views/profile_themes/add_image.html.erb index e2c8747..bb22549 100644 --- a/app/views/profile_themes/add_image.html.erb +++ b/app/views/profile_themes/add_image.html.erb @@ -1,6 +1,6 @@ <%= form_tag({:action => 'add_image', :id => @theme.id}, :multipart => true) do %> <%= labelled_form_field(_('Choose the image file'), file_field_tag(:image)) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:add, _('Add image')) %> <% end %> <% end %> diff --git a/app/views/profile_themes/css_editor.html.erb b/app/views/profile_themes/css_editor.html.erb index a0e4adc..f0d6391 100644 --- a/app/views/profile_themes/css_editor.html.erb +++ b/app/views/profile_themes/css_editor.html.erb @@ -3,7 +3,7 @@ <%= form_tag({:action => 'update_css', :id => @theme.id }, :name => 'csscode_form') do %> <%= hidden_field_tag('css', @css) %> <%= text_area_tag('csscode', @code, :id => "codepressWindow", :class => 'codepress css') %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:save, _('Save')) %> <% end %> <% end %> diff --git a/app/views/profile_themes/edit.html.erb b/app/views/profile_themes/edit.html.erb index fe5438e..a5811e0 100644 --- a/app/views/profile_themes/edit.html.erb +++ b/app/views/profile_themes/edit.html.erb @@ -15,7 +15,7 @@
  • <%= link_to_remote(css, :url => { :action => 'css_editor', :id => @theme.id, :css => css }, :update => { :success => 'css-code' }) %>
  • <% end %> - <% button_bar do %> + <%= button_bar do %> <%= modal_button :add, _('New CSS'), :action => 'add_css', :id => @theme.id %> <% end %> @@ -27,7 +27,7 @@
  • <%= image_tag("/user_themes/#{@theme.id}/images/#{image}") %>
  • <% end %> - <% button_bar do %> + <%= button_bar do %> <%= modal_button :add, _('Add image'), :action => 'add_image', :id => @theme.id %> <% end %> diff --git a/app/views/profile_themes/index.html.erb b/app/views/profile_themes/index.html.erb index 71ec863..ac8cc6b 100644 --- a/app/views/profile_themes/index.html.erb +++ b/app/views/profile_themes/index.html.erb @@ -40,7 +40,7 @@
    -<% button_bar do %> +<%= button_bar do %> <% if environment.enabled?('user_themes') %> <%= modal_button :add, _('New theme ...'), :action => 'new' %> <% end %> diff --git a/app/views/profile_themes/new.html.erb b/app/views/profile_themes/new.html.erb index 440a06a..31c6218 100644 --- a/app/views/profile_themes/new.html.erb +++ b/app/views/profile_themes/new.html.erb @@ -4,7 +4,7 @@ <%= labelled_form_field(_('Name of the new theme:'), text_field_tag(:name)) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:save, _('Create')) %> <% end %> <% end %> diff --git a/app/views/region_validators/_search.html.erb b/app/views/region_validators/_search.html.erb index d10ce23..0d90a76 100644 --- a/app/views/region_validators/_search.html.erb +++ b/app/views/region_validators/_search.html.erb @@ -5,7 +5,7 @@ <%= item.name %> <%= form_tag :action => 'add', :id => @region do %> <%= hidden_field_tag :validator_id, item.id %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button('add', _('Add')) %> <% end %> <% end %> diff --git a/app/views/region_validators/region.html.erb b/app/views/region_validators/region.html.erb index 6fc6e78..71e087a 100644 --- a/app/views/region_validators/region.html.erb +++ b/app/views/region_validators/region.html.erb @@ -19,7 +19,7 @@ <%= form_tag({}, { :method => 'get' }) do %> <%= text_field_tag :search, nil, :id => 'search_validator' %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button('search', _('Search')) %> <% end %> <% end %> diff --git a/app/views/role/_form.html.erb b/app/views/role/_form.html.erb index 02b90ee..8640191 100644 --- a/app/views/role/_form.html.erb +++ b/app/views/role/_form.html.erb @@ -16,7 +16,7 @@ <% end %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button('save', (mode == :edit) ? _('Save changes') : _('Create role'), :cancel => {:action => 'index'} ) %> <% end %> <% end %> diff --git a/app/views/role/index.html.erb b/app/views/role/index.html.erb index ee77070..99bfa0b 100644 --- a/app/views/role/index.html.erb +++ b/app/views/role/index.html.erb @@ -17,7 +17,7 @@ <% end %> -<% button_bar do %> +<%= button_bar do %> <%= button :add, _('Create a new role'), :action => 'new' %> <%= button :back, _('Back to admin panel'), :controller => 'admin_panel' %> <% end %> diff --git a/app/views/role/show.html.erb b/app/views/role/show.html.erb index 97da59e..e78ea96 100644 --- a/app/views/role/show.html.erb +++ b/app/views/role/show.html.erb @@ -3,11 +3,11 @@

    <%= _('Permissions') %>

    -<% button_bar do %> +<%= button_bar do %> <%= button :edit, _('Edit'), :action => 'edit', :id => @role %> <%= button :back, _('Back to roles management'), :action => 'index' %> <% end %> diff --git a/app/views/search/tag.html.erb b/app/views/search/tag.html.erb index a73397e..795a0c8 100644 --- a/app/views/search/tag.html.erb +++ b/app/views/search/tag.html.erb @@ -2,7 +2,7 @@ <%= _('Tagged with "%s"').html_safe % content_tag('code', @tag) %> -<% button_bar do %> +<%= button_bar do %> <%= button('back', _('Back to tag cloud'), :action => 'tags') %> <% end %> diff --git a/app/views/shared/_list_groups.html.erb b/app/views/shared/_list_groups.html.erb index 04177ec..2f260eb 100644 --- a/app/views/shared/_list_groups.html.erb +++ b/app/views/shared/_list_groups.html.erb @@ -11,7 +11,7 @@ <%= raw _('Description: %s') % group.description + '
    ' if group.community? %> <%= _('Members: %s') % group.members_count.to_s %>
    <%= _('Created at: %s') % show_date(group.created_at) unless group.enterprise? %>
    - <% button_bar do %> + <%= button_bar do %> <% if user.has_permission?(:edit_profile, group) %> <%= button 'menu-ctrl-panel', _('Control panel of this group'), group.admin_url %> <% end %> diff --git a/app/views/shared/access_denied.html.erb b/app/views/shared/access_denied.html.erb index 0d3a084..c68021e 100644 --- a/app/views/shared/access_denied.html.erb +++ b/app/views/shared/access_denied.html.erb @@ -9,7 +9,7 @@

    <%= _("If you are supposed to have access to this area, you'll probably want to talk to the people responsible and ask them to give you access.") %>

    <% end %> - <% button_bar do %> + <%= button_bar do %> <%= button :back, _('Go back'), :back %> <%= button :home, _('Go to the site home page'), :controller => 'home' %> <% end %> diff --git a/app/views/shared/not_found.html.erb b/app/views/shared/not_found.html.erb index 6edbe37..9c58798 100644 --- a/app/views/shared/not_found.html.erb +++ b/app/views/shared/not_found.html.erb @@ -4,7 +4,7 @@ <%= _('You may have clicked an expired link or mistyped the address.') %> <%= _('If you clicked a link that was in another site, or was given to you by someone else, it would be nice if you tell them that their link is not valid anymore.') %>

    - <% button_bar do %> + <%= button_bar do %> <%= button :back, _('Go back'), :back %> <%= button :home, _('Go to the home page'), '/' %> <% end %> diff --git a/app/views/shared/theme_test_panel.html.erb b/app/views/shared/theme_test_panel.html.erb index ce51487..c120373 100644 --- a/app/views/shared/theme_test_panel.html.erb +++ b/app/views/shared/theme_test_panel.html.erb @@ -5,7 +5,7 @@

    <%= _('You can move this window away to have a better visualization of specific parts of screen.') %>

    - <% button_bar do %> + <%= button_bar do %> <%= button(:ok, _('Finished testing'), :controller => 'profile_themes', :profile => theme_owner, :action => 'stop_test', :id => current_theme) %> <%= button(:edit, _('Edit theme'), :controller => 'profile_themes', :profile => theme_owner, :action => 'edit', :id => current_theme) %> <% end %> diff --git a/app/views/spam/_task.html.erb b/app/views/spam/_task.html.erb index fc2ae35..57cabe2 100644 --- a/app/views/spam/_task.html.erb +++ b/app/views/spam/_task.html.erb @@ -7,7 +7,7 @@ <%= yield %> <%# ??? %> - <% button_bar do %> + <%= button_bar do %> <%= button_to_function('new', _('Mark as NOT SPAM'), 'removeTaskBox(this, %s, "%s", "")' % [url_for(:mark_task_as_ham => task.id).to_json, "task-#{task.id}"]) %> <%= yield :extra_buttons %> <%= button_to_function('delete', _('Remove'), 'removeTaskBox(this, %s, "%s", %s)' % [url_for(:profile => params[:profile], :remove_task => task.id).to_json, "task-#{task.id}", _('Are you sure you want to remove this article suggestion?').to_json]) %> diff --git a/app/views/spam/index.html.erb b/app/views/spam/index.html.erb index 36af68e..0d7a74e 100644 --- a/app/views/spam/index.html.erb +++ b/app/views/spam/index.html.erb @@ -6,7 +6,7 @@ <%= _('There are no spams to review.') if no_tabs %> -<% button_bar do %> +<%= button_bar do %> <%= button :back, _('Back to control panel'), :controller => :profile_editor %> <% end %> @@ -20,7 +20,7 @@ <%= render_tabs(tabs) %> <% unless no_tabs %> - <% button_bar do %> + <%= button_bar do %> <%= button :back, _('Back to control panel'), :controller => :profile_editor %> <% end %> <% end %> diff --git a/app/views/tasks/index.html.erb b/app/views/tasks/index.html.erb index 2a30675..9fda5b3 100644 --- a/app/views/tasks/index.html.erb +++ b/app/views/tasks/index.html.erb @@ -41,7 +41,7 @@

    <% else %> <%= form_tag tasks_url(:action => 'close') do%> - <% button_bar(:class => 'task-actions') do %> + <%= button_bar(:class => 'task-actions') do %> <%# FiXME button(:edit, _('View my requests'), :action => 'list_requested') %> <%# FIXME button('menu-mail', _('Send request'), :action => 'new') %> <%= submit_button :save, _("Apply!") %> @@ -71,7 +71,7 @@ <%= pagination_links(@tasks)%> - <% button_bar(:class => 'task-actions') do %> + <%= button_bar(:class => 'task-actions') do %> <%# FiXME button(:edit, _('View my requests'), :action => 'list_requested') %> <%# FIXME button('menu-mail', _('Send request'), :action => 'new') %> <%= submit_button :save, _("Apply!") %> diff --git a/app/views/tasks/list_requested.html.erb b/app/views/tasks/list_requested.html.erb index 2a1a48b..956c989 100644 --- a/app/views/tasks/list_requested.html.erb +++ b/app/views/tasks/list_requested.html.erb @@ -13,6 +13,6 @@ <% end %> -<% button_bar do %> +<%= button_bar do %> <%= button :back, _('Back'), :action => 'index' %> <% end %> diff --git a/app/views/tasks/new.html.erb b/app/views/tasks/new.html.erb index c540fc6..6770c0e 100644 --- a/app/views/tasks/new.html.erb +++ b/app/views/tasks/new.html.erb @@ -11,7 +11,7 @@ <%= f.text_field :title, :style => 'width:80%;' %> <%= f.text_area :message, :style => 'height:200px; width:80%;' %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:ok, _('Send'), :cancel => {:action => 'index'}) %> <% end %> <% end %> diff --git a/app/views/tasks/processed.html.erb b/app/views/tasks/processed.html.erb index d331f68..d48900c 100644 --- a/app/views/tasks/processed.html.erb +++ b/app/views/tasks/processed.html.erb @@ -48,7 +48,7 @@ <% end %>

    -<% button_bar do %> +<%= button_bar do %> <%= button(:back, _('Back'), :action => 'index') %> <% end %> diff --git a/app/views/tasks/ticket_details.html.erb b/app/views/tasks/ticket_details.html.erb index 9376731..b384368 100644 --- a/app/views/tasks/ticket_details.html.erb +++ b/app/views/tasks/ticket_details.html.erb @@ -14,6 +14,6 @@

    <%= _('Closing statement: %s') % @ticket.closing_statment %>

    <% end %> -<% button_bar do %> +<%= button_bar do %> <%= button :back, _('Back'), :action => 'index' %> <% end %> diff --git a/app/views/templates/_create_template_form.html.erb b/app/views/templates/_create_template_form.html.erb index 49fe4dc..f4697c0 100644 --- a/app/views/templates/_create_template_form.html.erb +++ b/app/views/templates/_create_template_form.html.erb @@ -11,7 +11,7 @@ <%= form_tag do %> <%= labelled_text_field(_('Name')+': ', :name)%> - <% button_bar do %> + <%= button_bar do %> <%= submit_button('save', _('Save'))%> <%= button('cancel', _('Cancel'), {:action => 'index'})%> <% end %> diff --git a/app/views/templates/index.html.erb b/app/views/templates/index.html.erb index 7ae642a..62ad1b7 100644 --- a/app/views/templates/index.html.erb +++ b/app/views/templates/index.html.erb @@ -40,6 +40,6 @@ <% end %> -<% button_bar do %> +<%= button_bar do %> <%= button :back, _('Back to admin panel'), :controller => 'admin_panel' %> <% end %> diff --git a/app/views/trusted_sites/edit.html.erb b/app/views/trusted_sites/edit.html.erb index 80dabd5..789cc31 100644 --- a/app/views/trusted_sites/edit.html.erb +++ b/app/views/trusted_sites/edit.html.erb @@ -5,7 +5,7 @@ <%= text_field_tag :site, @site %> <%= hidden_field_tag :orig_site, @site %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button('save', _('Save changes'), :cancel => {:action => 'index'} ) %> <% end %> <% end %> diff --git a/app/views/trusted_sites/index.html.erb b/app/views/trusted_sites/index.html.erb index c4ee3e2..9b40b0f 100644 --- a/app/views/trusted_sites/index.html.erb +++ b/app/views/trusted_sites/index.html.erb @@ -22,7 +22,7 @@ <% end %> -<% button_bar do %> +<%= button_bar do %> <%= button :add, _('Add a trusted site'), :action => 'new' %> <%= button :back, _('Back to admin panel'), :controller => 'admin_panel' %> <% end %> diff --git a/app/views/trusted_sites/new.html.erb b/app/views/trusted_sites/new.html.erb index bc45b3c..a38134f 100644 --- a/app/views/trusted_sites/new.html.erb +++ b/app/views/trusted_sites/new.html.erb @@ -4,7 +4,7 @@ <%= text_field_tag :site, @site %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button('save', _('Add trusted site'), :cancel => {:action => 'index'} ) %> <% end %> <% end %> diff --git a/app/views/users/_index_buttons.html.erb b/app/views/users/_index_buttons.html.erb index 7eeeaed..240fbc1 100644 --- a/app/views/users/_index_buttons.html.erb +++ b/app/views/users/_index_buttons.html.erb @@ -1,4 +1,4 @@ -<% button_bar do %> +<%= button_bar do %> <%= button :'text-plain', _('User list as [CSV]'), :action => 'download.csv' %> <%= button :'text-html', _('User list as [XML]'), :action => 'download.xml' %> <%= button :send, _('Send e-mail to users'), :action => 'send_mail' %> diff --git a/plugins/admin_notifications/views/shared/_form.html.erb b/plugins/admin_notifications/views/shared/_form.html.erb index 44e9409..0dbccab 100644 --- a/plugins/admin_notifications/views/shared/_form.html.erb +++ b/plugins/admin_notifications/views/shared/_form.html.erb @@ -31,7 +31,7 @@ <%= labelled_check_box(_("Display popup until user close the notification"), 'notifications[display_popup]', '1', @notification.display_popup?) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button 'save', _('Save'), :cancel => { :action => 'index' } %> <% end %> diff --git a/plugins/anti_spam/views/anti_spam_plugin_admin/index.html.erb b/plugins/anti_spam/views/anti_spam_plugin_admin/index.html.erb index c539b4d..3fa4ab2 100644 --- a/plugins/anti_spam/views/anti_spam_plugin_admin/index.html.erb +++ b/plugins/anti_spam/views/anti_spam_plugin_admin/index.html.erb @@ -6,7 +6,7 @@ <%= labelled_form_field _('API key'), f.text_field(:api_key, :size => 40) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:save, c_('Save'), :cancel => {:controller => 'plugins', :action => 'index'}) %> <% end %> diff --git a/plugins/classify_members/views/classify_members_plugin_admin/index.html.erb b/plugins/classify_members/views/classify_members_plugin_admin/index.html.erb index 69ca4a0..1bd5543 100644 --- a/plugins/classify_members/views/classify_members_plugin_admin/index.html.erb +++ b/plugins/classify_members/views/classify_members_plugin_admin/index.html.erb @@ -15,7 +15,7 @@ <%=_('salvador-ba: Soteropolitano')%> - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:save, _('Save'), :cancel => {:controller => 'plugins', :action => 'index'}) %> <% end %> diff --git a/plugins/comment_classification/views/comment_classification_plugin_labels/_form.html.erb b/plugins/comment_classification/views/comment_classification_plugin_labels/_form.html.erb index 9c0a303..3b5cfbd 100644 --- a/plugins/comment_classification/views/comment_classification_plugin_labels/_form.html.erb +++ b/plugins/comment_classification/views/comment_classification_plugin_labels/_form.html.erb @@ -7,7 +7,7 @@ <%= labelled_form_field(_('Color'), f.select(:color, @colors.map{|s|[s.capitalize,s]})) %> <%= labelled_form_field(f.check_box(:enabled) + _('Enable this label?'),'') %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button('save', c_('Save'), :cancel => {:action => 'index'} ) %> <% end %> <% end %> diff --git a/plugins/comment_classification/views/comment_classification_plugin_labels/index.html.erb b/plugins/comment_classification/views/comment_classification_plugin_labels/index.html.erb index 1d421c3..4a41491 100644 --- a/plugins/comment_classification/views/comment_classification_plugin_labels/index.html.erb +++ b/plugins/comment_classification/views/comment_classification_plugin_labels/index.html.erb @@ -25,7 +25,7 @@ <% end %> - <% button_bar do %> + <%= button_bar do %> <%= button(:add, _('Add a new label'), :action => 'create')%> <%= button :back, c_('Back to admin panel'), :controller => 'admin_panel' %> <% end %> diff --git a/plugins/comment_classification/views/comment_classification_plugin_myprofile/_status_form.html.erb b/plugins/comment_classification/views/comment_classification_plugin_myprofile/_status_form.html.erb index fddeeec..00089dd 100644 --- a/plugins/comment_classification/views/comment_classification_plugin_myprofile/_status_form.html.erb +++ b/plugins/comment_classification/views/comment_classification_plugin_myprofile/_status_form.html.erb @@ -6,7 +6,7 @@ <%= labelled_form_field(_('Status'), f.select(:status_id, @statuses.map{|s|[s.name,s.id]})) %> <%= labelled_form_field(_('Reason:'), f.text_area(:reason, :rows => 5)) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button('save', c_('Save') ) %> <% end %> <% end %> diff --git a/plugins/comment_classification/views/comment_classification_plugin_status/_form.html.erb b/plugins/comment_classification/views/comment_classification_plugin_status/_form.html.erb index f63496f..9fce1bc 100644 --- a/plugins/comment_classification/views/comment_classification_plugin_status/_form.html.erb +++ b/plugins/comment_classification/views/comment_classification_plugin_status/_form.html.erb @@ -7,7 +7,7 @@ <%= labelled_form_field(f.check_box(:enabled) + _('Enable this status?'),'') %> <%#= labelled_form_field(f.check_box(:enable_reason) + _('This status allows reason?'),'') %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button('save', c_('Save'), :cancel => {:action => 'index'} ) %> <% end %> <% end %> diff --git a/plugins/comment_classification/views/comment_classification_plugin_status/index.html.erb b/plugins/comment_classification/views/comment_classification_plugin_status/index.html.erb index 6494622..d488df5 100644 --- a/plugins/comment_classification/views/comment_classification_plugin_status/index.html.erb +++ b/plugins/comment_classification/views/comment_classification_plugin_status/index.html.erb @@ -25,7 +25,7 @@ <% end %> - <% button_bar do %> + <%= button_bar do %> <%= button(:add, _('Add a new status'), :action => 'create')%> <%= button :back, c_('Back to admin panel'), :controller => 'admin_panel' %> <% end %> diff --git a/plugins/comment_paragraph/views/comment_paragraph_plugin_admin/index.html.erb b/plugins/comment_paragraph/views/comment_paragraph_plugin_admin/index.html.erb index d0637dd..4602cd6 100644 --- a/plugins/comment_paragraph/views/comment_paragraph_plugin_admin/index.html.erb +++ b/plugins/comment_paragraph/views/comment_paragraph_plugin_admin/index.html.erb @@ -17,7 +17,7 @@ - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:save, _('Save'), :cancel => {:controller => 'plugins', :action => 'index'}) %> <% end %> diff --git a/plugins/community_track/views/community_track_plugin_public/select_community.html.erb b/plugins/community_track/views/community_track_plugin_public/select_community.html.erb index 6754c38..a7581c0 100644 --- a/plugins/community_track/views/community_track_plugin_public/select_community.html.erb +++ b/plugins/community_track/views/community_track_plugin_public/select_community.html.erb @@ -12,7 +12,7 @@ <% end %> -<% button_bar do %> +<%= button_bar do %> <%= button(:add, c_('Create a new community'), :controller => 'memberships', :action => 'new_community', :profile => user.identifier, :back_to => @back_to) %> <% end %> diff --git a/plugins/custom_forms/views/custom_forms_plugin_myprofile/_form.html.erb b/plugins/custom_forms/views/custom_forms_plugin_myprofile/_form.html.erb index 0273e9e..8e757c8 100644 --- a/plugins/custom_forms/views/custom_forms_plugin_myprofile/_form.html.erb +++ b/plugins/custom_forms/views/custom_forms_plugin_myprofile/_form.html.erb @@ -55,7 +55,7 @@ <%= button(:add, _('Add a new select field'), '#', :onclick => "customFormsPlugin.addFields(this, 'fields', #{CGI::escapeHTML(html_for_field(f, :fields, CustomFormsPlugin::SelectField).to_json)}); return false")%> -<% button_bar do %> +<%= button_bar do %> <%= submit_button :save, c_('Save'), :cancel => {:action => 'index'}%> <% end %> diff --git a/plugins/custom_forms/views/custom_forms_plugin_myprofile/pending.html.erb b/plugins/custom_forms/views/custom_forms_plugin_myprofile/pending.html.erb index 69f8f21..4034fa3 100644 --- a/plugins/custom_forms/views/custom_forms_plugin_myprofile/pending.html.erb +++ b/plugins/custom_forms/views/custom_forms_plugin_myprofile/pending.html.erb @@ -22,6 +22,6 @@ <% end %> -<% button_bar do %> +<%= button_bar do %> <%= button :back, _('Back to forms'), :action => 'index' %> <% end %> diff --git a/plugins/custom_forms/views/custom_forms_plugin_myprofile/show_submission.html.erb b/plugins/custom_forms/views/custom_forms_plugin_myprofile/show_submission.html.erb index 62f3962..cc5c40a 100644 --- a/plugins/custom_forms/views/custom_forms_plugin_myprofile/show_submission.html.erb +++ b/plugins/custom_forms/views/custom_forms_plugin_myprofile/show_submission.html.erb @@ -44,7 +44,7 @@ <% end %> -<% button_bar do %> +<%= button_bar do %> <%= button :back, _('Back to submissions'), :action => 'submissions', :id => @form.id %> <% end %> diff --git a/plugins/custom_forms/views/custom_forms_plugin_myprofile/submissions.html.erb b/plugins/custom_forms/views/custom_forms_plugin_myprofile/submissions.html.erb index a80c87f..25a041c 100644 --- a/plugins/custom_forms/views/custom_forms_plugin_myprofile/submissions.html.erb +++ b/plugins/custom_forms/views/custom_forms_plugin_myprofile/submissions.html.erb @@ -27,7 +27,7 @@ <% end %> -<% button_bar do %> +<%= button_bar do %> <%= button :back, _('Back to forms'), :action => 'index' %> <% end %> diff --git a/plugins/custom_forms/views/custom_forms_plugin_profile/show.html.erb b/plugins/custom_forms/views/custom_forms_plugin_profile/show.html.erb index 1545f73..c83b657 100644 --- a/plugins/custom_forms/views/custom_forms_plugin_profile/show.html.erb +++ b/plugins/custom_forms/views/custom_forms_plugin_profile/show.html.erb @@ -22,7 +22,7 @@ <%= render :partial => 'shared/form_submission', :locals => {:f => f} %> - <% button_bar do %> + <%= button_bar do %> <% if @form.expired? %> <%= submit_button :save, c_('Save'), :disabled => '', :class => 'disabled', :cancel => {:controller => :profile, :profile => profile.identifier} %> <% else %> diff --git a/plugins/ldap/views/ldap_plugin_admin/index.html.erb b/plugins/ldap/views/ldap_plugin_admin/index.html.erb index 2f7f7e0..1ba0768 100644 --- a/plugins/ldap/views/ldap_plugin_admin/index.html.erb +++ b/plugins/ldap/views/ldap_plugin_admin/index.html.erb @@ -73,7 +73,7 @@
    - <% button_bar do %> + <%= button_bar do %> <%= submit_button('save', c_('Save changes')) %> <%= button :back, _('Back to plugins administration panel'), :controller => 'plugins' %> <% end %> diff --git a/plugins/mark_comment_as_read/test/unit/mark_comment_as_read_test.rb b/plugins/mark_comment_as_read/test/unit/mark_comment_as_read_test.rb index 7e4f5e1..5ae3130 100644 --- a/plugins/mark_comment_as_read/test/unit/mark_comment_as_read_test.rb +++ b/plugins/mark_comment_as_read/test/unit/mark_comment_as_read_test.rb @@ -1,9 +1,6 @@ require 'test_helper' -class MarkCommentAsReadPluginTest < ActiveSupport::TestCase - - include ActionView::Helpers::TagHelper - include NoosferoTestHelper +class MarkCommentAsReadPluginTest < ActionView::TestCase def setup @plugin = MarkCommentAsReadPlugin.new diff --git a/plugins/newsletter/views/newsletter_plugin/unsubscribe.html.erb b/plugins/newsletter/views/newsletter_plugin/unsubscribe.html.erb index 39bc0e5..b23d212 100644 --- a/plugins/newsletter/views/newsletter_plugin/unsubscribe.html.erb +++ b/plugins/newsletter/views/newsletter_plugin/unsubscribe.html.erb @@ -6,6 +6,6 @@ <%= _('Send an email to %s requesting your unsubscription or click on the button below.') % link_to(environment.contact_email, "mailto:#{environment.contact_email}?subject=#{_('Cancel newsletter subscription')}") %> -<% button_bar do %> +<%= button_bar do %> <%= button :ok, _('Confirm unsubscription'), {:action => 'confirm_unsubscription'}, :method => 'post' %> <% end %> diff --git a/plugins/newsletter/views/newsletter_plugin_admin/index.html.erb b/plugins/newsletter/views/newsletter_plugin_admin/index.html.erb index 91cc134..cb756c0 100644 --- a/plugins/newsletter/views/newsletter_plugin_admin/index.html.erb +++ b/plugins/newsletter/views/newsletter_plugin_admin/index.html.erb @@ -85,7 +85,7 @@ :id => 'newsletter-footer-field' )) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button :save, _('Save') %> <%= submit_button :save, _('Save and visualize'), :name => "visualize", :cancel => {:controller => 'plugins'} %> <% end %> diff --git a/plugins/oauth_client/views/oauth_client_plugin_admin/edit.html.erb b/plugins/oauth_client/views/oauth_client_plugin_admin/edit.html.erb index eb2db50..412c4a0 100644 --- a/plugins/oauth_client/views/oauth_client_plugin_admin/edit.html.erb +++ b/plugins/oauth_client/views/oauth_client_plugin_admin/edit.html.erb @@ -33,7 +33,7 @@ <% end %>
    - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:save, _('Save'), :cancel => {:action => 'index'}) %> <% end %> <% end %> diff --git a/plugins/organization_ratings/views/organization_ratings_plugin_admin/index.html.erb b/plugins/organization_ratings/views/organization_ratings_plugin_admin/index.html.erb index 6874af5..d06bc4d 100644 --- a/plugins/organization_ratings/views/organization_ratings_plugin_admin/index.html.erb +++ b/plugins/organization_ratings/views/organization_ratings_plugin_admin/index.html.erb @@ -45,7 +45,7 @@
    - <% button_bar do %> + <%= button_bar do %> <%= submit_button('save', c_('Save changes')) %> <%= button :back, _('Back'), :controller => 'plugins' %> <% end %> diff --git a/plugins/organization_ratings/views/shared/_rating_button.html.erb b/plugins/organization_ratings/views/shared/_rating_button.html.erb index 0d8258a..231837f 100644 --- a/plugins/organization_ratings/views/shared/_rating_button.html.erb +++ b/plugins/organization_ratings/views/shared/_rating_button.html.erb @@ -1,4 +1,4 @@ -<% button_bar do %> +<%= button_bar do %> <% if logged_in? %> <%= button(:new,_("Rate %s ") % _(profile.class.name), {:controller => "organization_ratings_plugin_profile", diff --git a/plugins/piwik/views/piwik_plugin_admin/index.html.erb b/plugins/piwik/views/piwik_plugin_admin/index.html.erb index 12d93a2..91690ac 100644 --- a/plugins/piwik/views/piwik_plugin_admin/index.html.erb +++ b/plugins/piwik/views/piwik_plugin_admin/index.html.erb @@ -8,7 +8,7 @@ <%= labelled_form_field _('Piwik site id'), f.text_field(:piwik_site_id) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:save, c_('Save'), :cancel => {:controller => 'plugins', :action => 'index'}) %> <% end %> diff --git a/plugins/products/test/unit/products_plugin/enterprise_homepage_helper_test.rb b/plugins/products/test/unit/products_plugin/enterprise_homepage_helper_test.rb index 1363c33..3e23289 100644 --- a/plugins/products/test/unit/products_plugin/enterprise_homepage_helper_test.rb +++ b/plugins/products/test/unit/products_plugin/enterprise_homepage_helper_test.rb @@ -1,6 +1,6 @@ require_relative '../../test_helper' -class EnterpriseHomepageHelperTest < ActiveSupport::TestCase +class EnterpriseHomepageHelperTest < ActionView::TestCase include ProductsPlugin::EnterpriseHomepageHelper @@ -57,7 +57,4 @@ class EnterpriseHomepageHelperTest < ActiveSupport::TestCase assert_no_match /100.34/, result end - protected - include NoosferoTestHelper - end diff --git a/plugins/products/views/products_plugin/page/_display_input.html.erb b/plugins/products/views/products_plugin/page/_display_input.html.erb index a54940b..d443a96 100644 --- a/plugins/products/views/products_plugin/page/_display_input.html.erb +++ b/plugins/products/views/products_plugin/page/_display_input.html.erb @@ -1,7 +1,7 @@
    <%= input.name %> <%= input_icon(input) %>
    - <% button_bar do %> + <%= button_bar do %> <% if input.has_price_details? %> <%= edit_button(:edit, _('Edit'), {:action => 'edit_input', :id => input}, :class => 'edit-input', :id => "edit-input-#{input.id}") %> <% end %> diff --git a/plugins/products/views/products_plugin/page/_edit_description.html.erb b/plugins/products/views/products_plugin/page/_edit_description.html.erb index 87399f8..81cb9b9 100644 --- a/plugins/products/views/products_plugin/page/_edit_description.html.erb +++ b/plugins/products/views/products_plugin/page/_edit_description.html.erb @@ -6,7 +6,7 @@ html: {id: 'product-description-form', method: 'post'}) do |f| %> <%= labelled_form_field(_('Description:'), f.text_area(:description, rows: 15, style: 'width: 90%;', class: 'mceEditor')) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button :save, _('Save') %> <%= cancel_edit_product_link(@product, 'description') %> <% end %> diff --git a/plugins/products/views/products_plugin/page/_edit_info.html.erb b/plugins/products/views/products_plugin/page/_edit_info.html.erb index faeec3b..e8e54a3 100644 --- a/plugins/products/views/products_plugin/page/_edit_info.html.erb +++ b/plugins/products/views/products_plugin/page/_edit_info.html.erb @@ -54,7 +54,7 @@ <%= hidden_field_tag 'info-bar-update-url', @product.price_composition_bar_display_url, class: 'bar-update-url' %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button :save, _('Save') %> <%= cancel_edit_product_link(@product, 'info') %> <% end %> diff --git a/plugins/products/views/products_plugin/page/_edit_name.html.erb b/plugins/products/views/products_plugin/page/_edit_name.html.erb index 410ceab..1e239cb 100644 --- a/plugins/products/views/products_plugin/page/_edit_name.html.erb +++ b/plugins/products/views/products_plugin/page/_edit_name.html.erb @@ -6,7 +6,7 @@ <%= f.text_field(:name, value: @product.name, class: 'name_edition') %> <%= select_unit(@product) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button :save, _('Save') %> <%= cancel_edit_product_link(@product, 'name') %> <% end %> diff --git a/plugins/products/views/products_plugin/page/_form.html.erb b/plugins/products/views/products_plugin/page/_form.html.erb index 8639138..67da716 100644 --- a/plugins/products/views/products_plugin/page/_form.html.erb +++ b/plugins/products/views/products_plugin/page/_form.html.erb @@ -11,7 +11,7 @@ <%= file_field_or_thumbnail(_('Image:'), @product.image, i) %> <% end %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button('save', (mode == 'new' ? _('Create product') : _('Save changes')), :cancel => {:action => 'index'} ) %> <% end %> <% end %> diff --git a/plugins/products/views/products_plugin/page/_manage_product_details.html.erb b/plugins/products/views/products_plugin/page/_manage_product_details.html.erb index c7c84ce..116c064 100644 --- a/plugins/products/views/products_plugin/page/_manage_product_details.html.erb +++ b/plugins/products/views/products_plugin/page/_manage_product_details.html.erb @@ -21,7 +21,7 @@ <%= hidden_field(:product, :inputs_cost) %> <%= hidden_field(:product, :price) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button :save, _('Save'), :disabled => '', :class => 'disabled' %> <%= button :cancel, _('Cancel'), '#', class: 'cancel-price-details', data: {confirm: _('If you leave, you will lose all unsaved information. Are you sure you want to quit?')} %> <%= button(:add, _('New cost'), '#', :id => 'add-new-cost') %> diff --git a/plugins/products/views/products_plugin/page/index.html.erb b/plugins/products/views/products_plugin/page/index.html.erb index f4c5ae4..09ce2d2 100644 --- a/plugins/products/views/products_plugin/page/index.html.erb +++ b/plugins/products/views/products_plugin/page/index.html.erb @@ -24,7 +24,7 @@ <%= pagination_links @products %> -<% button_bar do %> +<%= button_bar do %> <%= button :add, _('New product or service'), :action => 'new' if @profile.create_product? %> <%= button :back, _('Back'), { :controller => 'profile_editor', :profile => @profile.identifier, :action => 'index' } %> <% end %> diff --git a/plugins/products/views/products_plugin/page/show.html.erb b/plugins/products/views/products_plugin/page/show.html.erb index b81a385..31701e6 100644 --- a/plugins/products/views/products_plugin/page/show.html.erb +++ b/plugins/products/views/products_plugin/page/show.html.erb @@ -68,7 +68,7 @@
    -<% button_bar do %> +<%= button_bar do %> <%= button :back, _('Back to the product listing'), controller: 'products_plugin/catalog', action: 'index' %> <%= button :delete, _('Remove product or service'), {action: 'destroy', id: @product}, class: 'requires-permission-manage_products', style: 'display:none;' %> <% end %> diff --git a/plugins/push_notification/views/push_notification_plugin_admin/index.html.erb b/plugins/push_notification/views/push_notification_plugin_admin/index.html.erb index 712ffbc..bdd12ac 100644 --- a/plugins/push_notification/views/push_notification_plugin_admin/index.html.erb +++ b/plugins/push_notification/views/push_notification_plugin_admin/index.html.erb @@ -7,7 +7,7 @@

    <%= t('push_notification_plugin.lib.plugin.enabled_notifications')%>

    <%= render partial: "notification_events_form", locals:{f: f, settings: @settings} %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:save, c_('Save'), :cancel => {:controller => 'plugins'}) %> <% end %> diff --git a/plugins/push_notification/views/push_notification_plugin_myprofile/index.html.erb b/plugins/push_notification/views/push_notification_plugin_myprofile/index.html.erb index 4b2564b..30a0102 100644 --- a/plugins/push_notification/views/push_notification_plugin_myprofile/index.html.erb +++ b/plugins/push_notification/views/push_notification_plugin_myprofile/index.html.erb @@ -18,7 +18,7 @@ <%= form_for(:settings, :url => {:controller => "push_notification_plugin_myprofile", :action => "update_settings"}) do |f| %>

    <%= t('push_notification_plugin.lib.plugin.enabled_notifications') %>

    <%= render partial: "notification_events_form", locals: {f: f, settings: @settings} %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:save, _('Save')) %> <%= button(:back, _('Back to control panel'), :controller => (profile.nil? ? 'admin_panel': 'profile_editor')) %> <% end %> diff --git a/plugins/require_auth_to_comment/views/require_auth_to_comment_plugin_admin/index.html.erb b/plugins/require_auth_to_comment/views/require_auth_to_comment_plugin_admin/index.html.erb index 3d537b1..1612e26 100644 --- a/plugins/require_auth_to_comment/views/require_auth_to_comment_plugin_admin/index.html.erb +++ b/plugins/require_auth_to_comment/views/require_auth_to_comment_plugin_admin/index.html.erb @@ -13,7 +13,7 @@
    - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:save, _('Save'), :cancel => {:controller => 'plugins', :action => 'index'}) %> <% end %> diff --git a/plugins/responsive/views/invite/select_friends.html.erb b/plugins/responsive/views/invite/select_friends.html.erb index c7b4048..65ee60b 100644 --- a/plugins/responsive/views/invite/select_friends.html.erb +++ b/plugins/responsive/views/invite/select_friends.html.erb @@ -39,7 +39,7 @@ <%= labelled_form_field(_('Invitation text:'), text_area_tag(:mail_template, @mail_template, :cols => 72, :rows => 8)) %>
    - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:ok, _("Invite my friends!")) %> <% end %> <% end %> diff --git a/plugins/responsive/views/manage_products/_edit_name.html.erb b/plugins/responsive/views/manage_products/_edit_name.html.erb index 5df6d64..7c53690 100644 --- a/plugins/responsive/views/manage_products/_edit_name.html.erb +++ b/plugins/responsive/views/manage_products/_edit_name.html.erb @@ -12,7 +12,7 @@ - <% button_bar do %> + <%= button_bar do %> <%= submit_button :save, _('Save') %> <%= cancel_edit_product_link(@product, 'name') %> <% end %> diff --git a/plugins/send_email/views/send_email_plugin_admin/index.html.erb b/plugins/send_email/views/send_email_plugin_admin/index.html.erb index 44b61b5..9e1d19b 100644 --- a/plugins/send_email/views/send_email_plugin_admin/index.html.erb +++ b/plugins/send_email/views/send_email_plugin_admin/index.html.erb @@ -3,7 +3,7 @@ <%= form_for :environment, :url => {:action => 'index'}, :html => {:method => 'post'} do |f| %> <%= labelled_form_field(_("E-Mail addresses you want to allow to send"), f.text_area(:send_email_plugin_allow_to, :rows => 8)) %> <%= _('(list of email addresses separated by comma)') %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button 'save', c_('Save'), :cancel => {:controller => 'plugins'} %> <% end %> <% end %> diff --git a/plugins/site_tour/views/site_tour_plugin_admin/index.html.erb b/plugins/site_tour/views/site_tour_plugin_admin/index.html.erb index bba26a5..ae542cf 100644 --- a/plugins/site_tour/views/site_tour_plugin_admin/index.html.erb +++ b/plugins/site_tour/views/site_tour_plugin_admin/index.html.erb @@ -5,7 +5,7 @@ <%= labelled_form_field _('Tooltips (CSV format: language, group name, selector, description)'), f.text_area(:actions_csv, :style => 'width: 100%', :class => 'actions-csv') %> <%= labelled_form_field _('Group Triggers (CSV format: group name, selector, event (e.g. mouseenter, click))'), f.text_area(:group_triggers_csv, :style => 'width: 100%', :class => 'groups-csv', :rows => 7) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:save, _('Save'), :cancel => {:controller => 'plugins', :action => 'index'}) %> <% end %> diff --git a/plugins/sniffer/views/sniffer_plugin_myprofile/edit.html.erb b/plugins/sniffer/views/sniffer_plugin_myprofile/edit.html.erb index b3c68bb..4b95766 100644 --- a/plugins/sniffer/views/sniffer_plugin_myprofile/edit.html.erb +++ b/plugins/sniffer/views/sniffer_plugin_myprofile/edit.html.erb @@ -16,7 +16,7 @@ - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:save, _('Save')) %> <%= button :back, _('Back to control panel'), controller: 'profile_editor' %> <% end %> diff --git a/plugins/social_share_privacy/test/unit/social_share_privacy_test.rb b/plugins/social_share_privacy/test/unit/social_share_privacy_test.rb index 55393b2..f73d9af 100644 --- a/plugins/social_share_privacy/test/unit/social_share_privacy_test.rb +++ b/plugins/social_share_privacy/test/unit/social_share_privacy_test.rb @@ -1,6 +1,6 @@ require 'test_helper' -class SocialSharePrivacyPluginTest < ActiveSupport::TestCase +class SocialSharePrivacyPluginTest < ActionView::TestCase include NoosferoTestHelper diff --git a/plugins/social_share_privacy/views/social_share_privacy_plugin_admin/index.html.erb b/plugins/social_share_privacy/views/social_share_privacy_plugin_admin/index.html.erb index a8174e5..7ce388a 100644 --- a/plugins/social_share_privacy/views/social_share_privacy_plugin_admin/index.html.erb +++ b/plugins/social_share_privacy/views/social_share_privacy_plugin_admin/index.html.erb @@ -38,7 +38,7 @@ <%= _('The same order in which you arrange the social networks here will be used for arranging the share buttons.') %>

    - <% button_bar do %> + <%= button_bar do %> <%= submit_button 'save', _('Save'), :cancel => {:controller => 'plugins', :action => 'index'} %> <% end %> <% end %> diff --git a/plugins/spaminator/views/spaminator_plugin_admin/index.html.erb b/plugins/spaminator/views/spaminator_plugin_admin/index.html.erb index bef6c7c..b1c75a3 100644 --- a/plugins/spaminator/views/spaminator_plugin_admin/index.html.erb +++ b/plugins/spaminator/views/spaminator_plugin_admin/index.html.erb @@ -30,7 +30,7 @@ <%= button(:cancel, _('Withhold'), {:action => 'withhold'}, :title => _('Cancel next scheduled scans')) if @settings.deployed %> <% end %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:save, c_('Save'), :cancel => {:controller => 'plugins', :action => 'index'}) %> <% end %> diff --git a/plugins/spaminator/views/spaminator_plugin_admin/reports.html.erb b/plugins/spaminator/views/spaminator_plugin_admin/reports.html.erb index 481770e..8012800 100644 --- a/plugins/spaminator/views/spaminator_plugin_admin/reports.html.erb +++ b/plugins/spaminator/views/spaminator_plugin_admin/reports.html.erb @@ -29,6 +29,6 @@
    -<% button_bar do %> +<%= button_bar do %> <%= button(:back, c_('Back'), :action => 'index') %> <% end %> diff --git a/plugins/sub_organizations/views/sub_organizations_plugin_myprofile/index.html.erb b/plugins/sub_organizations/views/sub_organizations_plugin_myprofile/index.html.erb index ce47e61..f7440b7 100644 --- a/plugins/sub_organizations/views/sub_organizations_plugin_myprofile/index.html.erb +++ b/plugins/sub_organizations/views/sub_organizations_plugin_myprofile/index.html.erb @@ -10,7 +10,7 @@ <% end %> <%= form_tag do %> - <% button_bar do %> + <%= button_bar do %> <%= button(:add, _('Create a new sub-community'), :controller => 'memberships', :action => 'new_community', :profile => user.identifier, :sub_organizations_plugin_parent_to_be => profile.id) %> <%= button :add, _('Register a new sub-enterprise'), :controller => 'enterprise_registration', :sub_organizations_plugin_parent_to_be => profile.id if environment.enabled?('enterprise_registration') %> <% end %> @@ -21,7 +21,7 @@ :hint_text => _('Type in a search term for a group'), :pre_populate => @tokenized_children}) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button('save', c_('Save'))%> <%= button('cancel', c_('Cancel'), {:controller => 'profile_editor'})%> <% end %> diff --git a/plugins/sub_organizations/views/sub_organizations_plugin_profile/_full_related_organizations.html.erb b/plugins/sub_organizations/views/sub_organizations_plugin_profile/_full_related_organizations.html.erb index 3be6651..d9476bf 100644 --- a/plugins/sub_organizations/views/sub_organizations_plugin_profile/_full_related_organizations.html.erb +++ b/plugins/sub_organizations/views/sub_organizations_plugin_profile/_full_related_organizations.html.erb @@ -51,7 +51,7 @@ <%= pagination_links(organizations, {:param_name => 'npage', :page_links => true}) %> - <% button_bar(:class => "related-organizations-button-bar") do %> + <%= button_bar(:class => "related-organizations-button-bar") do %> <%= button :back, c_('Go back'), { :controller => 'profile' } %> <%= button :add, _("Add a new %s") % organization_type, :controller => 'sub_organizations_plugin_myprofile', :action => 'index' if logged_in? && user.has_permission?(:edit_profile, profile) && !environment.enabled?("disable_asset_#{organization_type.pluralize}") %> diff --git a/plugins/sub_organizations/views/sub_organizations_plugin_profile/_related_organizations.html.erb b/plugins/sub_organizations/views/sub_organizations_plugin_profile/_related_organizations.html.erb index cd0728f..d11db93 100644 --- a/plugins/sub_organizations/views/sub_organizations_plugin_profile/_related_organizations.html.erb +++ b/plugins/sub_organizations/views/sub_organizations_plugin_profile/_related_organizations.html.erb @@ -9,7 +9,7 @@ <% if organizations.length == 0 %>
  • <%= _("There are no sub-%s yet.") % organization_type.pluralize %>
  • <% end %> - <% button_bar(:class => "related-organizations-button-bar") do %> + <%= button_bar(:class => "related-organizations-button-bar") do %> <%= button :back, c_('Go back'), { :controller => 'profile' } %> <%= button :add, _("Add a new %s") % organization_type, :controller => 'sub_organizations_plugin_myprofile', :action => 'index' if logged_in? && user.has_permission?(:edit_profile, profile) && !environment.enabled?("disable_asset_#{organization_type.pluralize}") %> diff --git a/plugins/suppliers/views/suppliers_plugin/manage_products/_distribution_tab.html.slim b/plugins/suppliers/views/suppliers_plugin/manage_products/_distribution_tab.html.slim index bcc3037..94fbdd5 100644 --- a/plugins/suppliers/views/suppliers_plugin/manage_products/_distribution_tab.html.slim +++ b/plugins/suppliers/views/suppliers_plugin/manage_products/_distribution_tab.html.slim @@ -10,5 +10,5 @@ = check_box_tag "consumers[#{consumer.id}]", '1', distributed_consumers.include?(consumer.profile) = label_tag "consumers[#{consumer.id}]", consumer.name - - button_bar do + = button_bar do = submit_button :save, _('Save') diff --git a/plugins/tolerance_time/views/tolerance_time_plugin_myprofile/index.html.erb b/plugins/tolerance_time/views/tolerance_time_plugin_myprofile/index.html.erb index 139d4a2..1efd033 100644 --- a/plugins/tolerance_time/views/tolerance_time_plugin_myprofile/index.html.erb +++ b/plugins/tolerance_time/views/tolerance_time_plugin_myprofile/index.html.erb @@ -11,13 +11,13 @@ f.text_field(:content_tolerance, :size => 2, :style => 'font-size: 14px; text-align: right') + select_tag(:content_tolerance_unit, options_for_select(time_units, @content_default_unit) )) %> <% end %> - <%= labelled_form_field(_('Comment edition tolerance time'), - f.text_field(:comment_tolerance, :size => 2, :style => 'font-size: 14px; text-align: right') + + <%= labelled_form_field(_('Comment edition tolerance time'), + f.text_field(:comment_tolerance, :size => 2, :style => 'font-size: 14px; text-align: right') + select_tag(:comment_tolerance_unit, options_for_select(time_units, @comment_default_unit) )) %> <%= content_tag( 'small', _('Empty means unlimited and zero means right away.') ) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button('save', c_('Save'))%> <%= button('back', c_('Back'), {:controller => 'profile_editor'})%> <% end %> diff --git a/plugins/vote/views/vote_plugin_admin/index.html.erb b/plugins/vote/views/vote_plugin_admin/index.html.erb index f18617f..53387ac 100644 --- a/plugins/vote/views/vote_plugin_admin/index.html.erb +++ b/plugins/vote/views/vote_plugin_admin/index.html.erb @@ -13,7 +13,7 @@ <%= labelled_form_field _('Limit of voters to display:'), f.text_field(:voters_limit, :size => 3) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button(:save, c_('Save'), :cancel => {:controller => 'plugins', :action => 'index'}) %> <% end %> diff --git a/plugins/work_assignment/views/work_assignment_plugin_myprofile/edit_visibility.html.erb b/plugins/work_assignment/views/work_assignment_plugin_myprofile/edit_visibility.html.erb index 9986aff..03cfbb0 100644 --- a/plugins/work_assignment/views/work_assignment_plugin_myprofile/edit_visibility.html.erb +++ b/plugins/work_assignment/views/work_assignment_plugin_myprofile/edit_visibility.html.erb @@ -12,7 +12,7 @@ <%= visibility_options(@article, @tokenized_children) %> - <% button_bar do %> + <%= button_bar do %> <%= submit_button :save, _('Save') %> <%= button :cancel, _('Cancel'), @back_to %> <% end %> diff --git a/test/support/noosfero_test_helper.rb b/test/support/noosfero_test_helper.rb index d3c58d9..ad43b86 100644 --- a/test/support/noosfero_test_helper.rb +++ b/test/support/noosfero_test_helper.rb @@ -1,13 +1,8 @@ +## +# DEPRECATED ActionView::TestCase already provide all needed +# module NoosferoTestHelper - def link_to(content, url, options = {}) - "#{content}" - end - - def content_tag(tag, content, options = {}) - tag_attr = options.blank? ? '' : ' ' + options.collect{ |o| "#{o[0]}=\"#{o[1]}\"" }.join(' ') - "<#{tag}#{tag_attr}>#{content}" - end def submit_tag(content, options = {}) content @@ -17,11 +12,6 @@ module NoosferoTestHelper '' end - def tag(tag, args = {}) - attrs = args.map{|k,v| "#{k}='#{v}'"}.join(' ') - "<#{tag} #{attrs} />" - end - def options_from_collection_for_select(collection, value_method, content_method) "" end diff --git a/test/unit/application_helper_test.rb b/test/unit/application_helper_test.rb index 7e10dac..34f2e3f 100644 --- a/test/unit/application_helper_test.rb +++ b/test/unit/application_helper_test.rb @@ -682,29 +682,6 @@ class ApplicationHelperTest < ActionView::TestCase assert_nil default_folder_for_image_upload(profile) end - should 'envelop a html with button-bar div' do - result = button_bar { 'foo' } - assert_equal '
    foo'+ - '
    ', result - end - - should 'add more classes to button-bar envelope' do - result = button_bar :class=>'test' do - 'foo' - end - assert_equal '
    foo'+ - '
    ', result - end - - should 'add more attributes to button-bar envelope' do - result = button_bar :id=>'bt1' do - 'foo' - end - assert_tag_in_string result, :tag =>'div', :attributes => {:class => 'button-bar', :id => 'bt1'} - assert_tag_in_string result, :tag =>'b', :content => 'foo', :parent => {:tag => 'div', :attributes => {:id => 'bt1'}} - assert_tag_in_string result, :tag =>'br', :parent => {:tag => 'div', :attributes => {:id => 'bt1'}} - end - should 'not filter html if source does not have macros' do class Plugin1 < Noosfero::Plugin end @@ -871,7 +848,7 @@ class ApplicationHelperTest < ActionView::TestCase html = fullscreen_buttons("#article") assert html.include?("") assert html.include?("class=\"button with-text icon-fullscreen\"") - assert html.include?("onClick=\"toggle_fullwidth('#article')\"") + assert html.include?("onClick=\"toggle_fullwidth('#article')\"") end should "return the related class string" do diff --git a/test/unit/buttons_helper_test.rb b/test/unit/buttons_helper_test.rb index 0a40939..a2a8da3 100644 --- a/test/unit/buttons_helper_test.rb +++ b/test/unit/buttons_helper_test.rb @@ -1,11 +1,35 @@ -# encoding: UTF-8 require_relative "../test_helper" class ButtonsHelperTest < ActionView::TestCase + include ButtonsHelper should 'append with-text class and keep existing classes' do expects(:button_without_text).with('type', 'label', 'url', { :class => 'with-text class1'}) button('type', 'label', 'url', { :class => 'class1' }) end -end \ No newline at end of file + + should 'envelop a html with button-bar div' do + result = button_bar { content_tag :b, 'foo' } + assert_equal '
    foo'+ + '
    ', result + end + + should 'add more classes to button-bar envelope' do + result = button_bar :class=>'test' do + content_tag :b, 'foo' + end + assert_equal '
    foo'+ + '
    ', result + end + + should 'add more attributes to button-bar envelope' do + result = button_bar :id=>'bt1' do + content_tag :b, 'foo' + end + assert_tag_in_string result, :tag =>'div', :attributes => {:class => ' button-bar', :id => 'bt1'} + assert_tag_in_string result, :tag =>'b', :content => 'foo', :parent => {:tag => 'div', :attributes => {:id => 'bt1'}} + assert_tag_in_string result, :tag =>'br', :parent => {:tag => 'div', :attributes => {:id => 'bt1'}} + end + +end diff --git a/test/unit/comment_helper_test.rb b/test/unit/comment_helper_test.rb index 2fb747d..d7257e0 100644 --- a/test/unit/comment_helper_test.rb +++ b/test/unit/comment_helper_test.rb @@ -1,10 +1,10 @@ require_relative "../test_helper" -class CommentHelperTest < ActiveSupport::TestCase +class CommentHelperTest < ActionView::TestCase include CommentHelper - include ActionView::Helpers::TagHelper - include NoosferoTestHelper + + helper ApplicationHelper def setup @user = create_user('usertest').person @@ -12,6 +12,7 @@ class CommentHelperTest < ActiveSupport::TestCase self.stubs(:logged_in?).returns(true) self.stubs(:report_abuse).returns('link') self.stubs(:expirable_comment_link).returns('link') + self.stubs(:url_for) @plugins = mock @plugins.stubs(:dispatch).returns([]) end @@ -140,9 +141,5 @@ class CommentHelperTest < ActiveSupport::TestCase assert_match /plugin_action/, Nokogiri::HTML.fragment(html).css('.comments-action-bar').to_html end - def link_to_function(content, url, options = {}) - link_to(content, url, options) - end - end diff --git a/test/unit/content_viewer_helper_test.rb b/test/unit/content_viewer_helper_test.rb index ea69f33..0ca89c9 100644 --- a/test/unit/content_viewer_helper_test.rb +++ b/test/unit/content_viewer_helper_test.rb @@ -3,6 +3,8 @@ require_relative "../test_helper" class ContentViewerHelperTest < ActionView::TestCase include ActionView::Helpers::TagHelper + include ActionView::Helpers::TextHelper + include ContentViewerHelper include DatesHelper include ApplicationHelper @@ -148,11 +150,4 @@ class ContentViewerHelperTest < ActionView::TestCase assert_match /February 1, 2007/, result end - protected - include NoosferoTestHelper - include ActionView::Helpers::TextHelper - def url_for(args = {}) - ['http:/', args[:host], args[:profile], args[:page]].join('/') - end - end diff --git a/test/unit/events_helper_test.rb b/test/unit/events_helper_test.rb index e88eb4b..98e8f13 100644 --- a/test/unit/events_helper_test.rb +++ b/test/unit/events_helper_test.rb @@ -1,6 +1,6 @@ require_relative "../test_helper" -class EventsHelperTest < ActiveSupport::TestCase +class EventsHelperTest < ActionView::TestCase include EventsHelper diff --git a/test/unit/forum_helper_test.rb b/test/unit/forum_helper_test.rb index 0fe0e95..dd8b680 100644 --- a/test/unit/forum_helper_test.rb +++ b/test/unit/forum_helper_test.rb @@ -1,6 +1,6 @@ require_relative "../test_helper" -class ForumHelperTest < ActiveSupport::TestCase +class ForumHelperTest < ActionView::TestCase include BlogHelper include ForumHelper @@ -58,7 +58,7 @@ class ForumHelperTest < ActiveSupport::TestCase assert_match result, out assert_match 'a2', out - assert_match(/#{result} by a2<\/a>/, last_topic_update(some_post)) + assert_match(/#{result} by a2<\/a>/, last_topic_update(some_post)) end should "return last comment author's name from unauthenticated user" do -- libgit2 0.21.2