ecm_courses2_backend 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) 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/courses/backend/application.js +13 -0
  6. data/app/assets/javascripts/ecm_courses_backend.js +1 -0
  7. data/app/assets/stylesheets/ecm/courses/backend/application.css +14 -0
  8. data/app/assets/stylesheets/ecm_courses_backend.css +3 -0
  9. data/app/controllers/ecm/courses/backend/course_categories_controller.rb +17 -0
  10. data/app/controllers/ecm/courses/backend/course_dates_controller.rb +11 -0
  11. data/app/controllers/ecm/courses/backend/courses_controller.rb +17 -0
  12. data/app/controllers/ecm/courses/backend/home_controller.rb +6 -0
  13. data/app/helpers/ecm/courses/backend/application_helper.rb +8 -0
  14. data/app/policies/ecm/courses/backend/engine_policy.rb +4 -0
  15. data/app/views/layouts/ecm/courses/backend/application.html.erb +14 -0
  16. data/config/initializers/assets.rb +2 -0
  17. data/config/locales/de.yml +6 -0
  18. data/config/rbac.yml +56 -0
  19. data/config/routes.rb +7 -0
  20. data/lib/ecm/courses/backend.rb +9 -0
  21. data/lib/ecm/courses/backend/configuration.rb +27 -0
  22. data/lib/ecm/courses/backend/engine.rb +9 -0
  23. data/lib/ecm/courses/backend/version.rb +7 -0
  24. data/lib/ecm_courses2_backend.rb +4 -0
  25. data/lib/generators/ecm/courses/backend/install/install_generator.rb +33 -0
  26. data/lib/generators/ecm/courses/backend/install/templates/initializer.rb +23 -0
  27. data/lib/generators/ecm/courses/backend/install/templates/routes.source +4 -0
  28. data/lib/tasks/ecm/courses/backend_tasks.rake +4 -0
  29. metadata +100 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4c6d029583981a7b82fbd970ffb4ab42ff2dd5b5
4
+ data.tar.gz: 9650a79786c150e31054c27de79a49c08a1eb61b
5
+ SHA512:
6
+ metadata.gz: ba54e3297c7a67f4293eaa1c6f956363ae3ba059eae0a4b0dfe92747fe5f7aff167c10eee9f5847be40e91b5e30c48e0a00cf6977dde034ca3a98866cf76a820
7
+ data.tar.gz: bfb92631531787fd3630b60a97c4f3ef501b34a123fe214f7e79a5291ae7a66c5c7485b38450e605180fb1e058bdc152c0c5cb68f48e47dd39e7ce893ef8c11a
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::Courses::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::Courses::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/courses/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/courses/backend/application.css
3
+ */
@@ -0,0 +1,17 @@
1
+ module Ecm
2
+ module Courses
3
+ module Backend
4
+ class CourseCategoriesController < Itsf::Backend::Resource::BaseController
5
+ def self.resource_class
6
+ Ecm::Courses::CourseCategory
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,11 @@
1
+ module Ecm
2
+ module Courses
3
+ module Backend
4
+ class CourseDatesController < Itsf::Backend::Resource::BaseController
5
+ def self.resource_class
6
+ Ecm::Courses::CourseDate
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,17 @@
1
+ module Ecm
2
+ module Courses
3
+ module Backend
4
+ class CoursesController < Itsf::Backend::Resource::BaseController
5
+ def self.resource_class
6
+ Ecm::Courses::Course
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::Courses::Backend
2
+ class HomeController < Itsf::Backend::HomeController
3
+ def index
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,8 @@
1
+ module Ecm
2
+ module Courses
3
+ module Backend
4
+ module ApplicationHelper
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,4 @@
1
+ module Ecm::Courses::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/courses/backend/application", media: "all" %>
6
+ <%= javascript_include_tag "ecm/courses/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_courses_backend.css )
2
+ Rails.application.config.assets.precompile += %w( ecm_courses_backend.js )
@@ -0,0 +1,6 @@
1
+ de:
2
+ classes:
3
+ ecm/courses/backend/engine: 'Kurse'
4
+ routes:
5
+ mount:
6
+ ecm_courses_backend: '/backend/courses'
data/config/rbac.yml ADDED
@@ -0,0 +1,56 @@
1
+ defaults:
2
+ permissions:
3
+ - ecm/courses/backend/engine
4
+ - ecm/courses/course/index
5
+ - ecm/courses/course/show
6
+ - ecm/courses/course/new
7
+ - ecm/courses/course/create
8
+ - ecm/courses/course/edit
9
+ - ecm/courses/course/update
10
+ - ecm/courses/course/destroy
11
+ - ecm/courses/course_category/index
12
+ - ecm/courses/course_category/show
13
+ - ecm/courses/course_category/new
14
+ - ecm/courses/course_category/create
15
+ - ecm/courses/course_category/edit
16
+ - ecm/courses/course_category/update
17
+ - ecm/courses/course_category/destroy
18
+ - ecm/courses/course_date/index
19
+ - ecm/courses/course_date/show
20
+ - ecm/courses/course_date/new
21
+ - ecm/courses/course_date/create
22
+ - ecm/courses/course_date/edit
23
+ - ecm/courses/course_date/update
24
+ - ecm/courses/course_date/destroy
25
+ roles:
26
+ ecm/courses/administrator:
27
+ - ecm/courses/backend/engine
28
+ - ecm/courses/course/index
29
+ - ecm/courses/course/show
30
+ - ecm/courses/course/new
31
+ - ecm/courses/course/create
32
+ - ecm/courses/course/edit
33
+ - ecm/courses/course/update
34
+ - ecm/courses/course/destroy
35
+ - ecm/courses/course_category/index
36
+ - ecm/courses/course_category/show
37
+ - ecm/courses/course_category/new
38
+ - ecm/courses/course_category/create
39
+ - ecm/courses/course_category/edit
40
+ - ecm/courses/course_category/update
41
+ - ecm/courses/course_category/destroy
42
+ - ecm/courses/course_date/index
43
+ - ecm/courses/course_date/show
44
+ - ecm/courses/course_date/new
45
+ - ecm/courses/course_date/create
46
+ - ecm/courses/course_date/edit
47
+ - ecm/courses/course_date/update
48
+ - ecm/courses/course_date/destroy
49
+ ecm/courses/reviewer:
50
+ - ecm/courses/backend/engine
51
+ - ecm/courses/course/index
52
+ - ecm/courses/course/show
53
+ - ecm/courses/course_category/index
54
+ - ecm/courses/course_category/show
55
+ - ecm/courses/course_date/index
56
+ - ecm/courses/course_date/show
data/config/routes.rb ADDED
@@ -0,0 +1,7 @@
1
+ Ecm::Courses::Backend::Engine.routes.draw do
2
+ resources :course_categories
3
+ resources :courses
4
+ resources :course_dates
5
+
6
+ root to: 'home#index'
7
+ end
@@ -0,0 +1,9 @@
1
+ require 'ecm/courses/backend/configuration'
2
+
3
+ module Ecm
4
+ module Courses
5
+ module Backend
6
+ extend Configuration
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,27 @@
1
+ module Ecm
2
+ module Courses
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::CourseCategoriesController,
13
+ Ecm::Staff::Backend::CoursesController,
14
+ Ecm::Staff::Backend::CourseDatesController
15
+ ]
16
+ end
17
+ end
18
+
19
+ mattr_accessor(:registered_services) do
20
+ lambda do
21
+ []
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,9 @@
1
+ module Ecm
2
+ module Courses
3
+ module Backend
4
+ class Engine < ::Rails::Engine
5
+ isolate_namespace Ecm::Courses::Backend
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,7 @@
1
+ module Ecm
2
+ module Courses
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/courses/backend'
4
+ require 'ecm/courses/backend/engine'
@@ -0,0 +1,33 @@
1
+ module Ecm
2
+ module Courses
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_courses_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::Courses::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,23 @@
1
+ Ecm::Courses::Backend.configure do |config|
2
+ # Set the resources, that will be shown in the backend menu.
3
+ #
4
+ # Default: config.registered_controllers = -> {[
5
+ # Ecm::Courses::Backend::CourseCategoriesController,
6
+ # Ecm::Courses::Backend::CoursesController,
7
+ # Ecm::Courses::Backend::CourseDatesController
8
+ # ]}
9
+ #
10
+ config.registered_controllers = lambda {
11
+ [
12
+ Ecm::Courses::Backend::CourseCategoriesController,
13
+ Ecm::Courses::Backend::CoursesController,
14
+ Ecm::Courses::Backend::CourseDatesController
15
+ ]
16
+ }
17
+
18
+ # Set the services, that will be shown in the backend menu.
19
+ #
20
+ # Default: config.registered_services = -> {[]}
21
+ #
22
+ config.registered_services = -> { [] }
23
+ end
@@ -0,0 +1,4 @@
1
+
2
+ localized do
3
+ mount Ecm::Courses::Backend::Engine => '/backend/ecm/courses'
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,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ecm_courses2_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::Courses::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/courses/backend/application.js
52
+ - app/assets/javascripts/ecm_courses_backend.js
53
+ - app/assets/stylesheets/ecm/courses/backend/application.css
54
+ - app/assets/stylesheets/ecm_courses_backend.css
55
+ - app/controllers/ecm/courses/backend/course_categories_controller.rb
56
+ - app/controllers/ecm/courses/backend/course_dates_controller.rb
57
+ - app/controllers/ecm/courses/backend/courses_controller.rb
58
+ - app/controllers/ecm/courses/backend/home_controller.rb
59
+ - app/helpers/ecm/courses/backend/application_helper.rb
60
+ - app/policies/ecm/courses/backend/engine_policy.rb
61
+ - app/views/layouts/ecm/courses/backend/application.html.erb
62
+ - config/initializers/assets.rb
63
+ - config/locales/de.yml
64
+ - config/rbac.yml
65
+ - config/routes.rb
66
+ - lib/ecm/courses/backend.rb
67
+ - lib/ecm/courses/backend/configuration.rb
68
+ - lib/ecm/courses/backend/engine.rb
69
+ - lib/ecm/courses/backend/version.rb
70
+ - lib/ecm_courses2_backend.rb
71
+ - lib/generators/ecm/courses/backend/install/install_generator.rb
72
+ - lib/generators/ecm/courses/backend/install/templates/initializer.rb
73
+ - lib/generators/ecm/courses/backend/install/templates/routes.source
74
+ - lib/tasks/ecm/courses/backend_tasks.rake
75
+ homepage: https://github.com/robotex82/ecm_courses2_backend
76
+ licenses:
77
+ - MIT
78
+ metadata: {}
79
+ post_install_message:
80
+ rdoc_options: []
81
+ require_paths:
82
+ - lib
83
+ required_ruby_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ required_rubygems_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ requirements: []
94
+ rubyforge_project:
95
+ rubygems_version: 2.4.8
96
+ signing_key:
97
+ specification_version: 4
98
+ summary: Ecm::Courses::Backend.
99
+ test_files: []
100
+ has_rdoc: