Merge branch 'foodcourt' of gitlab.com:code2lab/SXRestaurant into foodcourt

This commit is contained in:
yarzar_code
2020-03-03 11:06:22 +06:30
6 changed files with 51 additions and 12 deletions

View File

@@ -842,10 +842,47 @@ $(function() {
item = get_item(item_data,"add_icon");
customer_display_view(item,"add");
}
show_item_detail(item_data,"add_icon");
code = $(this).data('item-code');
element = $('#order-detail-slimscroll').find(`[data-code='${code}']`);
item_qty = element.find('#item_qty').text()
// auto scroll to last order item
if (item_qty == 1) {
$('#order-detail-slimscroll').animate({
scrollTop: $('.summary-items tbody tr:last').position().top - $('.summary-items tbody tr:first').position().top
})
}
// set border to current item
$('.summary-items tbody tr').css('background-color', '')
element.css({'background-color': '#2091F3'})
setTimeout(function() {
element.css('background-color', '');
}, 500);
calculate_sub_total();
if (isNotInView(element)) {
element.css({'background-color': '#2091F3'});
scrollToELement(element);
}
}); //End Add Icon Click
function isNotInView(elem){
// for scroll up | for scroll down
result = (($(elem).offset().top - 100) < $(elem).height() || $('#order-detail-slimscroll').height() < (elem.position().top + elem.outerHeight(true)));
console.log(result)
return result // reutn boolean
}
function scrollToELement(elem) {
console.log('Scroll into view')
elem[0].scrollIntoView();
}
function show_item_detail(data,click_type){
testqty = parseInt($('.item_box').children('data_qty').text());
qty = parseInt(data.attr('data-qty'));

View File

@@ -8,8 +8,13 @@
</style>
<%= javascript_include_tag 'custom', 'data-turbolinks-track': 'reload' %>
<button type="button" class="btn btn-block btn-default waves-effect float-right m-t-10" id='back' style="width: 112px; margin-right: -10px">
<i class="material-icons">reply</i>
Back
</button>
<!-- Nav tabs -->
<ul class="nav nav-tabs tab-col-teal" role="tablist">
<ul class="nav nav-tabs tab-col-teal m-t--10" role="tablist">
<li class="nav-item">
<a class="nav-link <%= 'active' if params[:active].blank? %>" data-toggle="tab" href="#mobile_orders" role="tab">Mobile Orders</a>
</li>
@@ -161,10 +166,6 @@
</div>
</div>
<div class="col-md-1 col-lg-1 col-sm-12">
<button type="button" class="btn btn-block btn-default waves-effect" id='back'>
<i class="material-icons">reply</i>
Back
</button>
<a class="btn btn-block bg-red waves-effect access_modal" data-toggle="modal" data-type="void"> Void</a>
</div>
<% end %>

View File

@@ -4,7 +4,7 @@
<ul class="list">
<li class="header"><%= t :main_navigation %></li>
<li class="active">
<a href="<%= foodcourt_food_court_path(:anchor => "") %>">
<a href="<%= foodcourt_food_court_path(:anchor => '') %>">
<i class="material-icons">monetization_on</i>
<span><%= t :origami %></span>
</a>

View File

@@ -10,22 +10,23 @@
</div> -->
<!-- #END# Search Bar -->
<!-- Top Bar -->
<%food_court = Lookup.find_by_lookup_type_and_value("food_court", "1")%>
<% display_none = (food_court && current_user.role == 'cashier') ? 'd-none' : '' %>
<%if !request.path_info.include?('second_display') %>
<nav class="navbar">
<div class="container-fluid">
<div class="navbar-header">
<!-- <a href="javascript:void(0);" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false"></a> -->
<%if current_login_employee.role !="waiter" %>
<a href="javascript:void(0);" class="bars"></a>
<a href="javascript:void(0);" class="bars <%= display_none %>"></a>
<% if current_login_employee.role == "administrator" || current_login_employee.role == "manager" || current_login_employee.role == "account" %>
<a class="navbar-brand mbl_view" href="<%=dashboard_path%>" style="margin-left: 20px;">
<% elsif current_login_employee.role == "supervisor" %>
<a class="navbar-brand mbl_view" href="<%=origami_dashboard_path%>" style="margin-left: 20px;">
<% elsif current_login_employee.role == "cashier" || current_login_employee.role == "waiter"%>
<%if ShiftSale.current_open_shift(current_login_employee) %>
<%food_court = Lookup.find_by_lookup_type_and_value("food_court", "1")%>
<%if current_login_employee.role == "cashier" && food_court %>
<a class="navbar-brand mbl_view" href="<%=foodcourt_food_court_path%>" style="margin-left: 20px;">
<a class="navbar-brand mbl_view" href="<%=foodcourt_food_court_path%>" style="margin-left: -10px;">
<%else%>
<a class="navbar-brand mbl_view" href="<%=origami_dashboard_path%>" style="margin-left: 20px;">
<%end%>
@@ -38,7 +39,7 @@
<% else %>
<a class="navbar-brand m-0 mbl_view" href="<%= origami_dashboard_path%>">
<%end%>
<img src="<%= asset_path('SX-Logo-small.png') %>" width="40" height="40" alt="Logo" />
<img src="<%= asset_path('SX-Logo-small.png') %>" width="40" height="40" alt="Logo", class="<%= display_none.present? ? 'm-0' : '' %>" />
<span class="navbar-brand-txt">SX Restaurant</span>
</a>

View File

@@ -243,7 +243,7 @@
</div>
<div class="card-block">
<div class="card-text" id="order-detail-slimscroll" data-height="140">
<div class="card-text" id="order-detail-slimscroll" data-height="165">
<table class="table table-striped summary-items" id="order-items-table" >
<thead>
<tr>

View File

@@ -250,7 +250,7 @@ $(function() {
if ($('#server_mode').val() != "cloud" && display_type == 2) {
document.getElementById('second_view').click();
}
window.location.href = '/origami/food_court';
window.location.href = '/foodcourt/food_court#';
});
$(".order_reservation").on('click', function() {