diff --git a/app/controllers/base_inventory_controller.rb b/app/controllers/base_inventory_controller.rb new file mode 100644 index 00000000..4059ac25 --- /dev/null +++ b/app/controllers/base_inventory_controller.rb @@ -0,0 +1,17 @@ +class BaseInventoryController < ActionController::Base + include LoginVerification + layout "inventory" + + #before_action :check_installation + protect_from_forgery with: :exception + + 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 + +end diff --git a/app/controllers/inventory/inventory_controller.rb b/app/controllers/inventory/inventory_controller.rb new file mode 100644 index 00000000..525f0277 --- /dev/null +++ b/app/controllers/inventory/inventory_controller.rb @@ -0,0 +1,6 @@ +class Inventory::InventoryController < BaseInventoryController + + def index + + end +end diff --git a/app/controllers/inventory/inventory_definitions_controller.rb b/app/controllers/inventory/inventory_definitions_controller.rb index 7c7288df..8a3f3a40 100644 --- a/app/controllers/inventory/inventory_definitions_controller.rb +++ b/app/controllers/inventory/inventory_definitions_controller.rb @@ -1,4 +1,4 @@ -class InventoryDefinitionsController < ApplicationController +class Inventory::InventoryDefinitionsController < BaseInventoryController before_action :set_inventory_definition, only: [:show, :edit, :update, :destroy] # GET /inventory_definitions diff --git a/app/helpers/inventory/inventory_definitions_helper.rb b/app/helpers/inventory_definitions_helper.rb similarity index 100% rename from app/helpers/inventory/inventory_definitions_helper.rb rename to app/helpers/inventory_definitions_helper.rb diff --git a/app/helpers/inventory/stock_check_items_helper.rb b/app/helpers/stock_check_items_helper.rb similarity index 100% rename from app/helpers/inventory/stock_check_items_helper.rb rename to app/helpers/stock_check_items_helper.rb diff --git a/app/helpers/inventory/stock_checks_helper.rb b/app/helpers/stock_checks_helper.rb similarity index 100% rename from app/helpers/inventory/stock_checks_helper.rb rename to app/helpers/stock_checks_helper.rb diff --git a/app/helpers/inventory/stock_journals_helper.rb b/app/helpers/stock_journals_helper.rb similarity index 100% rename from app/helpers/inventory/stock_journals_helper.rb rename to app/helpers/stock_journals_helper.rb diff --git a/app/views/home/dashboard.html.erb b/app/views/home/dashboard.html.erb index 08991091..8a922573 100644 --- a/app/views/home/dashboard.html.erb +++ b/app/views/home/dashboard.html.erb @@ -55,6 +55,17 @@ + +