ecm_blog_backend 0.0.2

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/blog/backend/application/dummy.js +0 -0
  6. data/app/assets/javascripts/ecm/blog/backend/application.js +1 -0
  7. data/app/assets/javascripts/ecm_blog_backend.js +1 -0
  8. data/app/assets/stylesheets/ecm/blog/backend/application/dummy.css +0 -0
  9. data/app/assets/stylesheets/ecm/blog/backend/application.css +3 -0
  10. data/app/assets/stylesheets/ecm_blog_backend.css +3 -0
  11. data/app/controllers/ecm/blog/backend/home_controller.rb +8 -0
  12. data/app/controllers/ecm/blog/backend/posts_controller.rb +29 -0
  13. data/app/helpers/ecm/blog/backend/application_helper.rb +8 -0
  14. data/app/policies/ecm/blog/backend/engine_policy.rb +4 -0
  15. data/app/policies/ecm/blog/post_policy.rb +4 -0
  16. data/app/views/ecm/blog/backend/posts/_form.haml +5 -0
  17. data/app/views/ecm/blog/backend/posts/_show.haml +9 -0
  18. data/app/views/ecm/blog/backend/posts/_table.haml +5 -0
  19. data/app/views/layouts/ecm/blog/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 +7 -0
  24. data/lib/ecm/blog/backend/configuration.rb +30 -0
  25. data/lib/ecm/blog/backend/engine.rb +13 -0
  26. data/lib/ecm/blog/backend/version.rb +7 -0
  27. data/lib/ecm/blog/backend.rb +8 -0
  28. data/lib/ecm_blog_backend.rb +2 -0
  29. data/lib/generators/ecm/blog/backend/install/install_generator.rb +33 -0
  30. data/lib/generators/ecm/blog/backend/install/templates/initializer.rb +19 -0
  31. data/lib/generators/ecm/blog/backend/install/templates/routes.source +4 -0
  32. data/lib/tasks/ecm/blog/backend_tasks.rake +4 -0
  33. metadata +89 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0ce66768ab5c0a1e84587e5beb9560e88a9ff648
4
+ data.tar.gz: da7c952830aa6119c7334006f1862ab3aa2056d0
5
+ SHA512:
6
+ metadata.gz: 88c3b42073ec79d27b9d6dfe946716dd972f6d8906ec67f1a282fee0c5030f07cf8f3afc7504cb93fe22cc519f8afa41945f554fa981f13d0964f2b8b01230aa
7
+ data.tar.gz: 044b78ff3b9df562a10169c3bb20bc8fdf46914873b4317e24563474f193b6df5ec2f304a2d9b3f37c5560765f79014ca8673a2eadb8166854af1123eb135fe6
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::Blog::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::Blog::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/blog/backend/application
@@ -0,0 +1,3 @@
1
+ /*
2
+ *= require_tree ./application
3
+ */
@@ -0,0 +1,3 @@
1
+ /*
2
+ *= require ecm/blog/backend/application
3
+ */
@@ -0,0 +1,8 @@
1
+ module Ecm
2
+ module Blog
3
+ module Backend
4
+ class HomeController < Itsf::Backend::HomeController
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,29 @@
1
+ module Ecm
2
+ module Blog
3
+ module Backend
4
+ class PostsController < Itsf::Backend::Resource::BaseController
5
+ include Controller::ActsAsPublishedConcern
6
+
7
+ helper Ecm::Tags::Backend::ApplicationHelper
8
+
9
+ def self.resource_class
10
+ Ecm::Blog::Post
11
+ end
12
+
13
+ private
14
+
15
+ def collection_scope
16
+ super.friendly.order(updated_at: :desc)
17
+ end
18
+
19
+ def load_scope
20
+ super.friendly
21
+ end
22
+
23
+ def permitted_params
24
+ params.require(:post).permit(:created_by_id, :title, :body, :published, :tag_list)
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,8 @@
1
+ module Ecm
2
+ module Blog
3
+ module Backend
4
+ module ApplicationHelper
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,4 @@
1
+ module Ecm::Blog::Backend
2
+ class EnginePolicy < Itsf::Backend::EnginePolicy
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module Ecm::Blog
2
+ class PostPolicy < Itsf::Backend::BasePolicy
3
+ end
4
+ end
@@ -0,0 +1,5 @@
1
+ = form.association :creator, collection: Ecm::Blog.creator_class_name.constantize.all, label_method: Ecm::Blog::Backend.creator_label_method
2
+ = form.input :title
3
+ = form.input :body, input_html: { 'data-add-editor': Itsf::Backend.features?(:'ace-rails-ap') } #, 'data-editor-syntax': form.object.handler }
4
+ = form.input :published, as: :boolean
5
+ = form.input :tag_list
@@ -0,0 +1,9 @@
1
+ = table.row :title
2
+ = table.row(:tags) do |resource|
3
+ = tag_labels_for(resource)
4
+ = table.row :body
5
+ = table.row :published_at
6
+ = table.row :creator, as: :association
7
+ = table.row :updater, as: :association
8
+ = table.row :created_at
9
+ = table.row :updated_at
@@ -0,0 +1,5 @@
1
+ = table.column :title, sortable: true
2
+ = table.column :body, sortable: true
3
+ = table.userstamps
4
+ = table.timestamps
5
+ = table.acts_as_published_actions
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Backend</title>
5
+ <%= stylesheet_link_tag "ecm/blog/backend/application", media: "all" %>
6
+ <%= javascript_include_tag "ecm/blog/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_blog_backend.css )
2
+ Rails.application.config.assets.precompile += %w( ecm_blog_backend.js )
@@ -0,0 +1,5 @@
1
+ de:
2
+ classes:
3
+ ecm/blog/backend/engine: Blog
4
+ routes:
5
+ ecm-blog-backend-engine: 'blog'
@@ -0,0 +1,5 @@
1
+ en:
2
+ classes:
3
+ ecm/blog/backend/engine: Blog
4
+ routes:
5
+ ecm-blog-backend-engine: 'blog'
data/config/routes.rb ADDED
@@ -0,0 +1,7 @@
1
+ Ecm::Blog::Backend::Engine.routes.draw do
2
+ resources :posts do
3
+ post :toggle_published, on: :member
4
+ end
5
+
6
+ root to: 'home#index'
7
+ end
@@ -0,0 +1,30 @@
1
+ require 'active_support/core_ext/module/delegation'
2
+ require 'active_support/core_ext/module/attribute_accessors'
3
+
4
+ module Ecm
5
+ module Blog
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::Blog::Backend::PostsController
16
+ ]
17
+ end
18
+ end
19
+
20
+ mattr_accessor :registered_services do
21
+ lambda do
22
+ []
23
+ end
24
+ end
25
+
26
+ mattr_accessor(:creator_label_method) { :to_s }
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,13 @@
1
+ module Ecm
2
+ module Blog
3
+ module Backend
4
+ class Engine < ::Rails::Engine
5
+ isolate_namespace Ecm::Blog::Backend
6
+ end
7
+
8
+ end
9
+ end
10
+ end
11
+
12
+
13
+
@@ -0,0 +1,7 @@
1
+ module Ecm
2
+ module Blog
3
+ module Backend
4
+ VERSION = "0.0.2"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,8 @@
1
+ require 'ecm/blog/backend/configuration'
2
+ module Ecm
3
+ module Blog
4
+ module Backend
5
+ extend Configuration
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,2 @@
1
+ require "ecm/blog/backend"
2
+ require "ecm/blog/backend/engine"
@@ -0,0 +1,33 @@
1
+ module Ecm
2
+ module Blog
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_blog_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::Blog::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::Blog::Backend.configure do |config|
2
+ # Set the resources, that will be shown in the backend menu.
3
+ #
4
+ # Default: config.registered_controllers = -> {[
5
+ # Ecm::Blog::Backend::PostsController
6
+ # ]}
7
+ #
8
+ config.registered_controllers = -> {[
9
+ Ecm::Blog::Backend::PostsController
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::Blog::Backend::Engine, at: '/backend/ecm-blog-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_blog_backend
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
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::Blog::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/blog/backend/application.js
38
+ - app/assets/javascripts/ecm/blog/backend/application/dummy.js
39
+ - app/assets/javascripts/ecm_blog_backend.js
40
+ - app/assets/stylesheets/ecm/blog/backend/application.css
41
+ - app/assets/stylesheets/ecm/blog/backend/application/dummy.css
42
+ - app/assets/stylesheets/ecm_blog_backend.css
43
+ - app/controllers/ecm/blog/backend/home_controller.rb
44
+ - app/controllers/ecm/blog/backend/posts_controller.rb
45
+ - app/helpers/ecm/blog/backend/application_helper.rb
46
+ - app/policies/ecm/blog/backend/engine_policy.rb
47
+ - app/policies/ecm/blog/post_policy.rb
48
+ - app/views/ecm/blog/backend/posts/_form.haml
49
+ - app/views/ecm/blog/backend/posts/_show.haml
50
+ - app/views/ecm/blog/backend/posts/_table.haml
51
+ - app/views/layouts/ecm/blog/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/blog/backend.rb
57
+ - lib/ecm/blog/backend/configuration.rb
58
+ - lib/ecm/blog/backend/engine.rb
59
+ - lib/ecm/blog/backend/version.rb
60
+ - lib/ecm_blog_backend.rb
61
+ - lib/generators/ecm/blog/backend/install/install_generator.rb
62
+ - lib/generators/ecm/blog/backend/install/templates/initializer.rb
63
+ - lib/generators/ecm/blog/backend/install/templates/routes.source
64
+ - lib/tasks/ecm/blog/backend_tasks.rake
65
+ homepage: https://github.com/robotex82/ecm_blog_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::Blog::Backend.
89
+ test_files: []