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 @@ -