Manager level can not edit Administrator's password and id

This commit is contained in:
San Wai Lwin
2018-04-18 16:57:02 +06:30
parent 859080d4a1
commit 70ec80a1d5
2 changed files with 17 additions and 11 deletions

View File

@@ -435,16 +435,18 @@
</div> </div>
<div class="modal-footer "> <div class="modal-footer ">
<div class="row m-b-10 m-r-30"> <div class="row m-b-10 m-r-30">
<% if ENV["SERVER_MODE"] != "cloud" %>
<div class="col-md-5 m-r-20"> <div class="col-md-5 m-r-15">
<% if ENV["SERVER_MODE"] != "cloud" %> <button type="button" class="btn btn-link bg-red waves-effect print_receipt">Print</button>
<button type="button" class="btn btn-link bg-red waves-effect print_receipt">Print</button> </div>
<% end %> <div class="col-md-5 m-r-13">
</div> <button type="button" class="btn btn-link bg-blue waves-effect btn_pdf_close" data-dismiss="modal">CLOSE</button>
</div>
<div class="col-md-5 m-r-20"> <% else %>
<button type="button" class="btn btn-link bg-blue waves-effect btn_pdf_close" data-dismiss="modal">CLOSE</button> <div class="col-md-9 m-r-15">
</div> <button type="button" class="btn btn-link bg-blue waves-effect btn_pdf_close" data-dismiss="modal">CLOSE</button>
</div>
<% end %>
</div> </div>
</div> </div>

View File

@@ -7,7 +7,11 @@
<div class="form-inputs p-l-15"> <div class="form-inputs p-l-15">
<%= f.input :name %> <%= f.input :name %>
<%= f.input :role, :collection => Lookup.collection_of("employee_roles"),:class=>'form-group' %> <% if current_user.role == "administrator" %>
<%= f.input :role, :collection => Lookup.collection_of("employee_roles"),:class=>'form-group' %>
<% else %>
<%= f.input :role, :collection => Lookup.collection_of("employee_roles").select{|r| r[1] != "administrator"},:class=>'form-group' %>
<% end %>
<%= f.input :emp_id, :label => "Employee Numberic ID (*Unique)" %> <%= f.input :emp_id, :label => "Employee Numberic ID (*Unique)" %>
<%= f.input :password %> <%= f.input :password %>