From 31750a44806473402bf9e691e4cecf302c3ecda1 Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Wed, 14 May 2014 17:56:39 -0300 Subject: [PATCH] Move labelled_form_for to new api format --- app/controllers/admin/environment_role_manager_controller.rb | 6 +++--- app/helpers/application_helper.rb | 3 +-- app/views/account/_login_form.html.erb | 2 +- app/views/account/_signup_form.html.erb | 2 +- app/views/account/login.html.erb | 2 +- app/views/account/login_block.html.erb | 4 ++-- app/views/admin_panel/message_for_disabled_enterprise.html.erb | 2 +- app/views/admin_panel/set_portal_news_amount.html.erb | 2 +- app/views/admin_panel/site_info.html.erb | 2 +- app/views/categories/_form.html.erb | 2 +- app/views/cms/destroy.html.erb | 2 +- app/views/cms/edit.html.erb | 2 +- app/views/cms/suggest_an_article.html.erb | 2 +- app/views/contact/new.html.erb | 2 +- app/views/enterprise_registration/basic_information.html.erb | 2 +- app/views/enterprise_validation/edit_validation_info.html.erb | 2 +- app/views/environment_role_manager/change_role.html.erb | 3 +-- app/views/environment_role_manager/make_admin.html.erb | 2 +- app/views/features/_manage_community_fields.html.erb | 2 +- app/views/features/_manage_enterprise_fields.html.erb | 2 +- app/views/features/_manage_person_fields.html.erb | 2 +- app/views/features/index.html.erb | 2 +- app/views/memberships/new_community.html.erb | 2 +- app/views/plugins/index.html.erb | 2 +- app/views/profile_editor/edit.html.erb | 4 ++-- app/views/profile_members/change_role.html.erb | 2 +- app/views/role/_form.html.erb | 2 +- app/views/tasks/new.html.erb | 2 +- plugins/bsc/views/bsc_plugin_myprofile/_contract_form.html.erb | 2 +- plugins/bsc/views/bsc_plugin_myprofile/create_enterprise.html.erb | 2 +- plugins/ldap/views/ldap_plugin_admin/index.html.erb | 2 +- 31 files changed, 35 insertions(+), 37 deletions(-) diff --git a/app/controllers/admin/environment_role_manager_controller.rb b/app/controllers/admin/environment_role_manager_controller.rb index 6de4887..fef08a8 100644 --- a/app/controllers/admin/environment_role_manager_controller.rb +++ b/app/controllers/admin/environment_role_manager_controller.rb @@ -1,6 +1,6 @@ class EnvironmentRoleManagerController < AdminController protect 'manage_environment_roles', :environment - + def index @admins = Person.find(:all, :conditions => ['role_assignments.resource_type = ?', 'Environment'], :include => :role_assignments ) end @@ -8,7 +8,7 @@ class EnvironmentRoleManagerController < AdminController def change_roles @admin = Person.find(params[:id]) @roles = Role.find(:all).select{ |r| r.has_kind?(:environment) } - end + end def update_roles @roles = params[:roles] ? Role.find(params[:roles]) : [] @@ -20,7 +20,7 @@ class EnvironmentRoleManagerController < AdminController end redirect_to :action => :index end - + def change_role @roles = Role.find(:all).select{ |r| r.has_kind?(:environment) } @admin = Person.find(params[:id]) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 469a9ac..9524548 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -805,8 +805,7 @@ module ApplicationHelper fields_for(name, object, { :builder => NoosferoFormBuilder }.merge(options), &proc) end - def labelled_form_for(name, object = nil, options = {}, &proc) - # FIXME remove the =object= argument and adapt the calling code + def labelled_form_for(name, options = {}, &proc) form_for(name, { :builder => NoosferoFormBuilder }.merge(options), &proc) end diff --git a/app/views/account/_login_form.html.erb b/app/views/account/_login_form.html.erb index f58f2fd..a145e92 100644 --- a/app/views/account/_login_form.html.erb +++ b/app/views/account/_login_form.html.erb @@ -1,4 +1,4 @@ -<%= labelled_form_for :user, @user, +<%= labelled_form_for :user, :url => { :controller => 'account', :action => (params[:enterprise_code] ? 'activate_enterprise' : 'login') } do |f| %> <%= f.text_field :login, diff --git a/app/views/account/_signup_form.html.erb b/app/views/account/_signup_form.html.erb index 58d51dc..2b6af52 100644 --- a/app/views/account/_signup_form.html.erb +++ b/app/views/account/_signup_form.html.erb @@ -11,7 +11,7 @@ <%= error_messages_for :user, :person, :header_message => _('The account could not be created') %> -<%= labelled_form_for :user, @user, :html => { :multipart => true, :id => 'signup-form', :honeypot => true } do |f| %> +<%= labelled_form_for :user, :html => { :multipart => true, :id => 'signup-form', :honeypot => true } do |f| %>