Dynamic pages, language switcher and fix schedule drag drop time mismatch bug
This commit is contained in:
@@ -25,6 +25,7 @@ String.prototype.capitalize = function() { return this.charAt(0).toUpperCase() +
|
||||
window.time_zones = <%= ActiveSupport::TimeZone.all.map{|tz| {name: tz.name, formatted: "GMT#{tz.formatted_offset} #{tz.name}"}}.to_json.html_safe %>;
|
||||
window.countries = <%= IsoCountryCodes.all.map{|cc| {name: cc.name}}.to_json.html_safe %>;
|
||||
|
||||
|
||||
var path_mapping = {
|
||||
user_root: '/user',
|
||||
join_occupied_table: '/user/join_occupied_table',
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
class List
|
||||
constructor: (@attributes)->
|
||||
id: -> @attributes.id || @attributes._id
|
||||
table_number: -> @attributes.table_number
|
||||
total_amount: -> @attributes.total_amount
|
||||
section_title: -> @attributes.section_title
|
||||
needs_help: -> @attributes.needs_help
|
||||
needs_payment: -> @attributes.needs_payment
|
||||
active: -> @attributes.state == 'active'
|
||||
table_id: -> @attributes.table_id
|
||||
products: -> @attributes.products || []
|
||||
has_active_orders: -> @attributes.has_active_orders
|
||||
supplier_name: -> @attributes.supplier_name
|
||||
created_at: -> @attributes.created_at
|
||||
display: ->
|
||||
txt = @supplier_name()
|
||||
txt += ' - '
|
||||
txt += Quser.format_date(@created_at())
|
||||
txt
|
||||
|
||||
@List = List
|
||||
@@ -1,17 +0,0 @@
|
||||
class Order
|
||||
constructor: (@attributes)->
|
||||
table_number: -> @attributes.table_number
|
||||
id: -> @attributes.id || @attributes._id
|
||||
total_amount: -> @attributes.total_amount
|
||||
section_title: -> @attributes.section_title
|
||||
list_id: -> @attributes.list_id
|
||||
state: -> @attributes.state
|
||||
display: ->
|
||||
order_txts = []
|
||||
return '' unless @attributes.products
|
||||
for product in @attributes.products
|
||||
order_txts.push(product.name + ' (' + product.number + ')')
|
||||
order_txts.join(', ')
|
||||
can_process: -> @attributes.state == 'placed'
|
||||
|
||||
@Order = Order
|
||||
Reference in New Issue
Block a user