Style upgrades and emberified supplier lists

This commit is contained in:
2014-04-24 16:41:08 +02:00
parent 546e4499ea
commit 27a1022eb4
56 changed files with 321 additions and 139 deletions
@@ -0,0 +1,19 @@
class SupplierListSerializer < Qwaiter::Serializer
# user ids for facebook pictures
self.root = :list
embed :ids, include: true
attributes :extended_version, :state, :needs_help, :needs_payment, :user_requests_closing, :is_paid, :price,
:table_id, :table_number, :section_id, :user_ids, :supplier_id, :closed_at
has_many :orders
#has_many :product_categories
has_one :table, serializer: SupplierTableSerializer
has_many :join_requests
has_many :users, serializer: SupplierUserSerializer
#def has_active_orders
#object.has_active_orders?
#end
def extended_version
true
end
end
@@ -0,0 +1,9 @@
class SupplierSupplierSerializer < Qwaiter::Serializer
self.root = :supplier
attributes :extended_version, :open, :name
def extended_version
false
end
end
@@ -0,0 +1,6 @@
class SupplierTableSerializer < Qwaiter::Serializer
self.root = :table
embed :ids, include: true
attributes :number, :width, :height, :position_x, :position_y, :section_id, :occupied, :needs_help
has_one :supplier, serializer: SupplierSupplierSerializer
end
@@ -0,0 +1,4 @@
class SupplierUserSerializer < Qwaiter::Serializer
self.root = :user
attributes :email, :facebook_id
end
+1 -1
View File
@@ -1,7 +1,7 @@
class UserListSerializer < Qwaiter::Serializer
# user ids for facebook pictures
#embed :ids
attributes :state, :needs_help, :needs_payment, :user_requests_closing, :is_paid, :price, :table_id, :table_number, :section_id, :user_ids, :supplier_name, :closed_at
attributes :state, :needs_help, :needs_payment, :user_requests_closing, :is_paid, :price, :table_id, :table_number, :section_id, :user_ids, :supplier_name, :closed_at, :supplier_id
#def has_active_orders
#object.has_active_orders?