Commit 31750a44806473402bf9e691e4cecf302c3ecda1
1 parent
0d5e3192
Exists in
master
and in
29 other branches
Move labelled_form_for to new api format
Showing
31 changed files
with
35 additions
and
37 deletions
Show diff stats
app/controllers/admin/environment_role_manager_controller.rb
1 | 1 | class EnvironmentRoleManagerController < AdminController |
2 | 2 | protect 'manage_environment_roles', :environment |
3 | - | |
3 | + | |
4 | 4 | def index |
5 | 5 | @admins = Person.find(:all, :conditions => ['role_assignments.resource_type = ?', 'Environment'], :include => :role_assignments ) |
6 | 6 | end |
... | ... | @@ -8,7 +8,7 @@ class EnvironmentRoleManagerController < AdminController |
8 | 8 | def change_roles |
9 | 9 | @admin = Person.find(params[:id]) |
10 | 10 | @roles = Role.find(:all).select{ |r| r.has_kind?(:environment) } |
11 | - end | |
11 | + end | |
12 | 12 | |
13 | 13 | def update_roles |
14 | 14 | @roles = params[:roles] ? Role.find(params[:roles]) : [] |
... | ... | @@ -20,7 +20,7 @@ class EnvironmentRoleManagerController < AdminController |
20 | 20 | end |
21 | 21 | redirect_to :action => :index |
22 | 22 | end |
23 | - | |
23 | + | |
24 | 24 | def change_role |
25 | 25 | @roles = Role.find(:all).select{ |r| r.has_kind?(:environment) } |
26 | 26 | @admin = Person.find(params[:id]) | ... | ... |
app/helpers/application_helper.rb
... | ... | @@ -805,8 +805,7 @@ module ApplicationHelper |
805 | 805 | fields_for(name, object, { :builder => NoosferoFormBuilder }.merge(options), &proc) |
806 | 806 | end |
807 | 807 | |
808 | - def labelled_form_for(name, object = nil, options = {}, &proc) | |
809 | - # FIXME remove the =object= argument and adapt the calling code | |
808 | + def labelled_form_for(name, options = {}, &proc) | |
810 | 809 | form_for(name, { :builder => NoosferoFormBuilder }.merge(options), &proc) |
811 | 810 | end |
812 | 811 | ... | ... |
app/views/account/_login_form.html.erb
app/views/account/_signup_form.html.erb
... | ... | @@ -11,7 +11,7 @@ |
11 | 11 | |
12 | 12 | <%= error_messages_for :user, :person, :header_message => _('The account could not be created') %> |
13 | 13 | |
14 | -<%= labelled_form_for :user, @user, :html => { :multipart => true, :id => 'signup-form', :honeypot => true } do |f| %> | |
14 | +<%= labelled_form_for :user, :html => { :multipart => true, :id => 'signup-form', :honeypot => true } do |f| %> | |
15 | 15 | |
16 | 16 | <input type="hidden" id="signup_time_key" name="signup_time_key" /> |
17 | 17 | <script type="text/javascript"> | ... | ... |
app/views/account/login.html.erb
... | ... | @@ -7,7 +7,7 @@ |
7 | 7 | |
8 | 8 | <%= @message %> |
9 | 9 | |
10 | -<%= labelled_form_for :user, @user, :url => login_url do |f| %> | |
10 | +<%= labelled_form_for :user, :url => login_url do |f| %> | |
11 | 11 | |
12 | 12 | <%= f.text_field :login, :id => 'main_user_login', :onchange => 'this.value = convToValidLogin( this.value )', :value => params[:userlogin] %> |
13 | 13 | ... | ... |
app/views/account/login_block.html.erb
... | ... | @@ -8,8 +8,8 @@ |
8 | 8 | <% |
9 | 9 | @user ||= User.new |
10 | 10 | %> |
11 | - | |
12 | - <%= labelled_form_for :user, @user, :url => login_url do |f| %> | |
11 | + | |
12 | + <%= labelled_form_for :user, :url => login_url do |f| %> | |
13 | 13 | |
14 | 14 | <%= f.text_field :login, :onchange => 'this.value = convToValidLogin( this.value )' %> |
15 | 15 | ... | ... |
app/views/admin_panel/message_for_disabled_enterprise.html.erb
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | |
3 | 3 | <%= render :file => 'shared/tiny_mce' %> |
4 | 4 | |
5 | -<%= labelled_form_for :environment, @environment, :url => {:action => 'site_info'} do |f| %> | |
5 | +<%= labelled_form_for :environment, :url => {:action => 'site_info'} do |f| %> | |
6 | 6 | |
7 | 7 | <%= f.text_area :message_for_disabled_enterprise, :cols => 40, :style => 'width: 90%' %> |
8 | 8 | ... | ... |
app/views/admin_panel/set_portal_news_amount.html.erb
app/views/admin_panel/site_info.html.erb
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | |
5 | 5 | <%= render :file => 'shared/tiny_mce' %> |
6 | 6 | |
7 | -<%= labelled_form_for :environment, @environment do |f| %> | |
7 | +<%= labelled_form_for :environment do |f| %> | |
8 | 8 | <% tabs = [] %> |
9 | 9 | <% tabs << {:title => _('Site info'), :id => 'site-info', |
10 | 10 | :content => (render :partial => 'site_info', :locals => {:f => f})} %> | ... | ... |
app/views/categories/_form.html.erb
app/views/cms/destroy.html.erb
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | |
3 | 3 | <%= error_messages_for 'article' %> |
4 | 4 | |
5 | -<%= labelled_form_for 'article', @article, :url => { :action => 'destroy' }, :method => 'post' do |f| %> | |
5 | +<%= labelled_form_for 'article', :url => { :action => 'destroy' }, :method => 'post' do |f| %> | |
6 | 6 | |
7 | 7 | <strong> |
8 | 8 | <% if @article.folder? %> | ... | ... |
app/views/cms/edit.html.erb
1 | 1 | <%= error_messages_for 'article' %> |
2 | 2 | |
3 | 3 | <div class='<%= (environment.enabled?('media_panel') ? 'with_media_panel' : 'no_media_panel') %>'> |
4 | -<%= labelled_form_for 'article', @article, :html => { :multipart => true, :class => @type } do |f| %> | |
4 | +<%= labelled_form_for 'article', :html => { :multipart => true, :class => @type } do |f| %> | |
5 | 5 | |
6 | 6 | <%= hidden_field_tag("type", @type) if @type %> |
7 | 7 | ... | ... |
app/views/cms/suggest_an_article.html.erb
app/views/contact/new.html.erb
app/views/enterprise_registration/basic_information.html.erb
... | ... | @@ -18,7 +18,7 @@ |
18 | 18 | |
19 | 19 | <%= required_fields_message %> |
20 | 20 | |
21 | - <%= labelled_form_for(:create_enterprise, @create_enterprise) do |f| %> | |
21 | + <%= labelled_form_for :create_enterprise do |f| %> | |
22 | 22 | <%= required f.text_field 'name', :onchange => "updateUrlField(this, 'create_enterprise_identifier')", :size => 40 %> |
23 | 23 | <%= required labelled_form_field(_('Address'), content_tag('code', environment.top_url + "/" + text_field(:create_enterprise, 'identifier', :size => 26))) %> |
24 | 24 | <%= render :partial => 'shared/organization_custom_fields', :locals => { :f => f, :object_name => :create_enterprise, :profile => @create_enterprise } %> | ... | ... |
app/views/enterprise_validation/edit_validation_info.html.erb
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | |
3 | 3 | <%= error_messages_for :info %> |
4 | 4 | |
5 | -<%= labelled_form_for :info, @info do |f| %> | |
5 | +<%= labelled_form_for :info do |f| %> | |
6 | 6 | <%= f.text_area(:validation_methodology, :cols => 50, :rows => 10) %> |
7 | 7 | <%= f.text_area(:restrictions, :cols => 50, :rows => 7) %> |
8 | 8 | <% button_bar do %> | ... | ... |
app/views/environment_role_manager/change_role.html.erb
1 | 1 | <%= _('Changing role of %s') % @admin.name %> |
2 | 2 | |
3 | -<%= labelled_form_for :member, @admin, :url => {:action => 'update_roles'} do |f| %> | |
4 | - | |
3 | +<%= labelled_form_for :admin, :url => {:action => 'update_roles'} do |f| %> | |
5 | 4 | <%= _('Roles:') %> <br> |
6 | 5 | <% @roles.each do |r| %> |
7 | 6 | <%= labelled_form_field(r.name, (check_box_tag "roles[]", r.id, @admin.role_assignments.map{|ra|ra.role}.include?(r))) %> | ... | ... |
app/views/environment_role_manager/make_admin.html.erb
1 | 1 | <h2> <% _('Make new admin') %> </h2> |
2 | 2 | |
3 | -<%= labelled_form_for :person, @person, :url => {:action => 'update_roles'} do |f| %> | |
3 | +<%= labelled_form_for :person, :url => {:action => 'update_roles'} do |f| %> | |
4 | 4 | <%= _('Admin') %> <br> |
5 | 5 | <% @people.each do |p| %> |
6 | 6 | <%= labelled_form_field(p.name, (radio_button_tag "person", p.id)) %> | ... | ... |
app/views/features/_manage_community_fields.html.erb
app/views/features/_manage_enterprise_fields.html.erb
app/views/features/_manage_person_fields.html.erb
app/views/features/index.html.erb
... | ... | @@ -8,7 +8,7 @@ |
8 | 8 | Check all the features you want to enable for your environment, uncheck all the ones you don\'t want, and use the <em>"Save changes" button</em> to confirm your changes.') %> |
9 | 9 | </p> |
10 | 10 | |
11 | -<%= labelled_form_for(:environment, @environment, :url => {:action => 'update'}) do |f| %> | |
11 | +<%= labelled_form_for(:environment, :url => {:action => 'update'}) do |f| %> | |
12 | 12 | |
13 | 13 | <table> |
14 | 14 | <tr> | ... | ... |
app/views/memberships/new_community.html.erb
app/views/plugins/index.html.erb
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | <%= _('Select which plugins you want to enable in your environment') %> |
5 | 5 | </p> |
6 | 6 | |
7 | -<%= labelled_form_for(:environment, @environment, :url => {:action => 'update'}) do |f| %> | |
7 | +<%= labelled_form_for(:environment, :url => {:action => 'update'}) do |f| %> | |
8 | 8 | |
9 | 9 | <table> |
10 | 10 | <% @active_plugins.sort_by(&:plugin_name).each do |plugin| %> | ... | ... |
app/views/profile_editor/edit.html.erb
1 | 1 | <h1><%= _('Profile settings for %s') % profile.name %></h1> |
2 | 2 | |
3 | -<%= error_messages_for :profile %> | |
3 | +<%= error_messages_for :profile_data %> | |
4 | 4 | |
5 | -<%= labelled_form_for :profile_data, @profile, :html => { :id => 'profile-data', :multipart => true } do |f| %> | |
5 | +<%= labelled_form_for :profile_data, :html => { :id => 'profile-data', :multipart => true } do |f| %> | |
6 | 6 | |
7 | 7 | <% if user.has_permission?('manage_environment_templates', profile.environment) %> |
8 | 8 | <div id="profile-is-template"> | ... | ... |
app/views/profile_members/change_role.html.erb
1 | 1 | <h3> <%= _('Changing role of %s') % @member.name %> </h3> |
2 | 2 | |
3 | -<%= labelled_form_for :member, @member, :url => {:action => 'update_roles'} do |f| %> | |
3 | +<%= labelled_form_for :member, :url => {:action => 'update_roles'} do |f| %> | |
4 | 4 | |
5 | 5 | <%= _('Roles:') %> <br> |
6 | 6 | <% @roles.each do |r| %> | ... | ... |
app/views/role/_form.html.erb
1 | 1 | <%= error_messages_for :role %> |
2 | 2 | |
3 | -<%= labelled_form_for :role, role, :url => (mode == :edit) ? {:action => 'update', :id => role} : {:action => 'create'} do |f| %> | |
3 | +<%= labelled_form_for :role, :url => (mode == :edit) ? {:action => 'update', :id => role} : {:action => 'create'} do |f| %> | |
4 | 4 | |
5 | 5 | <%= required_fields_message %> |
6 | 6 | ... | ... |
app/views/tasks/new.html.erb
1 | 1 | <h1><%= @ticket.target ? _('New request for %s') % @ticket.target.name : _('New request') %></h1> |
2 | 2 | |
3 | 3 | <%# FIXME: put style in css %> |
4 | -<%= labelled_form_for :ticket, @ticket do |f| %> | |
4 | +<%= labelled_form_for :ticket do |f| %> | |
5 | 5 | <% if @ticket.target %> |
6 | 6 | <%= f.hidden_field :target_id %> |
7 | 7 | <% else %> | ... | ... |
plugins/bsc/views/bsc_plugin_myprofile/_contract_form.html.erb
1 | 1 | <%= error_messages_for :contract %> |
2 | 2 | |
3 | -<%= labelled_form_for :contract, @contract, :html => {:id => 'bsc-plugin-sales-form'} do |f| %> | |
3 | +<%= labelled_form_for :contract, :html => {:id => 'bsc-plugin-sales-form'} do |f| %> | |
4 | 4 | <%= hidden_field_tag :contract_id, @contract.id %> |
5 | 5 | <%= required f.text_field(:client_name) %> |
6 | 6 | <%= labelled_form_field(_('Client type'), f.select(:client_type, BscPlugin::Contract::ClientType.types.map{|type| [BscPlugin::Contract::ClientType.names[type], type]}))%> | ... | ... |
plugins/bsc/views/bsc_plugin_myprofile/create_enterprise.html.erb
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | |
5 | 5 | <%= required_fields_message %> |
6 | 6 | |
7 | -<%= labelled_form_for(:create_enterprise, @create_enterprise) do |f| %> | |
7 | +<%= labelled_form_for(:create_enterprise) do |f| %> | |
8 | 8 | |
9 | 9 | <%= required f.text_field 'name', :onchange => "updateUrlField(this, 'create_enterprise_identifier')", :size => 40 %> |
10 | 10 | <%= render :partial => 'shared/organization_custom_fields', :locals => { :f => f, :object_name => :create_enterprise, :profile => @create_enterprise } %> | ... | ... |
plugins/ldap/views/ldap_plugin_admin/index.html.erb