diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 9f87cd9d..b23e6d28 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -13,7 +13,7 @@ //= require jquery //= require jquery_nested_form //= require tether -//= require bootstrap/js/bootstrap.js +//= require bootstrap/js/bootstrap-material-design.min //= require jquery_ujs //= require turbolinks //= require cable diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index fde428bd..d17a9f98 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -1,6 +1,5 @@ @import "tether"; -@import "bootstrap/css/bootstrap"; -@import "BSBMaterial/materialize"; +@import "bootstrap/css/bootstrap-material-design.min"; @import "node-waves/waves"; @import "animate-css/animate"; @import "morrisjs/morris"; diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 691c6648..e2fd2bae 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -9,13 +9,11 @@ class ApplicationController < ActionController::Base #all token authentication must be done here #response format must be set to JSON - rescue_from CanCan::AccessDenied do |exception| flash[:warning] = exception.message redirect_to root_path end - def current_user @current_user ||= Employee.find_by_token_session(session[:session_token]) if session[:session_token] end diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 54534c4f..4e21de0b 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -1,14 +1,17 @@ class HomeController < ApplicationController - skip_before_action :authenticate, only: [:index, :show, :create, :update, :destroy] + # layout "application", except: [:index, :show] + skip_before_action :authenticate, only: [:index, :show, :create, :update, :destroy] def index @employees = Employee.all_emp_except_waiter.order("name asc") @login_form = LoginForm.new() + render "layouts/initial", layout: false end def show @login_form = LoginForm.new() @login_form.emp_id = params[:emp_id] + render "layouts/initial", layout: false end def update @@ -23,7 +26,7 @@ class HomeController < ApplicationController else flash[:notice] ="Invalid PIN for Employee. Please try again!" render :show - end + end end def create @@ -69,6 +72,7 @@ class HomeController < ApplicationController end private + # Never trust parameters from the scary internet, only allow the white list through. def settings_home_params params.require(:login_form).permit(:emp_id, :password) diff --git a/app/views/home/dashboard.html.erb b/app/views/home/dashboard.html.erb index 0883cc92..b87624ff 100644 --- a/app/views/home/dashboard.html.erb +++ b/app/views/home/dashboard.html.erb @@ -1,201 +1,308 @@ -
-
-

Role Features

- -
- <% if current_user.role == 'administrator' %> -
-
-

- Administrator -

-
-
-
-
    -
  • All Settings
  • -
      -
    • Zone
    • -
    • OQS
    • -
    • Menu
    • -
    • Cashier Terminal
    • -
    • Payment
    • -
    • Merbership
    • -
    • Print
    • -
    • Employees
    • -
    • Accounts
    • -
    -
-
    -
  • Transactions
  • -
      -
    • Order
    • -
    • Sale
    • -
    • Credit Note
    • -

    -
  • Reports
  • -
      -
    • Daily Sale
    • -
    • Sale Item
    • -
    • Receipt
    • -
    • Shift Sale
    • -
    • Credit Sale
    • -
    • Void Sale
    • -
    -
-
    -
  • OQS

  • -
  • Cashier

  • -
  • CRM
  • -
-
-
-
- <% elsif current_user.role == 'manager' %> -
-
-

- Manager -

-
-
-
-
    -
  • All Settings
  • -
      -
    • Zone
    • -
    • OQS
    • -
    • Menu
    • -
    • Cashier Terminal
    • -
    • Print
    • -
    • Employees
    • -
    • Accounts
    • -
    -
-
    -
  • Transactions
  • -
      -
    • Order
    • -
    • Sale
    • -
    • Credit Note
    • -

    -
  • Reports
  • -
      -
    • Daily Sale
    • -
    • Sale Item
    • -
    • Receipt
    • -
    • Shift Sale
    • -
    • Credit Sale
    • -
    • Void Sale
    • -
    -
-
    -
  • OQS

  • -
  • Cashier

  • -
  • CRM
  • -
-
-
-
- <% elsif current_user.role == 'supervisour' %> -
-
-

- Supervisor -

-
-
-
-
    -
  • OQS
  • -
      -
    • Void
    • -
    • FOC
    • -
    • Edit
    • -
    • Credit
    • -
    • Payment
    • -
    -
-
-
-
- <% elsif current_user.role == 'cashier' %> -
-
-

- Cashier -

-
-
-
-
    -
  • Cashier Panel except Edit and Void
  • -
  • Sale and Order
  • -
  • and Queue in CRM
  • -
-
-
-
- <% elsif current_user.role == 'account' %> -
-
-

- Accountant -

-
-
-
-
    -
  • Daily Sale Report
  • -
  • Sale Item Report
  • -
  • Receipt No Report
  • -
  • ShiftSale Report
  • -
-
-
-
- <% end %> +
+
+

DASHBOARD

-
-
-
-
OQS
+ +
+
+
+
+ playlist_add_check +
+
+
NEW TASKS
+
+
+
+
+
+
+
+ help +
+
+
NEW TICKETS
+
+
+
+
+
+
+
+ forum +
+
+
NEW COMMENTS
+
+
+
+
+
+
+
+ person_add +
+
+
NEW VISITORS
+
+
+
+
- -
-
Cashier
+ + +
+
+
+
+
+
+

CPU USAGE (%)

+
+
+
+ REAL TIME + +
+
+
+ +
+
+
+
+
+
- -
-
CRM
+ +
+ +
+
+
+
+ 12,10,9,6,5,6,10,5,7,5,12,13,7,12,11 +
+
    +
  • + TODAY + 1 200 USERS +
  • +
  • + YESTERDAY + 3 872 USERS +
  • +
  • + LAST WEEK + 26 582 USERS +
  • +
+
+
- - - -
-
Inventory
+ + +
+
+
+
LATEST SOCIAL TRENDS
+
    +
  • + #socialtrends + + trending_up + +
  • +
  • + #materialdesign + + trending_up + +
  • +
  • #adminbsb
  • +
  • #freeadmintemplate
  • +
  • #bootstraptemplate
  • +
  • + #freehtmltemplate + + trending_up + +
  • +
+
+
-
-
+ + +
+
+
+
ANSWERED TICKETS
+
    +
  • + TODAY + 12 TICKETS +
  • +
  • + YESTERDAY + 15 TICKETS +
  • +
  • + LAST WEEK + 90 TICKETS +
  • +
  • + LAST MONTH + 342 TICKETS +
  • +
  • + LAST YEAR + 4 225 TICKETS +
  • +
  • + ALL + 8 752 TICKETS +
  • +
+
+
+
+ -