Add angular include, basic controller for listing enterprise fees, display fee ids using angular

This commit is contained in:
Rohan Mitchell
2012-11-21 14:59:02 +11:00
parent 63ba5d13a3
commit dd155532f8
2 changed files with 22 additions and 1 deletions

View File

@@ -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() {
}
});
});
*/

View File

@@ -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