fixed cashier shift control & license

This commit is contained in:
NyanLinHtut
2020-06-23 11:36:10 +06:30
parent 276e437a07
commit e7ac530314
2 changed files with 15 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
<form action="/activate" method="POST" class="row">
<%= form_tag activate_path, class: "row" do %>
<div class="col-md-6">
<div class="form-group">
<label for="exampleInputEmail1">Business Name</label>
@@ -41,4 +41,4 @@
<div class="col-md-12 text-center">
<button type="submit" class="btn btn-primary">Activate</button>
</div>
</form>
<% end %>

View File

@@ -51,8 +51,18 @@
<% end %>
<% if can? :index, :home %>
<% if current_login_employee.role != "kitchen" %>
<% if current_user.role == "cashier"
shift = ShiftSale.current_open_shift(current_user.id)
if !shift.nil?
path = origami_dashboard_path
else
path = new_origami_shift_path
end
else current_user.role == "administrator"
path = origami_dashboard_path
end %>
<li class="menu-up">
<a href="<%= origami_dashboard_path %>">
<a href="<%= path %>">
<i class="material-icons">monetization_on</i>
<span><%= t :origami %></span>
</a>