diff --git a/app/assets/javascripts/admin/enterprise_fees.js b/app/assets/javascripts/admin/enterprise_fees.js index e07b0d86ce..e2cbb28bbc 100644 --- a/app/assets/javascripts/admin/enterprise_fees.js +++ b/app/assets/javascripts/admin/enterprise_fees.js @@ -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() { } }); }); +*/ \ No newline at end of file diff --git a/app/views/admin/enterprise_fees/index.html.haml b/app/views/admin/enterprise_fees/index.html.haml index 79bd95d755..4e7bdd6187 100644 --- a/app/views/admin/enterprise_fees/index.html.haml +++ b/app/views/admin/enterprise_fees/index.html.haml @@ -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