mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Keep the action with save button
This commit is contained in:
@@ -86,4 +86,4 @@ angular.module('admin.orderCycles')
|
||||
$scope.submit = (destination) ->
|
||||
StatusMessage.display 'progress', "Saving..."
|
||||
OrderCycle.update(destination)
|
||||
this.order_cycle_form.$setPristine()
|
||||
$scope.order_cycle_form.$setPristine()
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
angular.module("admin.utils").directive "saveBar", (StatusMessage) ->
|
||||
restrict: "E"
|
||||
scope:
|
||||
save: "&"
|
||||
form: "="
|
||||
buttons: "="
|
||||
templateUrl: "admin/save_bar.html"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#save-bar.animate-show{ ng: { show: 'StatusMessage.active()' } }
|
||||
#save-bar.animate-show{ ng: { show: 'form.$dirty || StatusMessage.active()' } }
|
||||
.twelve.columns.alpha
|
||||
%h5#status-message{ ng: { style: 'StatusMessage.statusMessage.style' } }
|
||||
{{ StatusMessage.statusMessage.text || " " }}
|
||||
.four.columns.omega.text-right
|
||||
|
||||
%input.red{"ng-repeat" => "button in buttons", type: "button", value: "{{button.text}}", ng: { disabled: '!form.$dirty', click: "save({param: button.param})" } }
|
||||
%input.red{"ng-repeat" => "button in buttons", type: "button", value: "{{button.text}}", ng: { disabled: '!form.$dirty', click: "button.action(button.param)" } }
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
- ng_controller = order_cycles_simple_form ? 'AdminSimpleEditOrderCycleCtrl' : 'AdminEditOrderCycleCtrl'
|
||||
= form_for [main_app, :admin, @order_cycle], :url => '', :html => {:class => 'ng order_cycle', 'ng-app' => 'admin.orderCycles', 'ng-controller' => ng_controller, name: 'order_cycle_form'} do |f|
|
||||
|
||||
%save-bar{ buttons: "[{text: 'Update', param: null}, {text: 'Update and Close', param: '#{main_app.admin_order_cycles_path}'}]", save: "submit(param)", form: "order_cycle_form" }
|
||||
%save-bar{ buttons: "[{ text: 'Update', action: submit, param: null }, { text: 'Update and Close', action: submit, param: '#{main_app.admin_order_cycles_path}' }]", form: "order_cycle_form" }
|
||||
|
||||
- if order_cycles_simple_form
|
||||
= render 'simple_form', f: f
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
%form{ name: 'variant_overrides_form', ng: { show: "views.inventory.visible" } }
|
||||
%save-bar{ save: "update()", form: "variant_overrides_form", buttons: "[{text: 'Save Changes'}]" }
|
||||
%save-bar{ form: "variant_overrides_form", buttons: "[{ text: 'Save Changes', action: update }]" }
|
||||
%table.index.bulk#variant-overrides
|
||||
%col.producer{ width: "20%", ng: { show: 'columns.producer.visible' } }
|
||||
%col.product{ width: "20%", ng: { show: 'columns.product.visible' } }
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
= render :partial => 'spree/admin/shared/order_sub_menu'
|
||||
|
||||
%div{ ng: { controller: 'LineItemsCtrl' } }
|
||||
%save-bar{ save: "submit()", form: "bulk_order_form", buttons: "[{text: 'Save Changes'}]" }
|
||||
%save-bar{ form: "bulk_order_form", buttons: "[{ text: 'Save Changes', action: submit }]" }
|
||||
.filters{ :class => "sixteen columns alpha" }
|
||||
.date_filter{ :class => "two columns alpha" }
|
||||
%label{ :for => 'start_date_filter' }
|
||||
|
||||
Reference in New Issue
Block a user