mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-01 06:41:41 +00:00
Improve formatting around saving on line items index (BOM)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#save-bar.animate-show{ ng: { show: 'dirty()' } }
|
||||
.twelve.columns.alpha
|
||||
%h5{ ng: { show: "dirty() && !saving()" } }
|
||||
You have made unsaved changes
|
||||
You have unsaved changes
|
||||
%h5{ ng: { hide: "dirty() || saving()" } }
|
||||
All changes saved
|
||||
%h5{ ng: { show: "saving()" } }
|
||||
|
||||
@@ -8,6 +8,12 @@ input, div {
|
||||
}
|
||||
}
|
||||
|
||||
input.show-dirty {
|
||||
&.ng-dirty {
|
||||
border: solid 1px orange;
|
||||
}
|
||||
}
|
||||
|
||||
input, div {
|
||||
&.update-error {
|
||||
border: solid 1px red;
|
||||
|
||||
@@ -146,14 +146,13 @@
|
||||
%td.variant{ 'ng-show' => 'columns.variant.visible' }
|
||||
%a{ :href => '#', 'ng-click' => "setSelectedUnitsVariant(line_item.units_product,line_item.units_variant)" } {{ line_item.units_variant.full_name }}
|
||||
%td.quantity{ 'ng-show' => 'columns.quantity.visible' }
|
||||
%input{ :type => 'number', :name => 'quantity', :id => 'quantity', ng: { model: "line_item.quantity", change: "updateOnQuantity(line_item)", required: "true" }, min: 1, 'obj-for-update' => "line_item", "attr-for-update" => "quantity" }
|
||||
%input.show-dirty{ :type => 'number', :name => 'quantity', :id => 'quantity', ng: { model: "line_item.quantity", change: "updateOnQuantity(line_item)", required: "true" }, min: 1, step: 1 }
|
||||
%td.max{ 'ng-show' => 'columns.max.visible' } {{ line_item.max_quantity }}
|
||||
%td.final_weight_volume{ 'ng-show' => 'columns.final_weight_volume.visible' }
|
||||
%input{ :type => 'number', :name => 'final_weight_volume', :id => 'final_weight_volume', ng: { model: "line_item.final_weight_volume", readonly: "unitValueLessThanZero(line_item)", change: "weightAdjustedPrice(line_item)", required: "true" }, min: 0, 'ng-pattern' => '/[1-9]+/', 'obj-for-update' => "line_item", "attr-for-update" => "final_weight_volume" }
|
||||
%input.show-dirty{ :type => 'number', :name => 'final_weight_volume', :id => 'final_weight_volume', ng: { model: "line_item.final_weight_volume", readonly: "unitValueLessThanZero(line_item)", change: "weightAdjustedPrice(line_item)", required: "true" }, min: 0, 'ng-pattern' => '/[1-9]+/' }
|
||||
%td.price{ 'ng-show' => 'columns.price.visible' }
|
||||
%input{ :type => 'text', :name => 'price', :id => 'price', :value => '{{ line_item.price * line_item.quantity | currency }}', 'ng-readonly' => "true", 'obj-for-update' => "line_item", "attr-for-update" => "price" }
|
||||
%input.show-dirty{ :type => 'text', :name => 'price', :id => 'price', :ng => { model: 'line_item.price', readonly: "true" }, 'scale-as-currency' => 'line_item.quantity' }
|
||||
%td.actions
|
||||
%a{ href: "/admin/orders/{{line_item.order.number}}/edit", :class => "edit-order icon-edit no-text", 'confirm-link-click' => 'confirmRefresh()' }
|
||||
%td.actions
|
||||
%a{ 'ng-click' => "deleteLineItem(line_item)", :class => "delete-line-item icon-trash no-text" }
|
||||
%input{ :type => "button", 'value' => 'Update', 'ng-click' => 'submit()' }
|
||||
|
||||
Reference in New Issue
Block a user