mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-28 01:53:25 +00:00
Add client-side validation to order cycle form
This commit is contained in:
@@ -11,4 +11,4 @@ $(document).ready(function() {
|
||||
buttonImageOnly: true,
|
||||
stepMinute: 15
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -18,3 +18,7 @@
|
||||
float: right;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.ng .ng-invalid.ng-dirty {
|
||||
background-color: #fa787e;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
%h1 New Order Cycle
|
||||
|
||||
= form_for [main_app, :admin, @order_cycle], :url => '', :html => {'ng-app' => 'order_cycle', 'ng-controller' => 'AdminOrderCycleCtrl', 'ng-submit' => 'submit()'} do |f|
|
||||
= form_for [main_app, :admin, @order_cycle], :url => '', :html => {:class => 'ng', 'ng-app' => 'order_cycle', 'ng-controller' => 'AdminOrderCycleCtrl', 'ng-submit' => 'submit()'} do |f|
|
||||
= f.label :name
|
||||
= f.text_field :name, 'ng-model' => 'order_cycle.name'
|
||||
= f.text_field :name, 'ng-model' => 'order_cycle.name', 'required' => true
|
||||
%br/
|
||||
|
||||
= f.label :orders_open_at, 'Orders open'
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
%h2 Coordinator
|
||||
= f.label :coordinator_id, 'Coordinator'
|
||||
= f.collection_select :coordinator_id, Enterprise.all, :id, :name, {}, {'ng-model' => 'order_cycle.coordinator_id'}
|
||||
= f.collection_select :coordinator_id, Enterprise.all, :id, :name, {}, {'ng-model' => 'order_cycle.coordinator_id', 'required' => true}
|
||||
|
||||
%h2 Outgoing
|
||||
%p TODO
|
||||
|
||||
Reference in New Issue
Block a user