update oqs employee and oqs station
This commit is contained in:
@@ -9,15 +9,18 @@
|
||||
<%= f.input :name %>
|
||||
<%= f.input :is_active,:input_html=>{:class=>"col-md-9"} %>
|
||||
<% if current_user.role == "administrator" %>
|
||||
<%= f.input :role, :collection => Lookup.collection_of("employee_roles"),:class=>'form-group' %>
|
||||
<%= f.input :role, :collection => Lookup.collection_of("employee_roles"),:class=>'form-group employee_roles' %>
|
||||
<% elsif current_user.role == "supervisor" %>
|
||||
<%= f.input :role, :collection => Lookup.collection_of("employee_roles").select{|r| r[1] == "cashier" || r[1] == "waiter"},:class=>'form-group' %>
|
||||
<%= f.input :role, :collection => Lookup.collection_of("employee_roles").select{|r| r[1] == "cashier" || r[1] == "waiter"},:class=>'form-group employee_roles' %>
|
||||
<% else %>
|
||||
<%= f.input :role, :collection => Lookup.collection_of("employee_roles").select{|r| r[1] != "administrator"},:class=>'form-group' %>
|
||||
<%= f.input :role, :collection => Lookup.collection_of("employee_roles").select{|r| r[1] != "administrator"},:class=>'form-group employee_roles' %>
|
||||
<% end %>
|
||||
<div class="form-group order_queue_station_id bmd-form-group hidden">
|
||||
<%= f.label :order_queue_station, 'Order Queue Station'%>
|
||||
<%= f.select :order_queue_station_id, OrderQueueStation.active.map {|l| [l.station_name, l.id]}, { :include_blank => 'Choose Order Queue Station'}, {class: 'form-control'} %>
|
||||
</div>
|
||||
<%= f.input :emp_id, :label => "Employee Numberic ID (*Unique)" %>
|
||||
<%= f.input :password %>
|
||||
|
||||
</div>
|
||||
<div class="form-inputs p-l-15">
|
||||
<label>Employee Image</label>
|
||||
@@ -68,7 +71,19 @@
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).on('turbolinks:load', function() {
|
||||
$('body').bootstrapMaterialDesign();
|
||||
// $(document).on('turbolinks:load', function() {
|
||||
// alert("hi")
|
||||
// $('body').bootstrapMaterialDesign();
|
||||
$(function() {
|
||||
if ($("#employee_role").val()=="kitchen") {
|
||||
$('.order_queue_station_id').removeClass("hidden");
|
||||
}
|
||||
$(document).on('click', '#employee_role', function(event){
|
||||
if ($(this).val()=="kitchen") {
|
||||
$('.order_queue_station_id').removeClass("hidden");
|
||||
}else{
|
||||
$('.order_queue_station_id').addClass("hidden");
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -36,6 +36,12 @@
|
||||
<th><%= t("views.right_panel.detail.role") %></th>
|
||||
<td><%= @employee.role %></td>
|
||||
</tr>
|
||||
<% if @employee.role == "kitchen"%>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.station_name") %></th>
|
||||
<td><%= @employee.order_queue_station.station_name %></td>
|
||||
</tr>
|
||||
<% end%>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.created_at") %></th>
|
||||
<td><%= @employee.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
|
||||
Reference in New Issue
Block a user