mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-06 22:36:07 +00:00
Extract coordinator fees to partial
This commit is contained in:
5
app/views/admin/order_cycles/_coordinator_fees.html.haml
Normal file
5
app/views/admin/order_cycles/_coordinator_fees.html.haml
Normal file
@@ -0,0 +1,5 @@
|
||||
%table.coordinator-fees
|
||||
%tr{'ng-repeat' => 'enterprise_fee in order_cycle.coordinator_fees'}
|
||||
%td= select_tag 'order_cycle_coordinator_fee_{{ $index }}_id', nil, {'ng-model' => 'enterprise_fee.id', 'ng-options' => 'enterprise_fee.id as enterprise_fee.name for enterprise_fee in enterpriseFeesForEnterprise(order_cycle.coordinator_id)'}
|
||||
%td= link_to 'Remove', '#', {'id' => 'order_cycle_coordinator_fee_{{ $index }}_remove', 'ng-click' => 'removeCoordinatorFee($event, $index)'}
|
||||
= f.submit 'Add coordinator fee', 'ng-click' => 'addCoordinatorFee($event)'
|
||||
@@ -31,12 +31,7 @@
|
||||
%h2 Coordinator
|
||||
= f.label :coordinator_id, 'Coordinator'
|
||||
= f.collection_select :coordinator_id, coordinating_enterprises, :id, :name, {}, {'ng-model' => 'order_cycle.coordinator_id', 'ofw-on-change' => 'order_cycle.coordinator_fees = []', 'required' => true}
|
||||
|
||||
%table.coordinator-fees
|
||||
%tr{'ng-repeat' => 'enterprise_fee in order_cycle.coordinator_fees'}
|
||||
%td= select_tag 'order_cycle_coordinator_fee_{{ $index }}_id', nil, {'ng-model' => 'enterprise_fee.id', 'ng-options' => 'enterprise_fee.id as enterprise_fee.name for enterprise_fee in enterpriseFeesForEnterprise(order_cycle.coordinator_id)'}
|
||||
%td= link_to 'Remove', '#', {'id' => 'order_cycle_coordinator_fee_{{ $index }}_remove', 'ng-click' => 'removeCoordinatorFee($event, $index)'}
|
||||
= f.submit 'Add coordinator fee', 'ng-click' => 'addCoordinatorFee($event)'
|
||||
= render 'coordinator_fees', f: f
|
||||
|
||||
|
||||
%h2 Outgoing
|
||||
|
||||
Reference in New Issue
Block a user