This commit is contained in:
Yan
2017-10-12 15:34:16 +06:30
parent b7955b04fa
commit a6b8389fd0
4 changed files with 25 additions and 22 deletions

View File

@@ -12,11 +12,6 @@ class ApplicationController < ActionController::Base
#all token authentication must be done here #all token authentication must be done here
#response format must be set to JSON #response format must be set to JSON
rescue_from CanCan::AccessDenied do |exception|
flash[:warning] = exception.message
redirect_to root_path
end
def set_locale def set_locale
I18n.locale = params[:locale] || I18n.default_locale I18n.locale = params[:locale] || I18n.default_locale
end end
@@ -72,6 +67,11 @@ class ApplicationController < ActionController::Base
@default_config ||= ActiveRecord::Base.connection.instance_variable_get("@config").dup @default_config ||= ActiveRecord::Base.connection.instance_variable_get("@config").dup
end end
rescue_from CanCan::AccessDenied do |exception|
flash[:warning] = exception.message
redirect_to root_path
end
def current_user def current_user
@current_user ||= Employee.find_by_token_session(session[:session_token]) if session[:session_token] @current_user ||= Employee.find_by_token_session(session[:session_token]) if session[:session_token]
end end

View File

@@ -28,41 +28,41 @@
<!-- Menu --> <!-- Menu -->
<div class="menu"> <div class="menu">
<ul class="list"> <ul class="list">
<li class="header">MAIN NAVIGATION</li> <li class="header"><%= t :main_navigation %></li>
<li class="active"> <li class="active">
<a href="<%= dashboard_path %>"> <a href="<%= dashboard_path %>">
<i class="material-icons">home</i> <i class="material-icons">home</i>
<span>Home</span> <span><%= t :dashboard %></span>
</a> </a>
</li> </li>
<li> <li>
<a href="<%= oqs_root_path %>"> <a href="<%= oqs_root_path %>">
<i class="material-icons">room_service</i> <i class="material-icons">room_service</i>
<span>Order Queue Station</span> <span><%= t :oqs %></span>
</a> </a>
</li> </li>
<li> <li>
<a href="<%= origami_root_path %>"> <a href="<%= origami_root_path %>">
<i class="material-icons">monetization_on</i> <i class="material-icons">monetization_on</i>
<span>Cashier</span> <span><%= t :origami %></span>
</a> </a>
</li> </li>
<li> <li>
<a href="<%= crm_customers_path %>"> <a href="<%= crm_customers_path %>">
<i class="material-icons">group</i> <i class="material-icons">group</i>
<span>CRM</span> <span><%= t :crm %></span>
</a> </a>
</li> </li>
<li> <li>
<a href="<%= inventory_path %>"> <a href="<%= inventory_path %>">
<i class="material-icons">store</i> <i class="material-icons">store</i>
<span>Inventory</span> <span><%= t :inventory %></span>
</a> </a>
</li> </li>
<li> <li>
<a href="javascript:void(0);" class="menu-toggle"> <a href="javascript:void(0);" class="menu-toggle">
<i class="material-icons">widgets</i> <i class="material-icons">widgets</i>
<span>Transaction</span> <span><%= t :transactions %></span>
</a> </a>
<ul class="ml-menu"> <ul class="ml-menu">
<li> <li>
@@ -79,7 +79,7 @@
<li> <li>
<a href="javascript:void(0);" class="menu-toggle"> <a href="javascript:void(0);" class="menu-toggle">
<i class="material-icons">assessment</i> <i class="material-icons">assessment</i>
<span>Report</span> <span><%= t :reports %></span>
</a> </a>
<ul class="ml-menu"> <ul class="ml-menu">
<li> <li>
@@ -108,41 +108,41 @@
</li> </li>
</ul> </ul>
</li> </li>
<li class="header">SETTINGS</li> <li class="header"><%= t :settings %></li>
<li> <li>
<a href="<%= settings_zones_path %>"> <a href="<%= settings_zones_path %>">
<i class="material-icons col-red">donut_large</i> <i class="material-icons col-red">donut_large</i>
<span>Dinings</span> <span><%= t :dinings %></span>
</a> </a>
</li> </li>
<li> <li>
<a href="<%= settings_menus_path %>"> <a href="<%= settings_menus_path %>">
<i class="material-icons col-amber">donut_large</i> <i class="material-icons col-amber">donut_large</i>
<span>Menu</span> <span><%= t :menu %></span>
</a> </a>
</li> </li>
<li> <li>
<a href="<%= settings_employees_path %>"> <a href="<%= settings_employees_path %>">
<i class="material-icons col-light-blue">donut_large</i> <i class="material-icons col-light-blue">donut_large</i>
<span>Staffs</span> <span><%= t :staff %></span>
</a> </a>
</li> </li>
<li> <li>
<a href="<%= settings_cashier_terminals_path %>"> <a href="<%= settings_cashier_terminals_path %>">
<i class="material-icons col-green">donut_large</i> <i class="material-icons col-green">donut_large</i>
<span>Cashiers</span> <span><%= t :cashier + " " + t :terminal %></span>
</a> </a>
</li> </li>
<li> <li>
<a href="<%= print_settings_path %>"> <a href="<%= print_settings_path %>">
<i class="material-icons col-pupple">donut_large</i> <i class="material-icons col-pupple">donut_large</i>
<span>Printers</span> <span><%= t :printer %></span>
</a> </a>
</li> </li>
<li> <li>
<a href="<%= settings_products_path %>"> <a href="<%= settings_products_path %>">
<i class="material-icons col-brown">donut_large</i> <i class="material-icons col-brown">donut_large</i>
<span>Products</span> <span><%= t :products %></span>
</a> </a>
</li> </li>
</ul> </ul>

View File

@@ -48,6 +48,7 @@
<!-- Main Content --> <!-- Main Content -->
<section class="content"> <section class="content">
<h1><%= t :welcome %></h1>
<%= yield %> <%= yield %>
</section> </section>
</body> </body>

View File

@@ -10,13 +10,15 @@ mm:
transactions: "အလုပ်ဲပြီးမြောက်မှု့များ" transactions: "အလုပ်ဲပြီးမြောက်မှု့များ"
reports: "အစီရင်ခံစာ" reports: "အစီရင်ခံစာ"
zones: "Zones" zones: "Zones"
dinings: "Dinings"
menu: "Menu" menu: "Menu"
cashier: "Cashier" cashier: "Cashier"
terminal: "Terminal" terminal: "Terminal"
print: "Print" print: "Print"
staff: "Staff" staff: "Staff"
product: "Product" products: "Products"
promotion: "Promotion" promotions: "Promotions"
printer: "Printer"
views: views:
pagination: pagination:
first: "&laquo; ပထမ" first: "&laquo; ပထမ"