ecm_videos_backend 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) 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/videos/backend/application.js +1 -0
  6. data/app/assets/javascripts/ecm_videos_backend.js +1 -0
  7. data/app/assets/stylesheets/ecm/videos/backend/application/dummy.css +0 -0
  8. data/app/assets/stylesheets/ecm/videos/backend/application.css +3 -0
  9. data/app/assets/stylesheets/ecm_videos_backend.css +3 -0
  10. data/app/controllers/ecm/videos/backend/application_controller.rb +8 -0
  11. data/app/controllers/ecm/videos/backend/categories_controller.rb +19 -0
  12. data/app/controllers/ecm/videos/backend/home_controller.rb +8 -0
  13. data/app/controllers/ecm/videos/backend/videos_controller.rb +20 -0
  14. data/app/helpers/ecm/videos/backend/application_helper.rb +8 -0
  15. data/app/policies/ecm/videos/backend/engine_policy.rb +4 -0
  16. data/app/policies/ecm/videos/category_policy.rb +4 -0
  17. data/app/policies/ecm/videos/video_policy.rb +4 -0
  18. data/app/views/ecm/videos/backend/categories/_form.haml +10 -0
  19. data/app/views/ecm/videos/backend/categories/_table.haml +7 -0
  20. data/app/views/ecm/videos/backend/videos/_form.haml +13 -0
  21. data/app/views/ecm/videos/backend/videos/_head_extras.html.erb +5 -0
  22. data/app/views/ecm/videos/backend/videos/_show.haml +13 -0
  23. data/app/views/ecm/videos/backend/videos/_show_extras.haml +4 -0
  24. data/app/views/ecm/videos/backend/videos/_table.haml +7 -0
  25. data/app/views/layouts/ecm/videos/backend/application.html.erb +14 -0
  26. data/config/initializers/assets.rb +2 -0
  27. data/config/locales/de.yml +3 -0
  28. data/config/routes.rb +12 -0
  29. data/lib/ecm/videos/backend/configuration.rb +27 -0
  30. data/lib/ecm/videos/backend/engine.rb +9 -0
  31. data/lib/ecm/videos/backend/version.rb +7 -0
  32. data/lib/ecm/videos/backend.rb +9 -0
  33. data/lib/ecm_videos_backend.rb +2 -0
  34. data/lib/generators/ecm/videos/backend/install/install_generator.rb +33 -0
  35. data/lib/generators/ecm/videos/backend/install/templates/initializer.rb +21 -0
  36. data/lib/generators/ecm/videos/backend/install/templates/routes.source +4 -0
  37. data/lib/tasks/ecm/videos/backend_tasks.rake +4 -0
  38. metadata +95 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1c0d557dd76c4ccd7459d87c4d62e520422e34fe
4
+ data.tar.gz: bff06354cc770431f2f0ed766c6e550e0b5bb662
5
+ SHA512:
6
+ metadata.gz: 611cdf97b8ba788744b35687461b0cb1de843ea561e5e37b79df9df8ffad6a27d47be164b2442eb0b87ffedb2849598afd7b124f9047b9cee423c94f62efd52f
7
+ data.tar.gz: dec2f9b7d5cd2dd1d1672fcf633306215e514dc644379350c0048ff316f3ef101f315fb57443ac8b0c3dae7d090112f968b69d58c6747def1001ee38cd5be58b
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::Videos::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::Videos::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 @@
1
+ //= require_tree ./application
@@ -0,0 +1 @@
1
+ //= require ecm/videos/backend/application
@@ -0,0 +1,3 @@
1
+ /*
2
+ *= require_tree ./application
3
+ */
@@ -0,0 +1,3 @@
1
+ /*
2
+ *= require ecm/videos/backend/application
3
+ */
@@ -0,0 +1,8 @@
1
+ module Ecm
2
+ module Videos
3
+ module Backend
4
+ class ApplicationController < ActionController::Base
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,19 @@
1
+ module Ecm
2
+ module Videos
3
+ module Backend
4
+ class CategoriesController < Itsf::Backend::Resource::BaseController
5
+ include Controller::ActsAsPublishedConcern
6
+
7
+ def self.resource_class
8
+ Ecm::Videos::Category
9
+ end
10
+
11
+ private
12
+
13
+ def permitted_params
14
+ params.require(:category).permit(*%w(description locale name markup_language published))
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,8 @@
1
+ module Ecm
2
+ module Videos
3
+ module Backend
4
+ class HomeController < Itsf::Backend::HomeController
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,20 @@
1
+ module Ecm
2
+ module Videos
3
+ module Backend
4
+ class VideosController < Itsf::Backend::Resource::BaseController
5
+ include Controller::ActsAsListConcern
6
+ include Controller::ActsAsPublishedConcern
7
+
8
+ def self.resource_class
9
+ Ecm::Videos::Video
10
+ end
11
+
12
+ private
13
+
14
+ def permitted_params
15
+ params.require(:video).permit(*%w(category_id clip description name markup_language published))
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,8 @@
1
+ module Ecm
2
+ module Videos
3
+ module Backend
4
+ module ApplicationHelper
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,4 @@
1
+ module Ecm::Videos::Backend
2
+ class EnginePolicy < Itsf::Backend::EnginePolicy
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module Ecm::Videos
2
+ class CategoryPolicy < Itsf::Backend::BasePolicy
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module Ecm::Videos
2
+ class VideoPolicy < Itsf::Backend::BasePolicy
3
+ end
4
+ end
@@ -0,0 +1,10 @@
1
+ .well
2
+ = form.input :locale, as: :select, collection: I18n.available_locales
3
+ = form.input :name
4
+
5
+ .well
6
+ = form.input :markup_language, collection: Ecm::Videos::Configuration.markup_languages, include_blank: false
7
+ = form.input :description, input_html: { 'data-add-editor': true, 'data-editor-syntax': form.object.markup_language }
8
+
9
+ .well
10
+ = form.input :published, as: :boolean
@@ -0,0 +1,7 @@
1
+ = table.column :preview_image, as: :thumbnail, style: :default_thumb, link_to_url: Proc.new { |resource| url_for(resource) }
2
+ = table.column :locale
3
+ = table.column :name
4
+ = table.column :videos_count
5
+ = table.column :description
6
+ = table.timestamps
7
+ = table.acts_as_published_actions
@@ -0,0 +1,13 @@
1
+ .well
2
+ = form.association :category
3
+
4
+ .well
5
+ = form.input :name
6
+ = form.input :clip
7
+
8
+ .well
9
+ = form.input :markup_language, collection: Ecm::Videos::Configuration.markup_languages, include_blank: false
10
+ = form.input :description, input_html: { 'data-add-editor': true, 'data-editor-syntax': form.object.markup_language }
11
+
12
+ .well
13
+ = form.input :published, as: :boolean
@@ -0,0 +1,5 @@
1
+ <link href="http://vjs.zencdn.net/5.6.0/video-js.css" rel="stylesheet">
2
+
3
+ <!-- If you'd like to support IE8 -->
4
+ <script src="http://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js"></script>
5
+ <script src="http://vjs.zencdn.net/5.6.0/video.js"></script>
@@ -0,0 +1,13 @@
1
+ = table.row :category, as: :association, label_method: :name
2
+ = table.row :name
3
+ = table.row :description
4
+ = table.row :markup_language
5
+ = table.row :published
6
+ = table.row :published_at
7
+ = table.row :clip
8
+ = table.row :clip_file_name
9
+ = table.row :clip_content_type
10
+ = table.row :clip_file_size
11
+ = table.row :clip_updated_at
12
+ = table.row :created_at
13
+ = table.row :updated_at
@@ -0,0 +1,4 @@
1
+ .row.bottom-margin-2
2
+ #video-clip
3
+ %video.col-xs-12.video-js{ controls: :true, preload: 'auto', width: "auto", height: "auto", 'data-setup': "{}" }
4
+ %source{ src: @resource.clip.url, type: @resource.clip_content_type } }
@@ -0,0 +1,7 @@
1
+ = table.column :preview_image, as: :thumbnail, style: :default_thumb, link_to_url: Proc.new { |resource| url_for(resource) }
2
+ = table.association :category, label_method: :name
3
+ = table.column :name
4
+ = table.column :description
5
+ = table.timestamps
6
+ = table.acts_as_list_actions
7
+ = 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/videos/backend/application", media: "all" %>
6
+ <%= javascript_include_tag "ecm/videos/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_videos_backend.js )
2
+ Rails.application.config.assets.precompile += %w( ecm_videos_backend.css )
@@ -0,0 +1,3 @@
1
+ de:
2
+ classes:
3
+ ecm/videos/backend/engine: Videos
data/config/routes.rb ADDED
@@ -0,0 +1,12 @@
1
+ Ecm::Videos::Backend::Engine.routes.draw do
2
+ resources :categories do
3
+ post :toggle_published, on: :member
4
+ end
5
+
6
+ resources :videos do
7
+ post :reposition, on: :member
8
+ post :toggle_published, on: :member
9
+ end
10
+
11
+ root to: 'home#index'
12
+ end
@@ -0,0 +1,27 @@
1
+ require 'active_support/core_ext/module/delegation'
2
+ require 'active_support/core_ext/module/attribute_accessors'
3
+
4
+ module Ecm
5
+ module Videos
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::Videos::Backend::CategoriesController,
16
+ Ecm::Videos::Backend::VideosController
17
+ ]
18
+ end
19
+ end
20
+
21
+ mattr_accessor :registered_services do
22
+ -> { [] }
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,9 @@
1
+ module Ecm
2
+ module Videos
3
+ module Backend
4
+ class Engine < ::Rails::Engine
5
+ isolate_namespace Ecm::Videos::Backend
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,7 @@
1
+ module Ecm
2
+ module Videos
3
+ module Backend
4
+ VERSION = "1.0.0".freeze
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ require 'ecm/videos/backend/configuration'
2
+
3
+ module Ecm
4
+ module Videos
5
+ module Backend
6
+ extend Configuration
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,2 @@
1
+ require "ecm/videos/backend"
2
+ require "ecm/videos/backend/engine"
@@ -0,0 +1,33 @@
1
+ module Ecm
2
+ module Videos
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_videos_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::Videos::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,21 @@
1
+ Ecm::UserArea::Backend.configure do |config|
2
+ # Set the resources, that will be shown in the backend menu.
3
+ #
4
+ # Default: config.registered_controllers = -> {[
5
+ # Ecm::Videos::Backend::CategoriesController,
6
+ # Ecm::Videos::Backend::VideosController
7
+ # ]}
8
+ #
9
+ config.registered_controllers = -> {[
10
+ Ecm::Videos::Backend::CategoriesController,
11
+ Ecm::Videos::Backend::VideosController
12
+ ]}
13
+
14
+ # Set the services, that will be shown in the backend menu.
15
+ #
16
+ # Default: config.registered_services = -> {[
17
+ # ]}
18
+ #
19
+ config.registered_services = -> {[
20
+ ]}
21
+ end
@@ -0,0 +1,4 @@
1
+
2
+ localized do
3
+ mount Ecm::Videos::Backend::Engine => '/backend/ecm/videos'
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,95 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ecm_videos_backend
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Roberto Vasquez Angel
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-02-20 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::Videos::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/videos/backend/application.js
38
+ - app/assets/javascripts/ecm_videos_backend.js
39
+ - app/assets/stylesheets/ecm/videos/backend/application.css
40
+ - app/assets/stylesheets/ecm/videos/backend/application/dummy.css
41
+ - app/assets/stylesheets/ecm_videos_backend.css
42
+ - app/controllers/ecm/videos/backend/application_controller.rb
43
+ - app/controllers/ecm/videos/backend/categories_controller.rb
44
+ - app/controllers/ecm/videos/backend/home_controller.rb
45
+ - app/controllers/ecm/videos/backend/videos_controller.rb
46
+ - app/helpers/ecm/videos/backend/application_helper.rb
47
+ - app/policies/ecm/videos/backend/engine_policy.rb
48
+ - app/policies/ecm/videos/category_policy.rb
49
+ - app/policies/ecm/videos/video_policy.rb
50
+ - app/views/ecm/videos/backend/categories/_form.haml
51
+ - app/views/ecm/videos/backend/categories/_table.haml
52
+ - app/views/ecm/videos/backend/videos/_form.haml
53
+ - app/views/ecm/videos/backend/videos/_head_extras.html.erb
54
+ - app/views/ecm/videos/backend/videos/_show.haml
55
+ - app/views/ecm/videos/backend/videos/_show_extras.haml
56
+ - app/views/ecm/videos/backend/videos/_table.haml
57
+ - app/views/layouts/ecm/videos/backend/application.html.erb
58
+ - config/initializers/assets.rb
59
+ - config/locales/de.yml
60
+ - config/routes.rb
61
+ - lib/ecm/videos/backend.rb
62
+ - lib/ecm/videos/backend/configuration.rb
63
+ - lib/ecm/videos/backend/engine.rb
64
+ - lib/ecm/videos/backend/version.rb
65
+ - lib/ecm_videos_backend.rb
66
+ - lib/generators/ecm/videos/backend/install/install_generator.rb
67
+ - lib/generators/ecm/videos/backend/install/templates/initializer.rb
68
+ - lib/generators/ecm/videos/backend/install/templates/routes.source
69
+ - lib/tasks/ecm/videos/backend_tasks.rake
70
+ homepage: https://github.com/robotex82/ecm_videos_backend
71
+ licenses:
72
+ - MIT
73
+ metadata: {}
74
+ post_install_message:
75
+ rdoc_options: []
76
+ require_paths:
77
+ - lib
78
+ required_ruby_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ required_rubygems_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ requirements: []
89
+ rubyforge_project:
90
+ rubygems_version: 2.4.8
91
+ signing_key:
92
+ specification_version: 4
93
+ summary: Ecm::Videos::Backend.
94
+ test_files: []
95
+ has_rdoc: