styling fixes and fix for supplier deleted products...
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
@import "bootstrap"
|
||||
body
|
||||
padding-top: 42px
|
||||
padding-top: 42px
|
||||
.table
|
||||
&.table-condensed
|
||||
margin-bottom: 5px
|
||||
@import "bootstrap-responsive"
|
||||
|
||||
// Set the correct sprite paths
|
||||
|
||||
@@ -11,7 +11,7 @@ body
|
||||
.home-panel
|
||||
margin-left: 20px
|
||||
margin-right: 20px
|
||||
margin-top: 40px
|
||||
margin-top: 16px
|
||||
+box-shadow(#000 10px 10px 16px)
|
||||
background-color: rgba(240, 240, 240, 0.6)
|
||||
+border-radius(10px)
|
||||
|
||||
+1
-1
@@ -264,7 +264,7 @@ class List
|
||||
order_total = 0.0
|
||||
for product_order in order.product_orders
|
||||
order_total += (product_order.amount * product_order.price).round(2)
|
||||
ho[:products] << {name: product_order.product.name, id: product_order.product_id, number: product_order.amount, price: product_order.price}
|
||||
ho[:products] << {name: product_order.product_name, id: product_order.product_id, number: product_order.amount, price: product_order.price}
|
||||
end
|
||||
ho[:total_amount] = order_total.round(2)
|
||||
ho[:state] = order.state
|
||||
|
||||
@@ -10,4 +10,9 @@ class ProductOrder
|
||||
view :by_product_id, key: :product_id
|
||||
view :by_order_id, key: :order_id
|
||||
|
||||
# Getter for product name. If a supplier deletes a product, that has product_orders, the product
|
||||
# will become nil. This method should handle this case.
|
||||
def product_name
|
||||
product.try(:name) || '[deleted]'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -50,7 +50,6 @@ html lang="en"
|
||||
//li= link_to t('supplier.menu.active_orders', orders: Order.model_name.human_plural), supplier_active_orders_path
|
||||
//li= link_to t('supplier.menu.active_lists', lists: List.model_name.human_plural), supplier_active_lists_path
|
||||
li= link_to ProductCategory.model_name.human_plural, suppliers_product_categories_path
|
||||
li= link_to ProductCategory.model_name.human_plural, suppliers_product_categories_path
|
||||
li= link_to Product.model_name.human_plural, suppliers_products_path
|
||||
li= link_to Section.model_name.human_plural, suppliers_sections_path
|
||||
li= link_to Table.model_name.human_plural, suppliers_tables_path
|
||||
|
||||
@@ -2,13 +2,17 @@
|
||||
.pull-right
|
||||
.table-number
|
||||
.supplier-name
|
||||
dl.dl-horizontal
|
||||
dt data-t="attributes.list.created_at" = List.human_attribute_name(:created_at)
|
||||
dd.list-created-at
|
||||
dt data-t="attributes.list.closed_at" = List.human_attribute_name(:closed_at)
|
||||
dd.list-closed-at
|
||||
dt data-t="models.supplier" = Supplier.model_name.human
|
||||
dd.supplier-name
|
||||
table.table.table-condensed
|
||||
tbody
|
||||
tr
|
||||
td.key data-t="attributes.list.created_at" = List.human_attribute_name(:created_at)
|
||||
td.value.list-created-at
|
||||
tr
|
||||
td.key data-t="attributes.list.closed_at" = List.human_attribute_name(:closed_at)
|
||||
td.value.list-closed-at
|
||||
tr
|
||||
td.key data-t="models.supplier" = Supplier.model_name.human
|
||||
td.value.supplier-name
|
||||
.well
|
||||
table#history-list-table.table.list-table
|
||||
thead
|
||||
|
||||
Reference in New Issue
Block a user