supplier updates mostly
This commit is contained in:
@@ -1,9 +1,34 @@
|
||||
class SupplierController < ApplicationController
|
||||
before_filter :authenticate_supplier!
|
||||
layout 'tablet'
|
||||
|
||||
def home
|
||||
render layout: 'tablet'
|
||||
end
|
||||
|
||||
# GET /supplier/settings
|
||||
def edit
|
||||
@supplier = current_supplier
|
||||
end
|
||||
|
||||
# POST /supplier/settings
|
||||
def update
|
||||
@supplier = current_supplier
|
||||
if current_supplier.update_attributes(params[:supplier])
|
||||
redirect_to supplier_root_path
|
||||
else
|
||||
render action: :edit
|
||||
end
|
||||
end
|
||||
|
||||
def mark_as_open
|
||||
current_supplier.mark_as_open!
|
||||
redirect_to :back
|
||||
end
|
||||
def mark_as_closed
|
||||
current_supplier.mark_as_closed!
|
||||
redirect_to :back
|
||||
end
|
||||
# GET /suppliers/1/active_orders
|
||||
# GET /suppliers/1/active_orders.json
|
||||
def active_orders
|
||||
|
||||
@@ -31,6 +31,8 @@ class UserController < ApplicationController
|
||||
@table = Table.find(params[:table_id])
|
||||
res = {}
|
||||
res[:ocupied] = @table.occupied?
|
||||
res[:reserved] = @table.reserved?
|
||||
res[:supplier_closed] = @table.supplier.closed?
|
||||
if list.present?
|
||||
res[:other_supplier] = true if list.supplier_id != @table.supplier_id
|
||||
res[:current_table_id] = list.table_id
|
||||
|
||||
Reference in New Issue
Block a user