ecm_comments_backend 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +18 -0
  5. data/app/assets/javascripts/ecm/comments/backend/application.js +1 -0
  6. data/app/assets/javascripts/ecm/comments/backend/application/dummy.js +0 -0
  7. data/app/assets/javascripts/ecm_comments_backend.js +1 -0
  8. data/app/assets/stylesheets/ecm/comments/backend/application.css +3 -0
  9. data/app/assets/stylesheets/ecm/comments/backend/application/dummy.css +0 -0
  10. data/app/assets/stylesheets/ecm_comments_backend.css +3 -0
  11. data/app/controllers/ecm/comments/backend/comments_controller.rb +34 -0
  12. data/app/controllers/ecm/comments/backend/home_controller.rb +8 -0
  13. data/app/helpers/ecm/comments/backend/application_helper.rb +8 -0
  14. data/app/policies/ecm/comments/backend/engine_policy.rb +4 -0
  15. data/app/policies/ecm/comments/comment_policy.rb +4 -0
  16. data/app/views/ecm/comments/backend/comments/_form.haml +6 -0
  17. data/app/views/ecm/comments/backend/comments/_search.haml +0 -0
  18. data/app/views/ecm/comments/backend/comments/_table.haml +10 -0
  19. data/app/views/layouts/ecm/comments/backend/application.html.erb +14 -0
  20. data/config/initializers/assets.rb +2 -0
  21. data/config/locales/de.yml +5 -0
  22. data/config/locales/en.yml +5 -0
  23. data/config/routes.rb +5 -0
  24. data/lib/ecm/comments/backend.rb +9 -0
  25. data/lib/ecm/comments/backend/configuration.rb +28 -0
  26. data/lib/ecm/comments/backend/engine.rb +13 -0
  27. data/lib/ecm/comments/backend/version.rb +7 -0
  28. data/lib/ecm_comments_backend.rb +2 -0
  29. data/lib/generators/ecm/comments/backend/install/install_generator.rb +33 -0
  30. data/lib/generators/ecm/comments/backend/install/templates/initializer.rb +19 -0
  31. data/lib/generators/ecm/comments/backend/install/templates/routes.source +4 -0
  32. data/lib/tasks/ecm/comments/backend_tasks.rake +4 -0
  33. metadata +89 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 307fa5766d99c0b8a5d5adb06af332ce9743e877
4
+ data.tar.gz: 690cc613a17d80bc288ae4207bbce85493d89ae7
5
+ SHA512:
6
+ metadata.gz: eb981463b771ebe90537116117025b0c98f0af9a1aea924dfd05f4ac82706dbff452d089f77903c503623699ba4b6a6395f8f7c27664fb966398992a538124a2
7
+ data.tar.gz: 41b70097c1e3e50930930510ba4fa93a3278723c48261488212e950bab0195615b3dd0d5fc1e2324069fb19834a4ad96644c3f565c626bd1ae154ccfc7951da5
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::Comments::Backend
2
+
3
+ This project rocks and uses MIT-LICENSE.
data/Rakefile ADDED
@@ -0,0 +1,18 @@
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::Comments::Backend'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+
18
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1 @@
1
+ //= require_tree ./application
@@ -0,0 +1 @@
1
+ //= require ecm/comments/backend/application
@@ -0,0 +1,3 @@
1
+ /*
2
+ *= require_tree ./application
3
+ */
@@ -0,0 +1,3 @@
1
+ /*
2
+ *= require ecm/comments/backend/application
3
+ */
@@ -0,0 +1,34 @@
1
+ module Ecm
2
+ module Comments
3
+ module Backend
4
+ class CommentsController < Itsf::Backend::Resource::BaseController
5
+ def self.resource_class
6
+ Ecm::Comments::Comment
7
+ end
8
+
9
+ def create
10
+ @resource = initialize_scope.new(permitted_params)
11
+ @resource.creator = current_user
12
+ @resource.created_by_ip_address = request.remote_ip
13
+ @resource.save
14
+ respond_with @resource, location: after_create_location
15
+ end
16
+
17
+ def update
18
+ @resource = load_resource
19
+ @resource.updater = current_user
20
+ @resource.updated_by_ip_address = request.remote_ip
21
+ @resource.update(permitted_params)
22
+ respond_with @resource, location: after_update_location
23
+ end
24
+
25
+ private
26
+
27
+ def permitted_params
28
+ params.require(:comment).permit(:commentable_type, :commentable_id, :homepage, :name, :email, :body)
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+
@@ -0,0 +1,8 @@
1
+ module Ecm
2
+ module Comments
3
+ module Backend
4
+ class HomeController < Itsf::Backend::HomeController
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Ecm
2
+ module Comments
3
+ module Backend
4
+ module ApplicationHelper
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,4 @@
1
+ module Ecm::Comments::Backend
2
+ class EnginePolicy < Itsf::Backend::EnginePolicy
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module Ecm::Comments
2
+ class CommentPolicy < Itsf::Backend::BasePolicy
3
+ end
4
+ end
@@ -0,0 +1,6 @@
1
+ = form.input :commentable_type
2
+ = form.input :commentable_id
3
+ = form.input :name
4
+ = form.input :homepage
5
+ = form.input :email
6
+ = form.input :body
@@ -0,0 +1,10 @@
1
+ = table.column :commentable_type, sortable: true
2
+ = table.column :commentable_id, sortable: true
3
+ = table.column :homepage, sortable: true
4
+ = table.column :name, sortable: true
5
+ = table.column :email, sortable: true
6
+ = table.column :created_by_ip_address, sortable: true
7
+ = table.column :updated_by_ip_address, sortable: true
8
+ = table.column :body, sortable: true, class: 'truncate-chars truncate-chars-30'
9
+ = table.userstamps
10
+ = table.timestamps
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Backend</title>
5
+ <%= stylesheet_link_tag "ecm/comments/backend/application", media: "all" %>
6
+ <%= javascript_include_tag "ecm/comments/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_comments_backend.css )
2
+ Rails.application.config.assets.precompile += %w( ecm_comments_backend.js )
@@ -0,0 +1,5 @@
1
+ de:
2
+ classes:
3
+ ecm/comments/backend/engine: Kommentare
4
+ routes:
5
+ ecm-comments-backend-engine: 'kommentare'
@@ -0,0 +1,5 @@
1
+ en:
2
+ classes:
3
+ ecm/comments/backend/engine: Comments
4
+ routes:
5
+ ecm-comments-backend-engine: 'comments'
data/config/routes.rb ADDED
@@ -0,0 +1,5 @@
1
+ Ecm::Comments::Backend::Engine.routes.draw do
2
+ resources :comments
3
+
4
+ root to: 'home#index'
5
+ end
@@ -0,0 +1,9 @@
1
+ require 'ecm/comments/backend/configuration'
2
+
3
+ module Ecm
4
+ module Comments
5
+ module Backend
6
+ extend Configuration
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,28 @@
1
+ require 'active_support/core_ext/module/delegation'
2
+ require 'active_support/core_ext/module/attribute_accessors'
3
+
4
+ module Ecm
5
+ module Comments
6
+ module Backend
7
+ module Configuration
8
+ def configure
9
+ yield self
10
+ end
11
+
12
+ mattr_accessor :registered_controllers do
13
+ lambda do
14
+ [
15
+ Ecm::Comments::Backend::CommentsController
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,13 @@
1
+ module Ecm
2
+ module Comments
3
+ module Backend
4
+ class Engine < ::Rails::Engine
5
+ isolate_namespace Ecm::Comments::Backend
6
+ end
7
+
8
+ end
9
+ end
10
+ end
11
+
12
+
13
+
@@ -0,0 +1,7 @@
1
+ module Ecm
2
+ module Comments
3
+ module Backend
4
+ VERSION = "0.0.1"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,2 @@
1
+ require "ecm/comments/backend"
2
+ require "ecm/comments/backend/engine"
@@ -0,0 +1,33 @@
1
+ module Ecm
2
+ module Comments
3
+ module Backend
4
+ module Generators
5
+ class InstallGenerator < Rails::Generators::Base
6
+ desc 'Installs the initializer, routes and itsf_backend integration'
7
+
8
+ source_root File.expand_path('../templates', __FILE__)
9
+
10
+ def generate_initializer
11
+ copy_file 'initializer.rb', 'config/initializers/ecm_comments_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::Comments::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,19 @@
1
+ Ecm::Comments::Backend.configure do |config|
2
+ # Set the resources, that will be shown in the backend menu.
3
+ #
4
+ # Default: config.registered_controllers = -> {[
5
+ # Ecm::Comments::Backend::CommentsController
6
+ # ]}
7
+ #
8
+ config.registered_controllers = -> {[
9
+ Ecm::Comments::Backend::CommentsController
10
+ ]}
11
+
12
+ # Set the services, that will be shown in the backend menu.
13
+ #
14
+ # Default: config.registered_services = -> {[
15
+ # ]}
16
+ #
17
+ config.registered_services = -> {[
18
+ ]}
19
+ end
@@ -0,0 +1,4 @@
1
+
2
+ localized do
3
+ mount Ecm::Comments::Backend::Engine, at: '/backend/ecm-comments-backend-engine'
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,89 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ecm_comments_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: 2017-10-31 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: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: Ecm::Comments::Backend Module.
28
+ email:
29
+ - roberto@vasquez-angel.de
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - MIT-LICENSE
35
+ - README.rdoc
36
+ - Rakefile
37
+ - app/assets/javascripts/ecm/comments/backend/application.js
38
+ - app/assets/javascripts/ecm/comments/backend/application/dummy.js
39
+ - app/assets/javascripts/ecm_comments_backend.js
40
+ - app/assets/stylesheets/ecm/comments/backend/application.css
41
+ - app/assets/stylesheets/ecm/comments/backend/application/dummy.css
42
+ - app/assets/stylesheets/ecm_comments_backend.css
43
+ - app/controllers/ecm/comments/backend/comments_controller.rb
44
+ - app/controllers/ecm/comments/backend/home_controller.rb
45
+ - app/helpers/ecm/comments/backend/application_helper.rb
46
+ - app/policies/ecm/comments/backend/engine_policy.rb
47
+ - app/policies/ecm/comments/comment_policy.rb
48
+ - app/views/ecm/comments/backend/comments/_form.haml
49
+ - app/views/ecm/comments/backend/comments/_search.haml
50
+ - app/views/ecm/comments/backend/comments/_table.haml
51
+ - app/views/layouts/ecm/comments/backend/application.html.erb
52
+ - config/initializers/assets.rb
53
+ - config/locales/de.yml
54
+ - config/locales/en.yml
55
+ - config/routes.rb
56
+ - lib/ecm/comments/backend.rb
57
+ - lib/ecm/comments/backend/configuration.rb
58
+ - lib/ecm/comments/backend/engine.rb
59
+ - lib/ecm/comments/backend/version.rb
60
+ - lib/ecm_comments_backend.rb
61
+ - lib/generators/ecm/comments/backend/install/install_generator.rb
62
+ - lib/generators/ecm/comments/backend/install/templates/initializer.rb
63
+ - lib/generators/ecm/comments/backend/install/templates/routes.source
64
+ - lib/tasks/ecm/comments/backend_tasks.rake
65
+ homepage: https://github.com/robotex82/ecm_comments_backend
66
+ licenses:
67
+ - MIT
68
+ metadata: {}
69
+ post_install_message:
70
+ rdoc_options: []
71
+ require_paths:
72
+ - lib
73
+ required_ruby_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ requirements: []
84
+ rubyforge_project:
85
+ rubygems_version: 2.6.11
86
+ signing_key:
87
+ specification_version: 4
88
+ summary: Ecm::Comments::Backend.
89
+ test_files: []