cosmetics

This commit is contained in:
2015-05-27 15:28:09 +02:00
parent dcd8c13e57
commit 544049fdc7
8 changed files with 30 additions and 41 deletions
@@ -16,7 +16,6 @@ App.List = DS.Model.extend
table: DS.belongsTo('table')
join_requests: DS.hasMany('join_request')
users: DS.hasMany('user')
supplier_name: (-> @get('cached_supplier_name') or @get('supplier.name')).property('cached_supplier_name', 'supplier.name')
is_extended_version: ->
@get('extended_version')
@@ -1,6 +1,7 @@
.row
h2=t 'models.plural.list'
each list in lists: = view "list-index" contentBinding='list'
each list in lists
= view "list-index" content=list
.clearfix
if hasMore
button{action "showMore"}=t 'lists.show_more'
@@ -1,3 +1,3 @@
span.created_at=time list.created_at
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
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 :)
render json: list, serializer: UserExtendedListSerializer
end
@@ -9,12 +9,16 @@ class UserExtendedListSerializer < Qwaiter::Serializer
# user ids for facebook pictures
self.root = :list
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
def has_active_orders
object.has_active_orders?
end
def cached_supplier_name
object.supplier.name
end
has_many :orders
#has_many :product_categories
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.check_box :remember_me
|&nbsp;
= t('devise.sessions.remember_me')
= t('devise.sign_in.remember_me')
.control-group
.controls
= f.submit t('devise.sessions.button'), class: 'btn btn-primary'
= f.submit t('devise.sign_in.button'), class: 'button'
= render "links"