add testing device images and a lot more, before bootstrap:themed

This commit is contained in:
2012-08-24 13:46:59 +02:00
parent 5b27d6dcd9
commit e3c189d187
33 changed files with 2003 additions and 51 deletions
+29 -3
View File
@@ -4,10 +4,14 @@ class DashboardController < ApplicationController
def home
end
def phone_home
render layout: 'phone'
end
# Testing action
def select_qrcode
@tables = Table.all
render layout: 'phone'
end
def create_list
@@ -25,8 +29,7 @@ class DashboardController < ApplicationController
def show_products
@supplier = Supplier.first
render layout: 'phone'
end
def order_active_list
@@ -50,6 +53,29 @@ class DashboardController < ApplicationController
def view_active_list
redirect_to(root_path, alert: t('messages.there_is_no_list_active')) and return unless session[:active_list_id].present?
render layout: 'phone'
end
##
# Displays the closed lists of the user
def user_history
render layout: 'phone'
end
def list_info
respond_to do |format|
format.json do
render json: {list_active: false} and return unless session[:active_list_id].present?
render json: active_list.as_json.merge(list_active: true)
end
end
end
def supplier_home
redirect_to active_orders_supplier_path(Supplier.first)
end
def supplier_lists
redirect_to active_lists_supplier_path(Supplier.first)
end
end
+7 -7
View File
@@ -99,12 +99,12 @@ class SuppliersController < ApplicationController
end
end
# GET /suppliers/1/active_order_list
# GET /suppliers/1/active_order_list.json
def active_order_list
# GET /suppliers/1/active_orders
# GET /suppliers/1/active_orders.json
def active_orders
@supplier = Supplier.find(params[:id])
respond_to do |format|
format.html
format.html { render layout: 'tablet' }
format.json do
h = @supplier.as_json
h[:orders] = []
@@ -124,7 +124,7 @@ class SuppliersController < ApplicationController
h[:orders] << ho
end
h[:total_amount] = list_total.round(2)
render json: h
render json: h, layout: 'tablet'
end
end
end
@@ -134,7 +134,7 @@ class SuppliersController < ApplicationController
def active_lists
@supplier = Supplier.find(params[:id])
respond_to do |format|
format.html
format.html { render layout: 'tablet' }
format.json do
h = @supplier.as_json
h[:lists] = []
@@ -146,7 +146,7 @@ class SuppliersController < ApplicationController
h[:lists] << hl
end
h[:total_amount] = grand_total.round(2)
render json: h
render json: h, layout: 'tablet'
end
end
end