table status color

This commit is contained in:
Yan
2017-12-07 17:04:55 +06:30
parent 94c2086152
commit daf3554826
4 changed files with 13 additions and 29 deletions

View File

@@ -88,7 +88,11 @@ class DiningFacility < ApplicationRecord
checkout_at_min -= min checkout_at_min -= min
if (checkout_at_hr <= hr) && (checkout_at_min <= 15) if (checkout_at_hr <= hr) && (checkout_at_min <= 15)
return booking return booking
else
return nil
end end
else
return nil
end end
end end
end end

View File

@@ -47,12 +47,8 @@
Table <%= table.name %> ( <%= table.seater %> Seat ) Table <%= table.name %> ( <%= table.seater %> Seat )
</div> </div>
</div> </div>
<% else %> <% else %>
<% if table.get_checkout_booking.nil? %> <div class="card tables blue text-white" data-id="<%= table.id %>">
<div class="card tables blue text-white" data-id="<%= table.id %>">
<% else %>
<div class="card tables orange text-white" data-id="<%= table.id %>">
<% end %>
<div class="card-block"> <div class="card-block">
Zone <%= table.zone_id %> <br> Zone <%= table.zone_id %> <br>
Table <%= table.name %> ( <%= table.seater %> Seat ) Table <%= table.name %> ( <%= table.seater %> Seat )

View File

@@ -40,23 +40,15 @@
<% @tables.each do |table| %> <% @tables.each do |table| %>
<% if table.status == 'occupied' %> <% if table.status == 'occupied' %>
<% if table.get_booking.nil? %> <% if table.get_booking.nil? %>
<% if table.get_checkout_booking.nil? %> <div class="card tables red text-white table_<%= table.id %>" data-id="<%= table.id %>">
<div class="card tables red text-white table_<%= table.id %>" data-id="<%= table.id %>">
<% else %>
<div class="card tables orange text-white table_<%= table.id %>" data-id="<%= table.id %>">
<% end %>
<div class="card-block"> <div class="card-block">
<%= table.name %> <%= table.name %>
<span class="float-right font-12 new_text_<%= table.id %>"> billed</span> <span class="float-right font-12 new_text_<%= table.id %>"> billed</span>
<div style="font-size:12px;"></div> <div style="font-size:12px;"></div>
</div> </div>
</div> </div>
<% else %> <% else %>
<% if table.get_checkout_booking.nil? %> <div class="card tables blue text-white table_<%= table.id %>" data-id="<%= table.id %>">
<div class="card tables blue text-white table_<%= table.id %>" data-id="<%= table.id %>">
<% else %>
<div class="card tables orange text-white table_<%= table.id %>" data-id="<%= table.id %>">
<% end %>
<div class="card-block"> <div class="card-block">
<%= table.name %> <%= table.name %>
<span class="float-right font-12 new_text_<%= table.id %>"> new</span> <span class="float-right font-12 new_text_<%= table.id %>"> new</span>

View File

@@ -39,23 +39,15 @@
<div class="card-columns"> <div class="card-columns">
<% @tables.each do |table| %> <% @tables.each do |table| %>
<% if table.status == 'occupied' %> <% if table.status == 'occupied' %>
<% if table.get_booking.nil? %> <% if table.get_booking.nil? %>
<% if table.get_checkout_booking.nil? %> <div class="card tables red text-white table_<%= table.id %>" data-id="<%= table.id %>">
<div class="card tables red text-white table_<%= table.id %>" data-id="<%= table.id %>">
<% else %>
<div class="card tables orange text-white table_<%= table.id %>" data-id="<%= table.id %>">
<% end %>
<div class="card-block"> <div class="card-block">
<%= table.name %> <%= table.name %>
<span class="pull-right font-12 new_text_<%= table.id %>"> billed</span> <span class="pull-right font-12 new_text_<%= table.id %>"> billed</span>
</div> </div>
</div> </div>
<% else %> <% else %>
<% if table.get_checkout_booking.nil? %> <div class="card tables blue text-white table_<%= table.id %>" data-id="<%= table.id %>">
<div class="card tables blue text-white table_<%= table.id %>" data-id="<%= table.id %>">
<% else %>
<div class="card tables orange text-white table_<%= table.id %>" data-id="<%= table.id %>">
<% end %>
<div class="card-block"> <div class="card-block">
<%= table.name %> <%= table.name %>
<span class="pull-right font-12 new_text_<%= table.id %>"> new</span> <span class="pull-right font-12 new_text_<%= table.id %>"> new</span>