check mobile
This commit is contained in:
@@ -25,11 +25,7 @@ class BaseOrigamiController < ActionController::Base
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if token_status
|
if !token_status
|
||||||
if current_user.nil?
|
|
||||||
redirect_to root_path
|
|
||||||
end
|
|
||||||
else
|
|
||||||
if current_user.nil?
|
if current_user.nil?
|
||||||
redirect_to root_path
|
redirect_to root_path
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,10 +3,7 @@ class Origami::HomeController < BaseOrigamiController
|
|||||||
before_action :set_dining, only: [:show]
|
before_action :set_dining, only: [:show]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@webview = false
|
@webview = check_mobile
|
||||||
if check_mobile
|
|
||||||
@webview = true
|
|
||||||
end
|
|
||||||
@tables = Table.all.active.order('status desc')
|
@tables = Table.all.active.order('status desc')
|
||||||
@rooms = Room.all.active.order('status desc')
|
@rooms = Room.all.active.order('status desc')
|
||||||
@complete = Sale.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and sale_status != 'new'",DateTime.now.strftime('%Y-%m-%d'))
|
@complete = Sale.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and sale_status != 'new'",DateTime.now.strftime('%Y-%m-%d'))
|
||||||
@@ -18,10 +15,7 @@ class Origami::HomeController < BaseOrigamiController
|
|||||||
|
|
||||||
# origami table detail
|
# origami table detail
|
||||||
def show
|
def show
|
||||||
@webview = false
|
@webview = check_mobile
|
||||||
if check_mobile
|
|
||||||
@webview = true
|
|
||||||
end
|
|
||||||
|
|
||||||
@tables = Table.all.active.order('status desc')
|
@tables = Table.all.active.order('status desc')
|
||||||
@rooms = Room.all.active.order('status desc')
|
@rooms = Room.all.active.order('status desc')
|
||||||
|
|||||||
@@ -140,7 +140,11 @@
|
|||||||
<script>
|
<script>
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
var webview = <%= @webview %>;
|
var webview = <%= @webview %>;
|
||||||
|
if(webview){
|
||||||
|
code2lab.checkMobile(webview); //js func: for mobile login
|
||||||
|
}
|
||||||
showHideNavbar(webview,"index");
|
showHideNavbar(webview,"index");
|
||||||
|
|
||||||
$(".tables").on('click', function(){
|
$(".tables").on('click', function(){
|
||||||
var dining_id = $(this).attr("data-id");
|
var dining_id = $(this).attr("data-id");
|
||||||
window.location.href = '/origami/table/' + dining_id;
|
window.location.href = '/origami/table/' + dining_id;
|
||||||
|
|||||||
Reference in New Issue
Block a user