Zone and OQS

This commit is contained in:
Phyo
2017-06-17 18:00:59 +06:30
parent cd804a3d18
commit b093a993ba
26 changed files with 608 additions and 60 deletions

View File

@@ -1,10 +1,10 @@
<%= simple_form_for(@settings_zone) do |f| %>
<%= simple_form_for([:settings,@settings_zone]) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.input :name %>
<%= f.input :is_active %>
<%= f.input :created_by %>
<%= f.input :created_by, :collection => Employee.collection %>
</div>
<div class="form-actions">

View File

@@ -1,6 +1,10 @@
<h1>Editing Settings Zone</h1>
<%= render 'form', settings_zone: @settings_zone %>
<%= link_to 'Show', @settings_zone %> |
<%= link_to 'Back', settings_zones_path %>
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= settings_zones_path %>">Zones</a></li>
<li>Edit</li>
</ul>
</div>
<%= render 'form', settings_zone: @settings_zone %>
</div>

View File

@@ -1,31 +1,41 @@
<p id="notice"><%= notice %></p>
<h1>Settings Zones</h1>
<table>
<thead>
<tr>
<th>Name</th>
<th>Is active</th>
<th>Created by</th>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @settings_zones.each do |settings_zone| %>
<tr>
<td><%= settings_zone.name %></td>
<td><%= settings_zone.is_active %></td>
<td><%= settings_zone.created_by %></td>
<td><%= link_to 'Show', settings_zone %></td>
<td><%= link_to 'Edit', edit_settings_zone_path(settings_zone) %></td>
<td><%= link_to 'Destroy', settings_zone, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li>Zones</li>
<span style="float: right">
<%= link_to t('.new', :default => t("helpers.links.new")),new_settings_zone_path,:class => 'btn btn-primary btn-sm' %>
</span>
</ul>
</div>
<br>
<div class="card">
<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Is active</th>
<th>Created by</th>
<th colspan="3"></th>
</tr>
</thead>
<%= link_to 'New Settings Zone', new_settings_zone_path %>
<tbody>
<% @settings_zones.each do |settings_zone| %>
<tr>
<td><%= settings_zone.name %></td>
<td><%= settings_zone.is_active %></td>
<% if Employee.exists?(settings_zone.created_by) %>
<td><%= Employee.find(settings_zone.created_by).name %></td>
<% else %>
<td><%= settings_zone.created_by %></td>
<% end %>
<td><%= link_to 'Show', settings_zone_path(settings_zone) %></td>
<td><%= link_to 'Edit', edit_settings_zone_path(settings_zone) %></td>
<td><%= link_to 'Destroy', settings_zone_path(settings_zone), method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
</div>

View File

@@ -1,19 +1,97 @@
<p id="notice"><%= notice %></p>
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= settings_zones_path %>">Zones</a></li>
<li>Details</li>
<span style="float: right">
<%= link_to 'Back', settings_zones_path %>
</span>
</ul>
</div>
<p>
<strong>Name:</strong>
<%= @settings_zone.name %>
</p>
<br/>
<div class="card">
<div class="card-block">
<h4 class="card-title">Zone</h4>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Is active</th>
<th>Created by</th>
<th colspan="2"></th>
</tr>
</thead>
<p>
<strong>Is active:</strong>
<%= @settings_zone.is_active %>
</p>
<tbody>
<tr>
<td><%= @settings_zone.name %></td>
<td><%= @settings_zone.is_active %></td>
<% if Employee.exists?(@settings_zone.created_by) %>
<td><%= Employee.find(@settings_zone.created_by).name %></td>
<% else %>
<td><%= @settings_zone.created_by %></td>
<% end %>
<td><%= link_to 'Edit', edit_settings_zone_path(@settings_zone) %></td>
<td><%= link_to 'Destroy', settings_zone_path(@settings_zone), method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
</tbody>
</table>
</div>
</div>
<br>
<div class="card">
<div class="card-block">
<h4 class="card-title">Dining Facilities
<span style="float: right">
<%= link_to "New Table",new_settings_zone_table_path(@settings_zone),:class => 'btn btn-primary btn-sm' %>
<%= link_to "New Room",new_settings_zone_room_path(@settings_zone),:class => 'btn btn-primary btn-sm' %>
</span>
</h4>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Seater</th>
<th>Is active</th>
<th>Created by</th>
<th colspan="2"></th>
</tr>
</thead>
<p>
<strong>Created by:</strong>
<%= @settings_zone.created_by %>
</p>
<%= link_to 'Edit', edit_settings_zone_path(@settings_zone) %> |
<%= link_to 'Back', settings_zones_path %>
<tbody>
<% @settings_tables.each do |settings_table|%>
<tr>
<td><%= link_to settings_table.name, settings_zone_table_path(@settings_zone,settings_table) %></td>
<td>Table</td>
<td><%= settings_table.seater %></td>
<td><%= settings_table.is_active %></td>
<% if Employee.exists?(settings_table.created_by) %>
<td><%= Employee.find(settings_table.created_by).name %></td>
<% else %>
<td><%= settings_table.created_by %></td>
<% end %>
<td><%= settings_table.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
<td><%= link_to 'Edit', edit_settings_zone_table_path(@settings_zone, settings_table) %></td>
</tr>
<% end %>
<% @settings_rooms.each do |room|%>
<tr>
<td><%= link_to room.name, settings_zone_room_path(@settings_zone,room) %></td>
<td>Room</td>
<td><%= room.seater %></td>
<td><%= room.is_active %></td>
<% if Employee.exists?(room.created_by) %>
<td><%= Employee.find(room.created_by).name %></td>
<% else %>
<td><%= room.created_by %></td>
<% end %>
<td><%= room.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
<td><%= link_to 'Edit', edit_settings_zone_room_path(@settings_zone, room) %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>