use capture instead of layout-hack to allow deface overrides

This commit is contained in:
wvengen 2014-04-29 19:21:03 +02:00
parent 83738c8383
commit 3953c21ae2
4 changed files with 6 additions and 4 deletions

View File

@ -1,12 +1,13 @@
- unless @ordergroup.new_record?
%p= t('.first_paragraph', url: link_to(t('.here'), new_invite_path(id: @ordergroup.id), remote: true)).html_safe
= simple_form_for [:admin, @ordergroup] do |f|
= render :layout => 'shared/group_form_fields', :locals => {:f => f} do
- captured = capture do
= f.input :contact_person
= f.input :contact_phone
= f.input :contact_address
- if FoodsoftConfig[:use_apple_points]
= f.input :ignore_apple_restriction, :label => false, :inline_label => true
= render 'shared/group_form_fields', f: f, captured: captured
.form-actions
= f.button :submit
= link_to t('ui.or_cancel'), :back

View File

@ -1,12 +1,13 @@
%p= t('.first_paragraph', url: link_to(t('.here'), new_invite_path(id: @workgroup.id), remote: true)).html_safe
= simple_form_for [:admin, @workgroup] do |f|
= render :layout => 'shared/group_form_fields', :locals => {:f => f} do
- captured = capture do
%h4= t 'admin.access_to'
= f.input :role_admin
= f.input :role_finance
= f.input :role_suppliers
= f.input :role_article_meta
= f.input :role_orders
= render 'shared/group_form_fields', :f => f, captured: captured
.form-actions
= f.button :submit
= link_to t('ui.or_cancel'), :back

View File

@ -2,7 +2,7 @@
%p= t('.invite_new', invite_link: link_to(t('.invite_link'), new_invite_path(id: @workgroup.id))).html_safe
= simple_form_for [:foodcoop, @workgroup] do |f|
= render :partial => 'shared/group_form_fields', :locals => {:f => f}
= render 'shared/group_form_fields', f: f
.form-actions
= f.submit
= link_to t('ui.or_cancel'), foodcoop_workgroups_path

View File

@ -1,7 +1,7 @@
= f.input :name
= f.input :description, as: :text, input_html: {rows: 4}
= yield
= captured if defined? captured
= f.input :user_tokens, :as => :string,
:input_html => { 'data-pre' => f.object.users.map(&:token_attributes).to_json }