Files
openfoodnetwork/app/views/admin/enterprise_fees/index.html.haml
2014-02-26 15:38:41 +11:00

36 lines
1.6 KiB
Plaintext

= content_for :page_title do
Enterprise Fees
= ng_form_for @enterprise_fee_set, :url => main_app.bulk_update_admin_enterprise_fees_path, :html => {'ng-app' => 'enterprise_fees', 'ng-controller' => 'AdminEnterpriseFeesCtrl'} do |enterprise_fee_set_form|
= hidden_field_tag 'enterprise_id', @enterprise.id if @enterprise
- if @enterprise_fee_set.errors.present?
%h2 Errors
%ul
- @enterprise_fee_set.errors.each do |error|
%li= error
%input.search{'ng-model' => 'query', 'placeholder' => 'Search'}
%table.index#listing_enterprise_fees
%thead
%tr
%th Enterprise
%th Fee Type
%th Name
%th Calculator
%th Calculator values
%th.actions
%tbody
= enterprise_fee_set_form.ng_fields_for :collection do |f|
%tr{'ng-repeat' => 'enterprise_fee in enterprise_fees | filter:query'}
%td
= f.ng_hidden_field :id
= f.ng_collection_select :enterprise_id, @enterprises, :id, :name, 'enterprise_fee.enterprise_id', :include_blank => true
%td= f.ng_select :fee_type, enterprise_fee_type_options, 'enterprise_fee.fee_type'
%td= f.ng_text_field :name
%td= f.ng_collection_select :calculator_type, @calculators, :name, :description, 'enterprise_fee.calculator_type', {'class' => 'calculator_type', 'ng-model' => 'calculatorType', 'spree-ensure-calculator-preferences-match-type' => "1"}
%td{'ng-bind-html-unsafe-compiled' => 'enterprise_fee.calculator_settings'}
%td.actions{'spree-delete-resource' => "1"}
= enterprise_fee_set_form.submit 'Update'