Product error handling

This commit is contained in:
2014-11-27 14:48:33 +01:00
parent 60f014811c
commit 5453837880
20 changed files with 96 additions and 39 deletions
@@ -1,13 +1,22 @@
.row.menu-product-container
if editMode
.small-3.columns= input value=product.name
.small-3.columns= edit-currency value=product.price validatePresence=true
.small-3.columns
= input value=product.name
= errors product.errors.name
.small-3.columns
= edit-currency value=product.price validatePresence=true
= errors product.errors.price
.small-3.columns= input value=product.code
.small-3.columns
a.destroy-product-action{action "destroyProduct" product}: span
a.save-product-action{action "save"}: span
else
.small-3.columns: span= product.name
.small-3.columns= currency product.price
.small-3.columns: span= product.code_or_empty
.small-3.columns: span.fa.fa-edit{action "makeEditable"}
if showProduct
.small-3.columns
span= product.name
= errors product.errors.name includeAttribute="product"
.small-3.columns
= currency product.price
= errors product.errors.price includeAttribute="product"
.small-3.columns: span= code_filter_display
.small-3.columns: span.fa.fa-edit{action "makeEditable"}
@@ -1,3 +1,5 @@
.products-menu-filters-container
= input value=product_code_filter type="search" placeholder=product_code_filter_placeholder
h2 Menu
each product_category in sorted_product_categories
.row.product_category-container: .small-12.columns
@@ -8,7 +10,7 @@ each product_category in sorted_product_categories
a.edit-product-category-button{action "editProductCategory" product_category} href="#"
a.add-product-product-category-button{action "addProduct" product_category} href="#": span
each product in product_category.sorted_products
= menu-product product=product
= menu-product product=product code_filter=product_code_filter
.row
.small-12.columns
a.button{action "newProductCategory"} href="#" = t 'product_category.new_button'
@@ -2,7 +2,7 @@
.form-label.half=t 'attributes.product_category.name'
.form-field.half= input valueBinding="model.name"
.row
.small-6.columns
.small-12.medium-6.columns
unless model.supplier.week_starts_on_monday
.form-row
.form-label.half= t 'date.day_name.sunday'
@@ -29,7 +29,7 @@
.form-row
.form-label.half= t 'date.day_name.sunday'
.form-field.half= view "boolean-switch" valueBinding=model.active_on_sunday
.small-6.columns
.small-12.medium-6.columns
.row
.small-12.columns.text-center= view 'boolean-button' value=model.full_day reverse=true text_path="product_category.modal.active_between.top"
unless model.full_day
@@ -9,13 +9,14 @@ each product_category in product_categories
a{action "moveBelow" product_category} href="#"
span.title= product_category.name
span.availability= product_category.availability_text
hr
h4=t 'product_category.modal.move.products.title'
hr
ul.sortable
each product in model.sorted_products
li.sortable-item-container data-sortable-id=product.id
span.handle
span= product.name
if model.products
hr
h4=t 'product_category.modal.move.products.title'
hr
ul.sortable
each product in model.sorted_products
li.sortable-item-container data-sortable-id=product.id
span.handle
span= product.name
hr
button.modal-close{action "close"}=t 'section.add_tables.modal.close_button'