separate foodcourt module
This commit is contained in:
@@ -36,32 +36,36 @@
|
||||
<div class="overlay"></div>
|
||||
<!-- #END# Overlay For Sidebars -->
|
||||
<%= render 'layouts/header' %>
|
||||
<section>
|
||||
<%= render 'layouts/left_sidebar' %>
|
||||
<%= render 'layouts/right_sidebar' %>
|
||||
<section>
|
||||
<%if current_login_employee.role == "foodcourt_cashier" %>
|
||||
<%= render 'layouts/foodcourt_left_sidebar' %>
|
||||
<% else %>
|
||||
<%= render 'layouts/left_sidebar' %>
|
||||
<%end%>
|
||||
<%= render 'layouts/right_sidebar' %>
|
||||
</section>
|
||||
|
||||
<!-- Main Content -->
|
||||
<section class="content">
|
||||
<section class="content">
|
||||
<% flash.each do |type, message| %>
|
||||
<% if !flash["errors"]%>
|
||||
<%
|
||||
<%
|
||||
if type == "notice"
|
||||
color = "alert-success"
|
||||
end
|
||||
if type == "error"
|
||||
color = "alert-danger"
|
||||
end
|
||||
end
|
||||
%>
|
||||
<% if flash["error"] || flash["notice"]%>
|
||||
<p id="notify_message" class="hidden" data-placement-from="top" data-message="<%=message%>" data-placement-align="center"
|
||||
data-animate-enter="" data-animate-exit="" data-color-name="<%=color%>" >
|
||||
</p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= yield %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= yield %>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
54
app/views/layouts/_foodcourt_left_sidebar.html.erb
Normal file
54
app/views/layouts/_foodcourt_left_sidebar.html.erb
Normal file
@@ -0,0 +1,54 @@
|
||||
<!-- Left Sidebar -->
|
||||
<aside id="leftsidebar" class="sidebar">
|
||||
<div class="menu">
|
||||
<ul class="list">
|
||||
<li class="header"><%= t :main_navigation %></li>
|
||||
<li class="active">
|
||||
<a href="<%= foodcourt_food_court_path %>">
|
||||
<i class="material-icons">monetization_on</i>
|
||||
<span><%= t :origami %></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu-up">
|
||||
<a href="javascript:void(0);" class="menu-toggle">
|
||||
<i class="material-icons">widgets</i>
|
||||
<span><%= t :crm %></span>
|
||||
</a>
|
||||
<ul class="ml-menu">
|
||||
<li>
|
||||
<a href="<%= crm_customers_path %>"><%= t :customer %></a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="header"><%= t :backend %></li>
|
||||
<li id="left-menu">
|
||||
<a href="javascript:void(0);" class="menu-toggle">
|
||||
<i class="material-icons">widgets</i>
|
||||
<span><%= t :transactions %></span>
|
||||
</a>
|
||||
<ul class="ml-menu">
|
||||
<li>
|
||||
<a href="<%= transactions_bookings_path %>"><%= t :bookings %></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<%= transactions_orders_path %>"><%= t :orders %></a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- #Menu -->
|
||||
<!-- Footer -->
|
||||
<div class="legal">
|
||||
<div class="copyright">
|
||||
© <%= Time.now.strftime("%Y") %> <a href="javascript:void(0);">Code2Lab</a>.
|
||||
</div>
|
||||
<div class="version">
|
||||
<b>Version: </b> 1.0.1
|
||||
</div>
|
||||
</div>
|
||||
<!-- #Footer -->
|
||||
</aside>
|
||||
<!-- #END# Left Sidebar
|
||||
@@ -40,21 +40,22 @@
|
||||
<span class="navbar-brand navbar-brand-txt"><%= shop_detail.name %></span>
|
||||
</div>
|
||||
<!-- End Shop Info -->
|
||||
|
||||
<div class="navbar-right m-auto">
|
||||
<% if order_reservation %>
|
||||
<div class="online_order">
|
||||
<span class="navbar-brand navbar-brand-txt header-default-color">
|
||||
<% if request.user_agent.include? "Mobile" %>
|
||||
<img src="/assets/online_order_icon.png" alt="<%= t :order_reservation %>" />
|
||||
<% else %>
|
||||
<%= t :order_reservation %>
|
||||
<% end %>
|
||||
</span>
|
||||
<span class="order_no"></span>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% if current_login_employee.role !='foodcourt_cashier' %>
|
||||
<div class="navbar-right m-auto">
|
||||
<% if order_reservation %>
|
||||
<div class="online_order">
|
||||
<span class="navbar-brand navbar-brand-txt header-default-color">
|
||||
<% if request.user_agent.include? "Mobile" %>
|
||||
<img src="/assets/online_order_icon.png" alt="<%= t :order_reservation %>" />
|
||||
<% else %>
|
||||
<%= t :order_reservation %>
|
||||
<% end %>
|
||||
</span>
|
||||
<span class="order_no"></span>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<!-- Start Quick Access for Cashier -->
|
||||
<!-- <div class="navbar-right m-auto">
|
||||
@@ -139,7 +140,7 @@
|
||||
<span class="font-15 shopinfo" >Team Viewer</span>
|
||||
</p>
|
||||
</li>
|
||||
<%if current_login_employee.role =="cashier" %>
|
||||
<%if current_login_employee.role =="cashier"%>
|
||||
<li>
|
||||
<p class="waves-effect waves-block p-l-30 m-b-5">
|
||||
<a href="/origami/second_display" onclick="window.open('/origami/second_display', 'newwindow', 'width=700,height=500'); return false;" style="text-decoration: none;">
|
||||
@@ -149,6 +150,24 @@
|
||||
</p>
|
||||
</li>
|
||||
<% end %>
|
||||
<%if current_login_employee.role =="foodcourt_cashier" %>
|
||||
<li>
|
||||
<p class="waves-effect waves-block p-l-30 m-b-5">
|
||||
<a href="/foodcourt/second_display" onclick="window.open('/foodcourt/second_display', 'newwindow', 'width=700,height=500'); return false;" style="text-decoration: none;">
|
||||
<i class="material-icons font-7 logout_icon shopinfo">info</i>
|
||||
<span class="font-15 shopinfo" >Second Display</span>
|
||||
</a>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="waves-effect waves-block p-l-30 m-b-5 close_cashier">
|
||||
<i class="material-icons font-7 logout_icon">close</i>
|
||||
<span class="font-15">Close Cashier</span>
|
||||
</p>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<li>
|
||||
<!-- <p class="delete waves-effect waves-block p-l-30 m-b-5" data-ref="<%=logout_path%>" data-method="delete">
|
||||
<i class="material-icons font-10 logout_icon">exit_to_app</i>
|
||||
<span class="font-18">Logout</span>
|
||||
@@ -226,4 +245,17 @@
|
||||
});
|
||||
|
||||
});
|
||||
$('.close_cashier').on('click',function(e){
|
||||
e.preventDefault(); // Prevent the href from redirecting directly
|
||||
var linkURL = '/foodcourt/shift/cashier/close';
|
||||
swal({
|
||||
title: "Alert!",
|
||||
text: "Are you sure you want to close cashier?",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
html: true
|
||||
}, function() {
|
||||
window.location.href = linkURL;
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
122
app/views/layouts/_header_foodcourt.html.erb
Normal file
122
app/views/layouts/_header_foodcourt.html.erb
Normal file
@@ -0,0 +1,122 @@
|
||||
<%if !request.path_info.include?('second_display') %>
|
||||
<nav class="navbar">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header">
|
||||
<a class="navbar-brand m-0 mbl_view" href="<%= origami_dashboard_path%>">
|
||||
<img src="<%= asset_path('SX-Logo-small.png') %>" width="40" height="40" alt="Logo" />
|
||||
<span class="navbar-brand-txt">SX Restaurant</span>
|
||||
</a>
|
||||
</div>
|
||||
<!-- Start Shop Info -->
|
||||
<div class="navbar-right m-auto">
|
||||
<span class="navbar-brand navbar-brand-txt"><%= shop_detail.name %></span>
|
||||
</div>
|
||||
<!-- End Shop Info -->
|
||||
|
||||
<!-- Start Delete confirrm text !-->
|
||||
<div class="navbar-right toggle_mbl">
|
||||
<a href="javascript:void(0);" class="dropdown-toggle waves-block" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
||||
<% if current_login_employee %>
|
||||
<span>
|
||||
<% if request.user_agent.include? "Mobile" %>
|
||||
<img src="/assets/user_icon.png" alt="<%= current_login_employee.name %>" />
|
||||
<% else %>
|
||||
<%= current_login_employee.name %>
|
||||
<% end %>
|
||||
</span>
|
||||
<% end %>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<p class="waves-effect waves-block p-l-30 m-b-5 team_viewer">
|
||||
<i class="material-icons font-7 logout_icon shopinfo">touch_app</i>
|
||||
<span class="font-15 shopinfo" >Team Viewer</span>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="waves-effect waves-block p-l-30 m-b-5">
|
||||
<a href="/foodcourt/second_display" onclick="window.open('/foodcourt/second_display', 'newwindow', 'width=700,height=500'); return false;" style="text-decoration: none;">
|
||||
<i class="material-icons font-7 logout_icon shopinfo">info</i>
|
||||
<span class="font-15 shopinfo" >Second Display</span>
|
||||
</a>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="waves-effect waves-block p-l-30 m-b-5" id="close_cashier">
|
||||
<i class="material-icons font-7 logout_icon">close</i>
|
||||
<span class="font-15">Close Cashier</span>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="delete waves-effect waves-block p-l-30 m-b-5 logout" data-ref="<%= logout_path %>" data-method="delete">
|
||||
<i class="material-icons font-7 logout_icon">exit_to_app</i>
|
||||
<span class="font-15">Logout</span>
|
||||
</p>
|
||||
<span class="hidden" id="delete_text">
|
||||
<h6>Are you sure you want to Logout ?</h6>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<%end%>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('.delete').click(function(){
|
||||
var method = $(this).attr('data-method');
|
||||
var url = $(this).attr('data-ref');
|
||||
var html_text = $(this).siblings( "#delete_text" ).html();
|
||||
//var page = url.substring(url.lastIndexOf('/') + 1);
|
||||
swal({
|
||||
title: "Confirmation",
|
||||
text: html_text,
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
html: true
|
||||
}, function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
$.ajax({
|
||||
type: method,
|
||||
url: url ,
|
||||
success: function(data) {
|
||||
location.href = data.url;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
swal("Cancelled", "Your imaginary file is safe :)", "error");
|
||||
}
|
||||
});
|
||||
});
|
||||
$(".team_viewer").on('click',function(){
|
||||
// /opt/teamviewer/tv_bin/script/teamviewer
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
url: "/run_teamviewer",
|
||||
success: function(data){
|
||||
if(!data.status){
|
||||
window.open('https://www.teamviewer.com', '_blank');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
$('.close_cashier').on('click',function(e){
|
||||
e.preventDefault(); // Prevent the href from redirecting directly
|
||||
var linkURL = '/foodcourt/shift/cashier/close';
|
||||
swal({
|
||||
title: "Alert!",
|
||||
text: "Are you sure you want to close cashier?",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
html: true
|
||||
}, function() {
|
||||
window.location.href = linkURL;
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
<title>SmartSales : Restaurant</title>
|
||||
<%= csrf_meta_tags %>
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
<link rel="icon" href="/favicon.ico" type="image/x-icon">
|
||||
|
||||
<%= stylesheet_link_tag 'application', media: 'all' %>
|
||||
<%= javascript_include_tag 'application' %>
|
||||
<%= javascript_include_tag 'application' %>
|
||||
</head>
|
||||
|
||||
<body class="theme-indigo">
|
||||
<body class="theme-indigo" style="overflow-x:hidden">
|
||||
<!-- Page Loader -->
|
||||
<div class="page-loader-wrapper">
|
||||
<div class="loader">
|
||||
@@ -37,27 +37,32 @@
|
||||
<div class="overlay"></div>
|
||||
<!-- #END# Overlay For Sidebars -->
|
||||
<%= render 'layouts/header' %>
|
||||
<section>
|
||||
<%= render 'layouts/left_sidebar' %>
|
||||
<%= render 'layouts/right_sidebar' %>
|
||||
<section>
|
||||
<%if current_login_employee.role == "foodcourt_cashier" %>
|
||||
<%= render 'layouts/foodcourt_left_sidebar' %>
|
||||
<% else %>
|
||||
<%= render 'layouts/left_sidebar' %>
|
||||
<%end%>
|
||||
|
||||
<%= render 'layouts/right_sidebar' %>
|
||||
</section>
|
||||
|
||||
<!-- Main Content -->
|
||||
<section class="content">
|
||||
<section class="content">
|
||||
<% flash.each do |type, message| %>
|
||||
<% if type == "notice"
|
||||
<% if type == "notice"
|
||||
color = "alert-success"
|
||||
elsif type == "error"
|
||||
color = "alert-danger"
|
||||
else
|
||||
color = "bg-black"
|
||||
end %>
|
||||
|
||||
|
||||
<p id="notify_message" class="hidden" data-placement-from="top" data-message="<%=message%>" data-placement-align="center"
|
||||
data-animate-enter="" data-animate-exit="" data-color-name="<%=color%>" >
|
||||
</p>
|
||||
<% end %>
|
||||
<%= yield %>
|
||||
</section>
|
||||
<% end %>
|
||||
<%= yield %>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
63
app/views/layouts/foodcourt.html.erb
Normal file
63
app/views/layouts/foodcourt.html.erb
Normal file
@@ -0,0 +1,63 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
<title>SmartSales : Restaurant</title>
|
||||
<%= csrf_meta_tags %>
|
||||
|
||||
<!-- Favicon-->
|
||||
<link rel="icon" href="/favicon.ico" type="image/x-icon">
|
||||
|
||||
<%= stylesheet_link_tag 'origami', media: 'all' %>
|
||||
<%= javascript_include_tag 'origami', 'data-turbolinks-track': 'reload' %>
|
||||
</head>
|
||||
|
||||
<body class="theme-indigo" style="overflow-x:hidden">
|
||||
<!-- Page Loader -->
|
||||
<div class="page-loader-wrapper">
|
||||
<div class="loader">
|
||||
<div class="preloader">
|
||||
<div class="spinner-layer pl-blue">
|
||||
<div class="circle-clipper left">
|
||||
<div class="circle"></div>
|
||||
</div>
|
||||
<div class="circle-clipper right">
|
||||
<div class="circle"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p>Please wait...</p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- #END# Page Loader -->
|
||||
<!-- Overlay For Sidebars -->
|
||||
<div class="overlay"></div>
|
||||
<!-- #END# Overlay For Sidebars -->
|
||||
<%= render 'layouts/header' %>
|
||||
<section>
|
||||
<%= render 'layouts/foodcourt_left_sidebar' %>
|
||||
<%= render 'layouts/right_sidebar' %>
|
||||
</section>
|
||||
|
||||
<!-- Main Content -->
|
||||
<section class="content">
|
||||
<% flash.each do |type, message| %>
|
||||
<% if type == "notice"
|
||||
color = "alert-success"
|
||||
elsif type == "error"
|
||||
color = "alert-danger"
|
||||
else
|
||||
color = "bg-black"
|
||||
end %>
|
||||
|
||||
<p id="notify_message" class="hidden" data-placement-from="top" data-message="<%=message%>" data-placement-align="center"
|
||||
data-animate-enter="" data-animate-exit="" data-color-name="<%=color%>" >
|
||||
</p>
|
||||
<% end %>
|
||||
<%= yield %>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user