This commit is contained in:
2013-01-08 10:15:28 +01:00
parent 63cb3593ed
commit e36263b153
13 changed files with 35 additions and 16 deletions
@@ -8,5 +8,12 @@ class List
needs_payment: -> @attributes.needs_payment
active: -> @attributes.state == 'active'
products: -> @attributes.products || []
supplier_name: -> @attributes.supplier_name
created_at: -> @attributes.created_at
display: ->
txt = @supplier_name()
txt += ' - '
txt += Quser.format_date(@created_at())
txt
@List = List
@@ -28,6 +28,7 @@
//= require bootstrap
//= require qwaiter
//= require supplier/order
//= require supplier/list
//= require mustache
//= require faye
//= require_directory .
+2 -8
View File
@@ -95,7 +95,7 @@ class Quser
$('.table-number').text(response.table_number) if response.table_number
$('.supplier-name').text(response.supplier_name) if response.supplier_name
if response.not_present || response.list_active == false then $('.home-link').hide() else $('.home-link').show()
if response.not_present || response.list_active == false then $('.home-link').removeClass('active') else $('.home-link').addClass('active')
@list_needs_payment_default_action(response)
@list_needs_help_default_action(response)
@@ -209,13 +209,7 @@ class Quser
@paginate(res, @load_list_history)
container = $('#list-history-container').html('')
for list in res.lists
li = $('<li></li>').appendTo(container)
link = $('<a href="#"></a>').appendTo(li)
link.click(-> redirect_to 'history_list', list_id: list._id)
txt = list.supplier_name
txt += ' - '
txt += @format_date(list.created_at)
link.text(txt)
container.append @mustache('#list-history-template', new List(list) )
)
paginate: (wrapper, callback) ->
container = $('nav.pagination')
@@ -3,3 +3,4 @@
#products-table
.order-product-button
+wood-button
color: white
@@ -37,14 +37,22 @@ body
margin-left: auto
margin-right: auto
width: 262px
text-align: center
a
+user-button
float: none
display: none
width: 34px
height: 34px
&.active
display: inline-block
span
display: block
width: 28px
height: 26px
background-repeat: no-repeat
background-position: center center
margin: 4px auto auto auto
&.home-list-link
span
background-image: image-url('icons/list.png')