Files
openfoodnetwork/app/views/admin/enterprises/_ng_form.html.haml
2014-12-19 13:52:01 +11:00

22 lines
883 B
Plaintext

-# Not all inputs are ng inputs, they don't make the form dirty on change.
-# ng-change is only valid for inputs, not for a form.
-# So we use onchange and have to get the scope to access the ng controller
-# The nav-check-callback is warning on leave if the form is dirty.
= form_for [main_app, :admin, @enterprise], html: { name: "enterprise",
"ng-app" => 'admin.enterprises',
"ng-submit" => "navClear()",
"ng-controller" => 'enterpriseCtrl',
"nav-check-callback" => 'enterpriseNavCallback',
'onchange' => 'angular.element(enterprise).scope().enterprise.$setDirty()',
} do |f|
.row
.sixteen.columns.alpha
.four.columns.omega
= render 'side_menu'
.one.column  
.eleven.columns.alpha.fullwidth_inputs
= render 'form', f: f
.row
.twelve.columns.alpha
= render partial: "spree/admin/shared/#{action}_resource_links"