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

@@ -0,0 +1,16 @@
<%= simple_form_for([:settings,@zone,@settings_table]) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.input :name %>
<%= f.input :status %>
<%= f.input :seater %>
<%= f.input :order_by %>
<%= f.input :is_active %>
<%= f.input :created_by, :collection => Employee.collection %>
</div>
<div class="form-actions">
<%= f.button :submit %>
</div>
<% end %>

View File

@@ -0,0 +1,2 @@
json.extract! settings_table, :id, :name, :status, :seater, :order_by, :is_active, :created_by, :created_at, :updated_at
json.url settings_table_url(settings_table, format: :json)

View File

@@ -0,0 +1,10 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= settings_zone_tables_path %>">Tables</a></li>
<li>Edit</li>
</ul>
</div>
<%= render 'form', settings_table: @settings_table %>
</div>

View File

@@ -0,0 +1,49 @@
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li>Tables</li>
<span style="float: right">
<%= link_to t('.new', :default => t("helpers.links.new")),new_settings_zone_table_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>Status</th>
<th>Seater</th>
<th>Order by</th>
<th>is Active</th>
<th>Created By</th>
<th>Created At</th>
</tr>
</thead>
<tbody>
<% @settings_tables.each do |table| %>
<tr>
<td><%= link_to table.name, settings_menu_path(table) %></td>
<td><%= table.status %></td>
<td><%= table.seater rescue "-" %></td>
<td><%= table.order_by rescue "-" %></td>
<td><%= table.is_active %></td>
<% if Employee.exists?(table.created_by) %>
<td><%= Employee.find(table.created_by).name %></td>
<% else %>
<td><%= table.created_by %></td>
<% end %>
<td><%= table.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
<td><%= link_to 'Edit', edit_settings_zone_table_path(@zone,table) %></td>
<td><%= link_to 'Destroy', settings_zone_table_path(@zone,table), method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
</div>

View File

@@ -0,0 +1,11 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= settings_zone_path(@zone) %>">Zone</a></li>
<li>New</li>
</ul>
</div>
<%= render 'form', settings_table: @settings_table %>
</div>

View File

@@ -0,0 +1,47 @@
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= settings_zone_tables_path %>">Tables</a></li>
<li>Details</li>
<span style="float: right">
</span>
</ul>
</div>
<br/>
<div class="card">
<div class="card-block">
<h4 class="card-title">Table</h4>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Status</th>
<th>Seater</th>
<th>Order by</th>
<th>is Active</th>
<th>Created By</th>
<th>Created At</th>
</tr>
</thead>
<tbody>
<tr>
<td><%= link_to @table.name, settings_menu_path(@table) %></td>
<td><%= @table.status %></td>
<td><%= @table.seater rescue "-" %></td>
<td><%= @table.order_by rescue "-" %></td>
<td><%= @table.is_active rescue "-" %></td>
<% if Employee.exists?(@table.created_by) %>
<td><%= Employee.find(@table.created_by).name %></td>
<% else %>
<td><%= @table.created_by %></td>
<% end %>
<td><%= @table.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
<td><%= link_to 'Edit', edit_settings_zone_table_path(@zone,@table) %></td>
<td><%= link_to 'Destroy', settings_zone_table_path(@zone,@table), method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
</tbody>
</table>
</div>
</div>