ecm_staff2_backend 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +17 -0
  5. data/app/assets/javascripts/ecm/staff/backend/application.js +13 -0
  6. data/app/assets/javascripts/ecm_staff_backend.js +1 -0
  7. data/app/assets/stylesheets/ecm/staff/backend/application.css +14 -0
  8. data/app/assets/stylesheets/ecm_staff_backend.css +3 -0
  9. data/app/controllers/ecm/staff/backend/application_controller.rb +8 -0
  10. data/app/controllers/ecm/staff/backend/business_units_controller.rb +17 -0
  11. data/app/controllers/ecm/staff/backend/home_controller.rb +6 -0
  12. data/app/controllers/ecm/staff/backend/organisations_controller.rb +17 -0
  13. data/app/controllers/ecm/staff/backend/people_controller.rb +17 -0
  14. data/app/controllers/ecm/staff/backend/positions_controller.rb +17 -0
  15. data/app/helpers/ecm/staff/backend/application_helper.rb +8 -0
  16. data/app/policies/ecm/staff/backend/engine_policy.rb +4 -0
  17. data/app/views/layouts/ecm/staff/backend/application.html.erb +14 -0
  18. data/config/initializers/assets.rb +2 -0
  19. data/config/locales/de.yml +6 -0
  20. data/config/rbac.yml +72 -0
  21. data/config/routes.rb +8 -0
  22. data/lib/ecm/staff/backend.rb +9 -0
  23. data/lib/ecm/staff/backend/configuration.rb +28 -0
  24. data/lib/ecm/staff/backend/engine.rb +9 -0
  25. data/lib/ecm/staff/backend/version.rb +7 -0
  26. data/lib/ecm_staff2_backend.rb +4 -0
  27. data/lib/generators/ecm/staff/backend/install/install_generator.rb +33 -0
  28. data/lib/generators/ecm/staff/backend/install/templates/initializer.rb +25 -0
  29. data/lib/generators/ecm/staff/backend/install/templates/routes.source +4 -0
  30. data/lib/tasks/ecm/staff/backend_tasks.rake +4 -0
  31. metadata +102 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: cef6e8c5cf6128a5fdbe13876dd80f303537fc2b
4
+ data.tar.gz: 91adcd6255358e08ba08e3934fce0f02cf450e47
5
+ SHA512:
6
+ metadata.gz: cd42a17a0396c4956834ddc60956b1c826cf09abbd57b9ac0dc9a2b73552cec22e2feb819f2b7f326338d5c5693529e486e9456bc4b1e32f3fd18d7f6f1ebe59
7
+ data.tar.gz: a219f05bdc6d6c5c43dc0bfa8f1c0348c1d20f3961ed87eb2b8a056dab4ef72dc96e3da0315f768d7eba8c677e016158560e4d72494755ddbcc284781b6f1d69
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2016 Roberto Vasquez Angel
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,3 @@
1
+ = Ecm::Staff::Backend
2
+
3
+ This project rocks and uses MIT-LICENSE.
data/Rakefile ADDED
@@ -0,0 +1,17 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'Ecm::Staff::Backend'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree ./application
@@ -0,0 +1 @@
1
+ //= require ecm/staff/backend/application.js
@@ -0,0 +1,14 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. It is generally better to create a new file per style scope.
11
+ *
12
+ *= require_tree ./application
13
+ *= require_self
14
+ */
@@ -0,0 +1,3 @@
1
+ /*
2
+ *= require ecm/staff/backend/application
3
+ */
@@ -0,0 +1,8 @@
1
+ module Ecm
2
+ module Staff
3
+ module Backend
4
+ class ApplicationController < ActionController::Base
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,17 @@
1
+ module Ecm
2
+ module Staff
3
+ module Backend
4
+ class BusinessUnitsController < Itsf::Backend::Resource::BaseController
5
+ def self.resource_class
6
+ Ecm::Staff::BusinessUnit
7
+ end
8
+
9
+ private
10
+
11
+ def load_resource
12
+ load_scope.friendly.find(params[:id])
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,6 @@
1
+ module Ecm::Staff::Backend
2
+ class HomeController < Itsf::Backend::HomeController
3
+ def index
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,17 @@
1
+ module Ecm
2
+ module Staff
3
+ module Backend
4
+ class OrganisationsController < Itsf::Backend::Resource::BaseController
5
+ def self.resource_class
6
+ Ecm::Staff::Organisation
7
+ end
8
+
9
+ private
10
+
11
+ def load_resource
12
+ load_scope.friendly.find(params[:id])
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ module Ecm
2
+ module Staff
3
+ module Backend
4
+ class PeopleController < Itsf::Backend::Resource::BaseController
5
+ def self.resource_class
6
+ Ecm::Staff::Person
7
+ end
8
+
9
+ private
10
+
11
+ def load_resource
12
+ load_scope.friendly.find(params[:id])
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ module Ecm
2
+ module Staff
3
+ module Backend
4
+ class PositionsController < Itsf::Backend::Resource::BaseController
5
+ def self.resource_class
6
+ Ecm::Staff::Position
7
+ end
8
+
9
+ private
10
+
11
+ def load_resource
12
+ load_scope.friendly.find(params[:id])
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,8 @@
1
+ module Ecm
2
+ module Staff
3
+ module Backend
4
+ module ApplicationHelper
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,4 @@
1
+ module Ecm::Staff::Backend
2
+ class EnginePolicy < Itsf::Backend::EnginePolicy
3
+ end
4
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Backend</title>
5
+ <%= stylesheet_link_tag "ecm/staff/backend/application", media: "all" %>
6
+ <%= javascript_include_tag "ecm/staff/backend/application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,2 @@
1
+ Rails.application.config.assets.precompile += %w( ecm_staff_backend.css )
2
+ Rails.application.config.assets.precompile += %w( ecm_staff_backend.js )
@@ -0,0 +1,6 @@
1
+ de:
2
+ classes:
3
+ ecm/staff/backend/engine: 'Mitarbeiter'
4
+ routes:
5
+ mount:
6
+ ecm_staff_backend: '/backend/staff'
data/config/rbac.yml ADDED
@@ -0,0 +1,72 @@
1
+ defaults:
2
+ permissions:
3
+ - ecm/staff/backend/engine
4
+ - ecm/staff/business_unit/index
5
+ - ecm/staff/business_unit/show
6
+ - ecm/staff/business_unit/new
7
+ - ecm/staff/business_unit/create
8
+ - ecm/staff/business_unit/edit
9
+ - ecm/staff/business_unit/update
10
+ - ecm/staff/business_unit/destroy
11
+ - ecm/staff/organisation/index
12
+ - ecm/staff/organisation/show
13
+ - ecm/staff/organisation/new
14
+ - ecm/staff/organisation/create
15
+ - ecm/staff/organisation/edit
16
+ - ecm/staff/organisation/update
17
+ - ecm/staff/organisation/destroy
18
+ - ecm/staff/person/index
19
+ - ecm/staff/person/show
20
+ - ecm/staff/person/new
21
+ - ecm/staff/person/create
22
+ - ecm/staff/person/edit
23
+ - ecm/staff/person/update
24
+ - ecm/staff/person/destroy
25
+ - ecm/staff/position/index
26
+ - ecm/staff/position/show
27
+ - ecm/staff/position/new
28
+ - ecm/staff/position/create
29
+ - ecm/staff/position/edit
30
+ - ecm/staff/position/update
31
+ - ecm/staff/position/destroy
32
+ roles:
33
+ ecm/staff/administrator:
34
+ - ecm/staff/backend/engine
35
+ - ecm/staff/business_unit/index
36
+ - ecm/staff/business_unit/show
37
+ - ecm/staff/business_unit/new
38
+ - ecm/staff/business_unit/create
39
+ - ecm/staff/business_unit/edit
40
+ - ecm/staff/business_unit/update
41
+ - ecm/staff/business_unit/destroy
42
+ - ecm/staff/organisation/index
43
+ - ecm/staff/organisation/show
44
+ - ecm/staff/organisation/new
45
+ - ecm/staff/organisation/create
46
+ - ecm/staff/organisation/edit
47
+ - ecm/staff/organisation/update
48
+ - ecm/staff/organisation/destroy
49
+ - ecm/staff/person/index
50
+ - ecm/staff/person/show
51
+ - ecm/staff/person/new
52
+ - ecm/staff/person/create
53
+ - ecm/staff/person/edit
54
+ - ecm/staff/person/update
55
+ - ecm/staff/person/destroy
56
+ - ecm/staff/position/index
57
+ - ecm/staff/position/show
58
+ - ecm/staff/position/new
59
+ - ecm/staff/position/create
60
+ - ecm/staff/position/edit
61
+ - ecm/staff/position/update
62
+ - ecm/staff/position/destroy
63
+ ecm/staff/reviewer:
64
+ - ecm/staff/backend/engine
65
+ - ecm/staff/business_unit/index
66
+ - ecm/staff/business_unit/show
67
+ - ecm/staff/organisation/index
68
+ - ecm/staff/organisation/show
69
+ - ecm/staff/person/index
70
+ - ecm/staff/person/show
71
+ - ecm/staff/position/index
72
+ - ecm/staff/position/show
data/config/routes.rb ADDED
@@ -0,0 +1,8 @@
1
+ Ecm::Staff::Backend::Engine.routes.draw do
2
+ resources :organisations
3
+ resources :business_units
4
+ resources :positions
5
+ resources :people
6
+
7
+ root to: 'home#index'
8
+ end
@@ -0,0 +1,9 @@
1
+ require 'ecm/staff/backend/configuration'
2
+
3
+ module Ecm
4
+ module Staff
5
+ module Backend
6
+ extend Configuration
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,28 @@
1
+ module Ecm
2
+ module Staff
3
+ module Backend
4
+ module Configuration
5
+ def configure
6
+ yield self
7
+ end
8
+
9
+ mattr_accessor(:registered_controllers) do
10
+ lambda do
11
+ [
12
+ Ecm::Staff::Backend::OrganisationsController,
13
+ Ecm::Staff::Backend::BusinessUnitsController,
14
+ Ecm::Staff::Backend::PositionsController,
15
+ Ecm::Staff::Backend::PeopleController
16
+ ]
17
+ end
18
+ end
19
+
20
+ mattr_accessor(:registered_services) do
21
+ lambda do
22
+ []
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,9 @@
1
+ module Ecm
2
+ module Staff
3
+ module Backend
4
+ class Engine < ::Rails::Engine
5
+ isolate_namespace Ecm::Staff::Backend
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,7 @@
1
+ module Ecm
2
+ module Staff
3
+ module Backend
4
+ VERSION = '0.0.1'.freeze
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,4 @@
1
+ require 'itsf_backend'
2
+
3
+ require 'ecm/staff/backend'
4
+ require 'ecm/staff/backend/engine'
@@ -0,0 +1,33 @@
1
+ module Ecm
2
+ module Staff
3
+ module Backend
4
+ module Generators
5
+ class InstallGenerator < Rails::Generators::Base
6
+ desc 'Generates the intializer'
7
+
8
+ source_root File.expand_path('../templates', __FILE__)
9
+
10
+ def generate_initializer
11
+ copy_file 'initializer.rb', 'config/initializers/ecm_staff_backend.rb'
12
+ end
13
+
14
+ def generate_routes
15
+ route File.read(File.join(File.expand_path('../templates', __FILE__), 'routes.source'))
16
+ end
17
+
18
+ def add_to_itsf_backend
19
+ insert_into_itsf_backend_config(Ecm::Staff::Backend::Engine)
20
+ end
21
+
22
+ private
23
+
24
+ def insert_into_itsf_backend_config(engine_name)
25
+ inject_into_file 'config/initializers/001_itsf_backend.rb', after: "config.backend_engines = %w(\n" do
26
+ " #{engine_name}\n"
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,25 @@
1
+ Ecm::Staff::Backend.configure do |config|
2
+ # Set the resources, that will be shown in the backend menu.
3
+ #
4
+ # Default: config.registered_controllers = -> {[
5
+ # Ecm::Staff::Backend::OrganisationsController,
6
+ # Ecm::Staff::Backend::BusinessUnitsController,
7
+ # Ecm::Staff::Backend::PositionsController,
8
+ # Ecm::Staff::Backend::PeopleController
9
+ # ]}
10
+ #
11
+ config.registered_controllers = lambda {
12
+ [
13
+ Ecm::Staff::Backend::OrganisationsController,
14
+ Ecm::Staff::Backend::BusinessUnitsController,
15
+ Ecm::Staff::Backend::PositionsController,
16
+ Ecm::Staff::Backend::PeopleController
17
+ ]
18
+ }
19
+
20
+ # Set the services, that will be shown in the backend menu.
21
+ #
22
+ # Default: config.registered_services = -> {[]}
23
+ #
24
+ config.registered_services = -> { [] }
25
+ end
@@ -0,0 +1,4 @@
1
+
2
+ localized do
3
+ mount Ecm::Staff::Backend::Engine => '/backend/ecm/staff'
4
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :backend do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,102 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ecm_staff2_backend
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Roberto Vasquez Angel
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-10-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '4.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '4.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: itsf_backend
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Ecm::Staff::Backend Module.
42
+ email:
43
+ - roberto@vasquez-angel.de
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - MIT-LICENSE
49
+ - README.rdoc
50
+ - Rakefile
51
+ - app/assets/javascripts/ecm/staff/backend/application.js
52
+ - app/assets/javascripts/ecm_staff_backend.js
53
+ - app/assets/stylesheets/ecm/staff/backend/application.css
54
+ - app/assets/stylesheets/ecm_staff_backend.css
55
+ - app/controllers/ecm/staff/backend/application_controller.rb
56
+ - app/controllers/ecm/staff/backend/business_units_controller.rb
57
+ - app/controllers/ecm/staff/backend/home_controller.rb
58
+ - app/controllers/ecm/staff/backend/organisations_controller.rb
59
+ - app/controllers/ecm/staff/backend/people_controller.rb
60
+ - app/controllers/ecm/staff/backend/positions_controller.rb
61
+ - app/helpers/ecm/staff/backend/application_helper.rb
62
+ - app/policies/ecm/staff/backend/engine_policy.rb
63
+ - app/views/layouts/ecm/staff/backend/application.html.erb
64
+ - config/initializers/assets.rb
65
+ - config/locales/de.yml
66
+ - config/rbac.yml
67
+ - config/routes.rb
68
+ - lib/ecm/staff/backend.rb
69
+ - lib/ecm/staff/backend/configuration.rb
70
+ - lib/ecm/staff/backend/engine.rb
71
+ - lib/ecm/staff/backend/version.rb
72
+ - lib/ecm_staff2_backend.rb
73
+ - lib/generators/ecm/staff/backend/install/install_generator.rb
74
+ - lib/generators/ecm/staff/backend/install/templates/initializer.rb
75
+ - lib/generators/ecm/staff/backend/install/templates/routes.source
76
+ - lib/tasks/ecm/staff/backend_tasks.rake
77
+ homepage: https://github.com/robotex82/ecm_staff2_backend
78
+ licenses:
79
+ - MIT
80
+ metadata: {}
81
+ post_install_message:
82
+ rdoc_options: []
83
+ require_paths:
84
+ - lib
85
+ required_ruby_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ required_rubygems_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ requirements: []
96
+ rubyforge_project:
97
+ rubygems_version: 2.4.8
98
+ signing_key:
99
+ specification_version: 4
100
+ summary: Ecm::Staff::Backend.
101
+ test_files: []
102
+ has_rdoc: