Spec fixes

This commit is contained in:
2014-12-01 17:54:55 +01:00
parent 9ef3d4b725
commit 60e6b2a648
21 changed files with 74 additions and 86 deletions
@@ -1,11 +1,15 @@
App.TablesIndexController = Ember.ArrayController.extend
tables: (-> @get('model').sortBy('casted_number')).property('model.@each.number')
actions:
newTable: ->
table = @store.createRecord('table')
@modal 'table_edit',
model: table
close: -> table.deleteRecord()
editTable: (table)->
@modal 'table_edit',
model: table
close: ->
table.rollback()
close: -> table.rollback()
destroyTable: (table)->
@modal 'confirm',
title: t('table.destroy.modal.title', number: table.get('number'))
@@ -1,8 +1,8 @@
attr = DS.attr
App.Table = DS.Model.extend
number: attr 'number'
width: attr 'number'
height: attr 'number'
number: attr 'number', defaultValue: 0
width: attr 'number', defaultValue: 1
height: attr 'number', defaultValue: 1
position_x: attr 'number'
position_y: attr 'number'
# occupied: attr 'boolean'
@@ -16,15 +16,16 @@ header.top-menu
.extra-info
.supplier-info-row
.counter.supplier-orders-placed-count
= supplier.orders_placed_count
span.supplier-orders-placed-count-number= supplier.orders_placed_count
span.orders-placed-count-icon
.supplier-info-row
.counter.supplier-orders-in-process-count
= supplier.orders_in_process_count
span.supplier-orders-in-process-count-number= supplier.orders_in_process_count
span.orders-in-process-count-icon
aside.side-menu
ul
li.title: h3 Menu
li.supplier-name= supplier.name
if supplier.open
li: a.supplier-close-shop{action "markSupplierClosed"}= t 'supplier.close_for_orders'
else
@@ -1,12 +1,10 @@
p=t 'table.edit.modal.body_header'
.form-row
.form-row.number
.form-label=t 'attributes.table.number'
.form-field= input type="number" valueBinding="model.number"
.form-row
.form-row.section
.form-label=t 'models.section'
.form-field
= view "select" content=sections selectionBinding="model.section" optionLabelPath="content.title" optionValuePath="content.id"
= model.section.title
.form-field= view "select" content=sections selectionBinding="model.section" optionLabelPath="content.title" optionValuePath="content.id"
hr
button.modal-close{action "close"}=t 'section.add_tables.modal.close_button'
button.modal-confirm.right{action "save"}=t 'section.add_tables.modal.add_button'
@@ -20,3 +20,4 @@
td.actions
a.table-edit{ action 'editTable' table }: span
a.table-destroy{ action 'destroyTable' table }: span
a.button.new-table-button{action "newTable"}= t 'table.new_button'