Current state with 6 failures is considered to be better than the previous one
This commit is contained in:
@@ -18,6 +18,13 @@ Qsupplier.App.SectionController = Ember.ObjectController.extend
|
||||
@send 'openModal', 'modal_section_add_tables', @get('model')
|
||||
arrangeTables: ->
|
||||
@send 'openModal', 'modal_section_arrange_tables', @get('model')
|
||||
editTable: (table)->
|
||||
@modal 'edit_table',
|
||||
model: table
|
||||
ok: ->
|
||||
table.save()
|
||||
close: ->
|
||||
table.rollback()
|
||||
destroySection: ->
|
||||
@send 'openModal', 'modal_confirm',
|
||||
title: t('helpers.links.are_you_sure')
|
||||
|
||||
@@ -8,7 +8,7 @@ Qsupplier.App.Table = DS.Model.extend
|
||||
# occupied: attr 'boolean'
|
||||
section: DS.belongsTo('section')
|
||||
#active_list: DS.belongsTo('list', key: 'active_list')
|
||||
active_list: DS.belongsTo('list')
|
||||
active_list: DS.belongsTo('list', async: true)
|
||||
#list: DS.belongsTo('list')
|
||||
#active_list: (->
|
||||
#@get('list')
|
||||
|
||||
@@ -4,12 +4,14 @@
|
||||
span.needs_help
|
||||
span.active_order
|
||||
if table.active_list
|
||||
div class="table-actions table-actions-#{unbound table.id}"
|
||||
div.table-actions
|
||||
.title= table.number
|
||||
.table-action-row
|
||||
Qsupplier.App.MarkListHelpedButtonView content=table.active_list
|
||||
Qsupplier.App.CloseListButtonView content=table.active_list
|
||||
.table-action-row=currency table.active_list.total
|
||||
/.table-action-row
|
||||
a{action "editTable" table}: span.fa.fa-lg.fa-wrench
|
||||
each user in table.active_list.users
|
||||
img src=user.facebook_image
|
||||
if editmodedisabled
|
||||
|
||||
@@ -124,19 +124,13 @@ class UserController < Users::ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
# GET /user/join_occupied_table
|
||||
def join_occupied_table
|
||||
#redirect_to user_root_path(message: 'table_not_found') and return unless params[:table_id].present?
|
||||
#@table = Table.find(params[:table_id])
|
||||
end
|
||||
|
||||
# POST /user/join_occupied_table
|
||||
def request_to_join_occupied_table
|
||||
render json: json_alert('messages.table_not_found') and return unless params[:table_id].present?
|
||||
@table = Table.find(params[:table_id])
|
||||
if @list = @table.active_list
|
||||
@list.send_table_join_request_for_user! current_user
|
||||
end
|
||||
end
|
||||
render nothing: true
|
||||
end
|
||||
|
||||
|
||||
+2
-1
@@ -240,7 +240,8 @@ class List
|
||||
end
|
||||
|
||||
def send_table_join_request_for_user!(requester)
|
||||
unless join_request_user_ids.include?(requester.id)
|
||||
unless join_request_user_ids.include?(requester.id) or user_ids.include?(requester.id)
|
||||
@join_requests = nil # bust cache
|
||||
self.join_request_user_ids << requester.id
|
||||
self.is_dirty
|
||||
if save
|
||||
|
||||
@@ -3,6 +3,7 @@ class JoinRequest
|
||||
def id
|
||||
"jr-#{user_id}"
|
||||
end
|
||||
alias _id id
|
||||
|
||||
def initialize(user: nil, list: nil)
|
||||
@user, @list = user, list
|
||||
@@ -35,6 +36,7 @@ class JoinRequest
|
||||
def serializable_hash
|
||||
{
|
||||
id: id,
|
||||
_id: id,
|
||||
user_id: user.id,
|
||||
user_facebook_id: user.uid,
|
||||
user_email: user.email,
|
||||
|
||||
Reference in New Issue
Block a user