mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Add angular include, basic controller for listing enterprise fees, display fee ids using angular
This commit is contained in:
@@ -1,3 +1,18 @@
|
||||
function AdminEnterpriseFeesCtrl($scope, $http) {
|
||||
$http.get('/admin/enterprise_fees.json').success(function(data) {
|
||||
$scope.enterprise_fees = data;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
// Hide calculator preference fields when calculator type changed
|
||||
// Fixes 'Enterprise fee is not found' error when changing calculator type
|
||||
// See spree/core/app/assets/javascripts/admin/calculator.js
|
||||
@@ -24,3 +39,4 @@ $(document).ready(function() {
|
||||
}
|
||||
});
|
||||
});
|
||||
*/
|
||||
@@ -1,10 +1,13 @@
|
||||
- content_for :head do
|
||||
= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js"
|
||||
|
||||
= form_for @enterprise_fee_set, :url => main_app.bulk_update_admin_enterprise_fees_path do |enterprise_fee_set_form|
|
||||
- if @enterprise_fee_set.errors.present?
|
||||
%h2 Errors
|
||||
%ul
|
||||
- @enterprise_fee_set.errors.each do |error|
|
||||
%li= error
|
||||
%table.index#listing_enterprise_fees
|
||||
%table.index#listing_enterprise_fees{'ng-app' => '', 'ng-controller' => 'AdminEnterpriseFeesCtrl'}
|
||||
%thead
|
||||
%tr
|
||||
%th Enterprise
|
||||
@@ -14,6 +17,8 @@
|
||||
%th Calculator values
|
||||
%th
|
||||
%tbody
|
||||
%tr{'ng-repeat' => 'enterprise_fee in enterprise_fees'}
|
||||
%td {{ enterprise_fee.id }}
|
||||
= enterprise_fee_set_form.fields_for :collection do |f|
|
||||
- enterprise_fee = f.object
|
||||
%tr
|
||||
|
||||
Reference in New Issue
Block a user