Merge branch 'master' of uflows.com:/var/git/qwaiter

This commit is contained in:
2015-05-29 15:28:48 +02:00
8 changed files with 30 additions and 41 deletions
@@ -16,7 +16,6 @@ App.List = DS.Model.extend
table: DS.belongsTo('table') table: DS.belongsTo('table')
join_requests: DS.hasMany('join_request') join_requests: DS.hasMany('join_request')
users: DS.hasMany('user') users: DS.hasMany('user')
supplier_name: (-> @get('cached_supplier_name') or @get('supplier.name')).property('cached_supplier_name', 'supplier.name')
is_extended_version: -> is_extended_version: ->
@get('extended_version') @get('extended_version')
@@ -1,6 +1,7 @@
.row .row
h2=t 'models.plural.list' h2=t 'models.plural.list'
each list in lists: = view "list-index" contentBinding='list' each list in lists
= view "list-index" content=list
.clearfix .clearfix
if hasMore if hasMore
button{action "showMore"}=t 'lists.show_more' button{action "showMore"}=t 'lists.show_more'
@@ -1,3 +1,3 @@
span.created_at=time list.created_at span.created_at=time list.created_at
span.price.currency= currency list.price span.price.currency= currency list.price
span.name= list.supplier_name span.name= list.cached_supplier_name
@@ -22,6 +22,7 @@ module Users
def show def show
list = List.find(params[:id]) list = List.find(params[:id])
render json: {}, status: :not_found and return unless list.present? && Array.wrap(list.user_ids).include?(current_user.id)
[list].include_relation(supplier: {product_categories: :products}, orders: :product_orders) # table also when it is a real array :) [list].include_relation(supplier: {product_categories: :products}, orders: :product_orders) # table also when it is a real array :)
render json: list, serializer: UserExtendedListSerializer render json: list, serializer: UserExtendedListSerializer
end end
@@ -9,12 +9,16 @@ class UserExtendedListSerializer < Qwaiter::Serializer
# user ids for facebook pictures # user ids for facebook pictures
self.root = :list self.root = :list
attributes :extended_version, :state, :needs_help, :needs_payment, :user_requests_closing, :is_paid, :price, 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 :table_id, :table_number, :section_id, :user_ids, :supplier_id, :closed_at, :cached_supplier_name
#:supplier_orders_in_process_count, :supplier_orders_placed_count #:supplier_orders_in_process_count, :supplier_orders_placed_count
def has_active_orders def has_active_orders
object.has_active_orders? object.has_active_orders?
end end
def cached_supplier_name
object.supplier.name
end
has_many :orders has_many :orders
#has_many :product_categories #has_many :product_categories
has_one :table, serializer: UserExtendedTableSerializer # this one add a lot of stuff has_one :table, serializer: UserExtendedTableSerializer # this one add a lot of stuff
+2 -2
View File
@@ -12,8 +12,8 @@ h2= t('devise.sessions.title')
= f.label :remember_me do = f.label :remember_me do
= f.check_box :remember_me = f.check_box :remember_me
|&nbsp; |&nbsp;
= t('devise.sessions.remember_me') = t('devise.sign_in.remember_me')
.control-group .control-group
.controls .controls
= f.submit t('devise.sessions.button'), class: 'btn btn-primary' = f.submit t('devise.sign_in.button'), class: 'button'
= render "links" = render "links"
+16 -24
View File
@@ -4,18 +4,10 @@ en:
hello: "Hello world" hello: "Hello world"
page: page:
not_found: "404 The page you were looking for could not be found" not_found: "404 The page you were looking for could not be found"
menu:
home: Home
about: About
bars_restaurants: 'Bars & Restaurants'
clients: Gebruikers
enquete: Enquete
cartoon: Cartoon
contact: Contact
helpers: helpers:
links: links:
are_you_sure: 'Are you sure?' are_you_sure: 'Are you sure?'
place_order: Place order place_order: Place ${models.order}
show_active_list: Show %{list} show_active_list: Show %{list}
edit: Edit edit: Edit
show: Show show: Show
@@ -37,22 +29,22 @@ en:
title: Actions title: Actions
#depricated, moved to user #depricated, moved to user
messages: messages:
cannot_order_on_non_active_list: You cannot place an order on a closed list cannot_order_on_non_active_list: You cannot place an ${models.order} on a closed ${models.list}
no_active_list: There is no active list no_active_list: There is no active ${models.list}
order_is_placed: Your order has been received in good order order_is_placed: Your order has been received in good order
new_list_created: A new ${models.list} has been created new_list_created: A new ${models.list} has been created
the_list_has_been_closed: The list has been closed the_list_has_been_closed: The ${models.list} has been closed
illegal_history_list_attempt: The list you want to access is not yours illegal_history_list_attempt: The ${models.list} you want to access is not yours
table_not_found: The requested table cannot be found or is not given table_not_found: The requested ${models.table} cannot be found or is not given
table_is_occupied: The table you want to sit on is already occupied table_is_occupied: The ${models.table} you want to sit on is already occupied
table_is_reserved: The table you want to sit on is reserved by someone else table_is_reserved: The ${models.table} you want to sit on is reserved by someone else
table_is_closed: The table you want to sit on is not available for service table_is_closed: The ${models.table} you want to sit on is not available for service
supplier_is_closed: The owner of this table is currently not handling orders supplier_is_closed: The owner of this ${models.table} is currently not handling orders
join_request_rejected: Your request to join the table has been rejected join_request_rejected: Your request to join the ${models.table} has been rejected
join_request_approved: Your request to join the table has been approved join_request_approved: Your request to join the ${models.table} has been approved
table_is_from_other_supplier: You cannot move to another table when you have an open list table_is_from_other_supplier: You cannot move to another ${models.table} when you have an open ${models.list}
moved_to_another_table: You successfully moved to another table moved_to_another_table: You successfully moved to another ${models.table}
cannot_identify_table: The application cannot determine the table number cannot_identify_table: The application cannot determine the ${models.table} ${attributes.table.number}
action: action:
index: index:
label: Listing %{models} label: Listing %{models}
@@ -69,7 +61,7 @@ en:
destroy: destroy:
successfull: '%{model} is successfully destroyed' successfull: '%{model} is successfully destroyed'
table: table:
is_occupied: This table is occupied is_occupied: This ${models.table} is occupied
general: general:
boolean: boolean:
boolean_yes: "Yes" boolean_yes: "Yes"
-8
View File
@@ -3,14 +3,6 @@
nl: nl:
page: page:
not_found: "404 de pagina die u probeert te bereiken kan niet worden gevonden" not_found: "404 de pagina die u probeert te bereiken kan niet worden gevonden"
menu:
home: Home
about: Over mozo.bar
bars_restaurants: 'Horeca'
clients: Gebruikers
enquete: Enquete
cartoon: Cartoon
contact: Contact
helpers: helpers:
links: links:
are_you_sure: 'Weet je dit zeker?' are_you_sure: 'Weet je dit zeker?'