Merge branch 'oqs' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -23,17 +23,22 @@ $(document).ready(function(){
|
||||
// setTimeout(function(){
|
||||
// window.location.reload(1);
|
||||
// }, 10000);
|
||||
// $oqs_count = document.getElementById("oqsBox").style.order =1;
|
||||
// $("#oqsBox").css("order", 1);
|
||||
|
||||
$(".nav-completed").on("click", function(){
|
||||
$("#completed").removeClass('hide')
|
||||
$(".oqs_append").addClass('hide')
|
||||
});
|
||||
|
||||
$(".oqs_click").on("click", function(){
|
||||
$("#completed").addClass('hide')
|
||||
$(".oqs_append").removeClass('hide')
|
||||
|
||||
$(".oqs_click").removeClass('oqs_active');
|
||||
$("#completed").addClass('hide');
|
||||
$(".oqs_append").removeClass('hide');
|
||||
$(this).addClass('oqs_active');
|
||||
var oqs_id = $(this).find(".oqs-id").text();
|
||||
var url = 'oqs/get_items/'+oqs_id;
|
||||
|
||||
show_details(url);
|
||||
|
||||
}); //End Click
|
||||
@@ -52,7 +57,7 @@ $(document).ready(function(){
|
||||
for(var field in data) {
|
||||
var price = parseFloat(data[field].price).toFixed(2);
|
||||
|
||||
if (data[field]["options"] == "[]") {
|
||||
if (data[field]["options"] == "[]" || data[field]["options"] == "") {
|
||||
var options = "";
|
||||
}else{
|
||||
var options = data.options;
|
||||
|
||||
@@ -276,6 +276,7 @@ $(function(){
|
||||
disabled = ""
|
||||
status ="";
|
||||
|
||||
|
||||
if(parseInt(jQuery.inArray(value[i], selected_item))!== -1){
|
||||
status = "selected-attribute";
|
||||
}
|
||||
@@ -417,7 +418,7 @@ $(function(){
|
||||
}); //End Add Icon Click
|
||||
|
||||
function show_item_detail(data){
|
||||
console.log(data)
|
||||
|
||||
qty = parseInt(data.attr('data-qty'));
|
||||
append = 0;
|
||||
price = parseFloat(data.attr('data-price')).toFixed(2);
|
||||
@@ -599,7 +600,7 @@ $(function(){
|
||||
var item_row = $('.summary-items tbody tr');
|
||||
$(item_row).each(function(i){
|
||||
var order_item = {};
|
||||
console.log($(item_row[i]).attr('data-options'));
|
||||
|
||||
order_item.order_item_id = $(item_row[i]).attr('data-row');
|
||||
order_item.item_instance_code = $(item_row[i]).attr('data-instance-code');
|
||||
order_item.quantity = $(item_row[i]).children('#item_qty').text();
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Action Cable provides the framework to deal with WebSockets in Rails.
|
||||
// You can generate new channels where WebSocket features live using the `rails generate channel` command.
|
||||
//
|
||||
|
||||
//= require action_cable
|
||||
//= require_self
|
||||
//= require_tree ./channels
|
||||
|
||||
// Temp Disable
|
||||
// (function() {
|
||||
// this.App || (this.App = {});
|
||||
(function() {
|
||||
this.App || (this.App = {});
|
||||
|
||||
// App.cable = ActionCable.createConsumer();
|
||||
App.cable = ActionCable.createConsumer();
|
||||
|
||||
// }).call(this);
|
||||
}).call(this);
|
||||
|
||||
16
app/assets/javascripts/channels/order.js
Normal file
16
app/assets/javascripts/channels/order.js
Normal file
@@ -0,0 +1,16 @@
|
||||
App.order = App.cable.subscriptions.create('OrderChannel', {
|
||||
// App.messages = App.cable.subscriptions.create('MessagesChannel', {
|
||||
|
||||
connected: function() {},
|
||||
|
||||
disconnected: function() {},
|
||||
|
||||
received: function(data) {
|
||||
|
||||
$('.table_'+data.table.id).removeClass('green');
|
||||
$('.table_'+data.table.id).addClass('blue');
|
||||
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
@@ -1,24 +1,76 @@
|
||||
// App.order_queue_station = App.cable.subscriptions.create("OrderQueueStationChannel", {
|
||||
// connected: function() {},
|
||||
App.order_queue_station = App.cable.subscriptions.create('OrderQueueStationChannel', {
|
||||
// App.messages = App.cable.subscriptions.create('MessagesChannel', {
|
||||
|
||||
// disconnected: function() {},
|
||||
connected: function() {},
|
||||
|
||||
// received: function(message) {
|
||||
// alert(message);
|
||||
// },
|
||||
disconnected: function() {},
|
||||
|
||||
// order: function(message) {
|
||||
// return this.perform('order', {
|
||||
// message: message
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
received: function(data) {
|
||||
// console.log(data.order);
|
||||
var oqs_id = $('.oqs_active').attr('data-id');
|
||||
items = data.order;
|
||||
for(var field in items) {
|
||||
var price = parseFloat(items[field].price).toFixed(2);
|
||||
if (items[field]["options"] == "[]" || data[field]["options"] == "") {
|
||||
var options = "";
|
||||
}else{
|
||||
var options = items.options;
|
||||
}
|
||||
//for count
|
||||
test = document.getElementsByClassName("oqs_count");
|
||||
|
||||
for (var i = 0; i < test.length; i++) {
|
||||
oqs_count_id = $(".oqs_count"+i).attr("data-id");
|
||||
oqs_count = $(".oqs_count"+i).text();
|
||||
if ( oqs_count_id == items[field]["order_queue_station_id"]) {
|
||||
oqs_count_total = +oqs_count +1 ;
|
||||
$(".oqs_count"+i).text(oqs_count_total)
|
||||
}
|
||||
}
|
||||
//end count
|
||||
|
||||
var date = new Date(items[field]["created_at"]);
|
||||
var show_date = date.getDate() + "-" + date.getMonth() + "-" + date.getFullYear() + ' ' + date.getHours()+ ':' + date.getMinutes();
|
||||
|
||||
if (oqs_id == items[field]["order_queue_station_id"]) {
|
||||
|
||||
row ='<div class="card queue_station" id="oqsBox" style="order: initial;">'
|
||||
+'<div class="card-block">'
|
||||
+'<h4 class="card-title">'
|
||||
+'<span class="order-zone-type">'+items[field]["table_type"]+'- </span>'
|
||||
+'<span class="order-zone">'+ items[field]["zone"] +'</span>'
|
||||
+'<small class="pull-right">'+ items[field]["order_id"] +'- </small>'
|
||||
+'</h4>'
|
||||
|
||||
+'<h4>'
|
||||
+'<span class="order-item">'+ items[field]["item_name"] +'- </span>'
|
||||
+'<span class="order-qty">'+ items[field]["qty"] +'- </span>'
|
||||
+'</h4>'
|
||||
|
||||
+'<p class="card-text item-options">'+ options +'</p>'
|
||||
|
||||
+'<p class="card-text">'
|
||||
+'<small class="text-muted">Order at'
|
||||
+'<span class="order-at">'+ show_date +'</span> - '
|
||||
|
||||
+'<span class="order-by">'+ items[field]["item_order_by"] +'</span> '
|
||||
+'</small> '
|
||||
+'</p>'
|
||||
|
||||
+'<p class="hidden order-customer">'+ items[field]["customer_name"] +'</p> '
|
||||
+'<p class="hidden assigned-order-item">'+ items[field]["assigned_order_item_id"] +'</p> '
|
||||
+'</div>'
|
||||
|
||||
+'<div class="card-footer">'
|
||||
+'<button id="edit_'+ items[field]["assigned_order_item_id"]+'" class="btn btn-warning order-item order-item-edit">EDIT</button>'
|
||||
+' <button id="assigned_queue_' + items[field]["assigned_order_item_id"] +'" class="btn btn-primary order-item order-complete">COMPLETE</button>'
|
||||
+'</div>'
|
||||
+'</div>';
|
||||
$('.oqs_append').append(row);
|
||||
}
|
||||
}
|
||||
// $("[data-behaviour='message']").html(data.order);
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
// $(function(){
|
||||
// $("#submit_order").on('click', function(event) {
|
||||
// var orderData=$("#new_order").serializeObject();
|
||||
// App.order_station.order(orderData);
|
||||
// //orderData='';
|
||||
// return event.preventDefault();
|
||||
// });
|
||||
// });
|
||||
|
||||
@@ -25,3 +25,5 @@
|
||||
font-size: 18px;
|
||||
margin: 0px 0px 5px 0px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ module ApplicationCable
|
||||
end
|
||||
|
||||
# Order Queue Station Channel
|
||||
class OQSChannel < ActionCable::Channel::Base
|
||||
class OrderQueueStationChannel < ActionCable::Channel::Base
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
module ApplicationCable
|
||||
class Connection < ActionCable::Connection::Base
|
||||
def connect
|
||||
logger.add_tags "ActionCable"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
11
app/channels/order_channel.rb
Normal file
11
app/channels/order_channel.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class OrderChannel < ApplicationCable::Channel
|
||||
def subscribed
|
||||
stream_from "order_channel"
|
||||
end
|
||||
|
||||
def unsubscribed
|
||||
stop_all_streams
|
||||
# Any cleanup needed when channel is unsubscribed
|
||||
end
|
||||
|
||||
end
|
||||
@@ -4,6 +4,7 @@ class OrderQueueStationChannel < ApplicationCable::Channel
|
||||
end
|
||||
|
||||
def unsubscribed
|
||||
stop_all_streams
|
||||
# Any cleanup needed when channel is unsubscribed
|
||||
end
|
||||
|
||||
|
||||
@@ -131,6 +131,7 @@ class Oqs::HomeController < BaseOqsController
|
||||
left join dining_facilities as df on df.id = bk.dining_facility_id")
|
||||
.where("assigned_order_items.delivery_status = #{status} AND odt.price <> 0 AND assigned_order_items.created_at >= '#{Time.now.beginning_of_day.utc}' #{oqs} ")
|
||||
query = query.where("df.name LIKE ? OR odt.order_id LIKE ? OR odt.item_name LIKE ? OR cus.name = '#{filter}'","%#{filter}%","%#{filter}%","%#{filter}%",)
|
||||
.order("assigned_order_items.assigned_order_item_id desc")
|
||||
.group("assigned_order_items.assigned_order_item_id")
|
||||
|
||||
end
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
class OrderBroadcastJob < ApplicationJob
|
||||
queue_as :default
|
||||
|
||||
def perform(message)
|
||||
order = Order.find(message) # message come as order_id
|
||||
ApplicationCable.server.broadcast "order_queue_station_channel", order: order
|
||||
def perform(table)
|
||||
ActionCable.server.broadcast "order_channel",table: table
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,14 +4,24 @@ class OrderQueueProcessorJob < ApplicationJob
|
||||
def perform(order_id, table_id)
|
||||
# Do something later
|
||||
#Order ID
|
||||
order = Order.find(order_id)
|
||||
|
||||
order = Order.find(order_id)
|
||||
assign_order = AssignedOrderItem.assigned_order_item_by_job(order_id)
|
||||
#Loop through the order stations and process the items
|
||||
#Execute orders and send to order stations
|
||||
if order
|
||||
oqs = OrderQueueStation.new
|
||||
oqs.process_order(order, table_id)
|
||||
end
|
||||
|
||||
ActionCable.server.broadcast "order_queue_station_channel",order: assign_order
|
||||
end
|
||||
|
||||
# private
|
||||
|
||||
# def render_order(assign_order)
|
||||
# ApplicationController.renderer.render(partial: 'oqs/oqs_test',
|
||||
# locals: { order: assign_order})
|
||||
# end
|
||||
# Read more at https://www.pluralsight.com/guides/ruby-ruby-on-rails/creating-a-chat-using-rails-action-cable#TehYiuqlHDOXaQQk.99
|
||||
|
||||
end
|
||||
|
||||
@@ -17,6 +17,29 @@ class AssignedOrderItem < ApplicationRecord
|
||||
assigned_order_item.save
|
||||
end
|
||||
|
||||
def self.assigned_order_item_by_job(order_id)
|
||||
order_item = AssignedOrderItem.select("assigned_order_items.assigned_order_item_id,
|
||||
assigned_order_items.order_queue_station_id,
|
||||
oqs.id as station_id, oqs.station_name,
|
||||
oqs.is_active, oqpz.zone_id,
|
||||
df.name as zone, df.type as table_type,
|
||||
odt.order_id, odt.item_code, odt.item_name,
|
||||
odt.price, odt.qty, odt.item_order_by, odt.options,
|
||||
cus.name as customer_name, odt.created_at")
|
||||
.joins(" left join order_queue_stations as oqs on oqs.id = assigned_order_items.order_queue_station_id
|
||||
left join order_queue_process_by_zones as oqpz on oqpz.order_queue_station_id = oqs.id
|
||||
left join orders as od ON od.order_id = assigned_order_items.order_id
|
||||
left join order_items as odt ON odt.item_code = assigned_order_items.item_code AND odt.order_id = assigned_order_items.order_id
|
||||
left join customers as cus ON cus.customer_id = od.customer_id
|
||||
left join booking_orders as bo on bo.order_id = assigned_order_items.order_id
|
||||
left join bookings as bk on bk.booking_id = bo.booking_id
|
||||
left join dining_facilities as df on df.id = bk.dining_facility_id")
|
||||
.where("assigned_order_items.order_id = '#{order_id}' AND assigned_order_items.delivery_status = false AND odt.price <> 0 AND assigned_order_items.created_at >= '#{Time.now.beginning_of_day.utc}' ")
|
||||
.order("assigned_order_items.assigned_order_item_id desc")
|
||||
.group("assigned_order_items.assigned_order_item_id")
|
||||
return order_item
|
||||
end
|
||||
|
||||
private
|
||||
def generate_custom_id
|
||||
self.assigned_order_item_id = SeedGenerator.generate_id(self.class.name, "AOI")
|
||||
|
||||
@@ -49,7 +49,7 @@ class Order < ApplicationRecord
|
||||
process_order_queue
|
||||
|
||||
#send order to broadcast job
|
||||
#send_order_broadcast
|
||||
send_order_broadcast(booking)
|
||||
|
||||
return true, booking
|
||||
|
||||
@@ -214,9 +214,10 @@ class Order < ApplicationRecord
|
||||
|
||||
|
||||
#send order items and send to order queue
|
||||
def send_order_broadcast
|
||||
def send_order_broadcast(booking)
|
||||
table = DiningFacility.find(booking.dining_facility_id)
|
||||
#Send to background job for processing
|
||||
OrderBroadcastJob.perform_later(self.id)
|
||||
OrderBroadcastJob.perform_later(table)
|
||||
end
|
||||
|
||||
#Origami: Cashier : to view order Table
|
||||
|
||||
51
app/views/oqs/_oqs_test.html.erb
Normal file
51
app/views/oqs/_oqs_test.html.erb
Normal file
@@ -0,0 +1,51 @@
|
||||
<% order.each do |qid|%>
|
||||
<p class="hidden"><%=qid.order_queue_station_id%></p>
|
||||
<div class="card queue_station">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">
|
||||
<span class="order-zone-type"><%= qid.table_type %> - </span>
|
||||
<span class="order-zone"><%= qid.zone %></span>
|
||||
<small class="pull-right"><%= qid.order_id %></small>
|
||||
</h4>
|
||||
<h4>
|
||||
<span class="order-item">
|
||||
<%= qid.item_name %>
|
||||
</span> [x
|
||||
<span class="order-qty">
|
||||
<%= qid.qty %>
|
||||
</span> ]
|
||||
</h4>
|
||||
|
||||
<p class="card-text item-options">
|
||||
<%= qid.options == "[]"? "" : qid.options %>
|
||||
</p>
|
||||
|
||||
<p class="card-text">
|
||||
<small class="text-muted">Order at
|
||||
<span class="order-at">
|
||||
<%= qid.created_at.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %>
|
||||
</span> -
|
||||
<span class="order-by">
|
||||
<%= qid.item_order_by %>
|
||||
</span>
|
||||
</small>
|
||||
</p>
|
||||
<p class="hidden order-customer"><%= qid.customer_name %></p>
|
||||
<p class="hidden assigned-order-item"><%= qid.assigned_order_item_id %></p>
|
||||
<div class="card-footer">
|
||||
<button id="edit_<%= qid.assigned_order_item_id %>" class="btn btn-warning order-item order-item-edit">EDIT</button>
|
||||
<button id="assigned_queue_<%= qid.assigned_order_item_id %>" class="btn btn-primary order-item order-complete">COMPLETE</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%end%>
|
||||
<style type="text/css">
|
||||
.order-completed {
|
||||
background-color: #CCFFDD;
|
||||
}
|
||||
.order-item {
|
||||
width: 49%;
|
||||
font-size: 18px;
|
||||
margin: 0px 0px 5px 0px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,58 +1,60 @@
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<%= form_tag oqs_root_path, :method => :get do %>
|
||||
<div class="form-group col-md-8">
|
||||
<input type="text" name="filter" class="form-control input-md" placeholder="">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-1">
|
||||
<input type="submit" value="Search" class='btn btn-primary btn-md'>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<!-- Column One -->
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-md-8 col-sm-8">
|
||||
<div class="col-lg-8 col-md-8 col-sm-8">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= form_tag oqs_root_path, :method => :get do %>
|
||||
<div class="form-group col-md-6">
|
||||
<input type="text" name="filter" class="form-control input-md" placeholder="">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<input type="submit" value="Search" class='btn btn-primary btn-md'>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<!-- <li class="nav-item nav-search <%= @filter.to_s.length > 0? " " : "hide"%>">
|
||||
<a class="nav-link <%= @filter.to_s.length > 0? "active" : " "%>" data-toggle="tab" href="#search" role="tab">Searching .. <span class="badge badge-pill badge-default" id="completed_count"><%= @queue_completed_item.length %></span></a>
|
||||
</li> -->
|
||||
<li class="nav-item nav-completed">
|
||||
<a class="nav-link" data-toggle="tab" href="#completed" role="tab">Processed <span class="badge badge-pill badge-default" id="completed_count"><%= @queue_completed_item.length %></span></a>
|
||||
<a class="nav-link active" data-toggle="tab" href="#completed" role="tab">Processed <span class="badge badge-pill badge-default" id="completed_count"><%= @queue_completed_item.length %></span></a>
|
||||
</li>
|
||||
|
||||
<% # For Tab Disable for Station is inactive
|
||||
status=""
|
||||
i=0
|
||||
@queue_stations.each do |qsi|
|
||||
if qsi.is_active == false
|
||||
status="disabled"
|
||||
end %>
|
||||
<li class="nav-item oqs_click" >
|
||||
<p class="hidden oqs-id"><%= qsi.id %></p>
|
||||
<a class="nav-link" data-toggle="tab" href="" role="tab" <%= status %>>
|
||||
<%= qsi.station_name %>
|
||||
<% if @filter.nil? %>
|
||||
<span class="badge badge-pill badge-default" id=""> <%= qsi.assigned_order_items.where("delivery_status=0").count %>
|
||||
</span>
|
||||
<%else%>
|
||||
<span class="badge badge-pill badge-default" id="">
|
||||
<% @count.each do |c|%>
|
||||
<% if qsi.id == c.station_id %>
|
||||
<%= c.total %>
|
||||
<%end %>
|
||||
<%end %>
|
||||
</span>
|
||||
<%end%>
|
||||
<% if qsi.auto_print %>
|
||||
<span>(ap)</span>
|
||||
<% end %>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item oqs_click" data-id="<%= qsi.id %>">
|
||||
<p class="hidden oqs-id"><%= qsi.id %></p>
|
||||
<a class="nav-link" data-id="<%= qsi.id %>" data-toggle="tab" href="" role="tab" <%= status %>>
|
||||
<%= qsi.station_name %>
|
||||
<% if @filter.nil? %>
|
||||
<span class="badge badge-pill badge-default oqs_count<%= i%> oqs_count" data-id="<%= qsi.id %>"> <%= qsi.assigned_order_items.where("delivery_status=0 AND created_at >= '#{Time.now.beginning_of_day.utc}'").count %>
|
||||
</span>
|
||||
<%else%>
|
||||
<span class="badge badge-pill badge-default" data-id="<%= qsi.id %>">
|
||||
<% @count.each do |c|%>
|
||||
<% if qsi.id == c.station_id %>
|
||||
<%= c.total %>
|
||||
<%end %>
|
||||
<%end %>
|
||||
</span>
|
||||
<%end%>
|
||||
<% if qsi.auto_print %>
|
||||
<span>(ap)</span>
|
||||
<% end %>
|
||||
</a>
|
||||
</li>
|
||||
<% i+=1%>
|
||||
|
||||
<% end %>
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
@@ -107,7 +109,6 @@
|
||||
|
||||
|
||||
<!-- End Panel 0 - Completed -->
|
||||
|
||||
<!--- Order Items -->
|
||||
<div class="card-columns oqs_append" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
</div>
|
||||
|
||||
@@ -38,30 +38,30 @@
|
||||
<div class="tab-pane dining active" id="tables" role="tabpanel">
|
||||
<div class="card-columns">
|
||||
<% @tables.each do |table| %>
|
||||
<% if table.status == 'occupied' %>
|
||||
<% if table.get_booking.nil? %>
|
||||
<div class="card tables red text-white" data-id="<%= table.id %>">
|
||||
<div class="card-block">
|
||||
Zone <%= table.zone_id %> <br>
|
||||
Table <%= table.name %> ( <%= table.seater %> Seat )
|
||||
</div>
|
||||
</div>
|
||||
<% if table.status == 'occupied' %>
|
||||
<% if table.get_booking.nil? %>
|
||||
<div class="card tables red text-white" data-id="<%= table.id %>">
|
||||
<div class="card-block">
|
||||
Zone <%= table.zone_id %> <br>
|
||||
Table <%= table.name %> ( <%= table.seater %> Seat )
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card tables blue text-white" data-id="<%= table.id %>">
|
||||
<div class="card-block">
|
||||
Zone <%= table.zone_id %> <br>
|
||||
Table <%= table.name %> ( <%= table.seater %> Seat )
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="card tables blue text-white" data-id="<%= table.id %>">
|
||||
<div class="card tables green text-white table_<%= table.id %>" data-id="<%= table.id %>">
|
||||
<div class="card-block">
|
||||
Zone <%= table.zone_id %> <br>
|
||||
Table <%= table.name %> ( <%= table.seater %> Seat )
|
||||
Zone <%= table.zone_id %> <br>
|
||||
Table <%= table.name %> ( <%= table.seater %> Seat )
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="card tables green text-white" data-id="<%= table.id %>">
|
||||
<div class="card-block">
|
||||
Zone <%= table.zone_id %> <br>
|
||||
Table <%= table.name %> ( <%= table.seater %> Seat )
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -70,19 +70,19 @@
|
||||
<div class="tab-pane dining" id="rooms" role="tabpanel">
|
||||
<div class="card-columns">
|
||||
<% @rooms.each do |room| %>
|
||||
<% if room.status == 'occupied' %>
|
||||
<div class="card rooms red text-white" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card rooms green text-white" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if room.status == 'occupied' %>
|
||||
<div class="card rooms red text-white" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card rooms green text-white table_<%= room.id %>" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="card tables green text-white" data-id="<%= table.id %>">
|
||||
<div class="card tables green text-white table_<%= table.id %>" data-id="<%= table.id %>">
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
</div>
|
||||
@@ -86,7 +86,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card rooms green text-white" data-id="<%= room.id %>">
|
||||
<div class="card rooms green text-white table_<%= room.id %>" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
development:
|
||||
adapter: async
|
||||
|
||||
test:
|
||||
adapter: async
|
||||
|
||||
production:
|
||||
redis: &redis
|
||||
adapter: redis
|
||||
url: redis://localhost:6379/1
|
||||
|
||||
production: *redis
|
||||
development: *redis
|
||||
test: *redis
|
||||
@@ -45,6 +45,8 @@ Rails.application.configure do
|
||||
# Suppress logger output for asset requests.
|
||||
config.assets.quiet = true
|
||||
|
||||
config.web_console.whiny_requests = false
|
||||
|
||||
# Raises error for missing translations
|
||||
# config.action_view.raise_on_missing_translations = true
|
||||
|
||||
@@ -53,5 +55,5 @@ Rails.application.configure do
|
||||
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
||||
|
||||
# Set Cable URL
|
||||
# config.action_cable.url = "ws://192.168.1.140:3002/cable"
|
||||
config.action_cable.url = "ws://192.168.1.39:3002/cable"
|
||||
end
|
||||
|
||||
@@ -7,7 +7,7 @@ Rails.application.routes.draw do
|
||||
mount Sidekiq::Web => '/kiq'
|
||||
|
||||
# Action Cable Creation
|
||||
# mount ActionCable.server => "/cable"
|
||||
mount ActionCable.server => "/cable"
|
||||
|
||||
#--------- SmartSales Installation ------------#
|
||||
get 'install' => 'install#index'
|
||||
|
||||
BIN
public/image/menu_images/images__4_.jpg
Normal file
BIN
public/image/menu_images/images__4_.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
BIN
public/image/menu_images/images__5_.jpg
Normal file
BIN
public/image/menu_images/images__5_.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
Reference in New Issue
Block a user