multi_client_backend 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +18 -0
- data/app/assets/javascripts/multi_client/backend/application.js +1 -0
- data/app/assets/javascripts/multi_client/backend/application/dummy.js +0 -0
- data/app/assets/javascripts/multi_client_backend.js +1 -0
- data/app/assets/stylesheets/multi_client/backend/application.css +3 -0
- data/app/assets/stylesheets/multi_client/backend/application/dummy.css +0 -0
- data/app/assets/stylesheets/multi_client_backend.css +3 -0
- data/app/controllers/multi_client/backend/clients_controller.rb +15 -0
- data/app/controllers/multi_client/backend/create_client_service_controller.rb +16 -0
- data/app/controllers/multi_client/backend/home_controller.rb +6 -0
- data/app/helpers/multi_client/backend/application_helper.rb +6 -0
- data/app/policies/multi_client/backend/engine_policy.rb +4 -0
- data/app/policies/multi_client/client_policy.rb +4 -0
- data/app/views/layouts/multi_client/backend/application.html.erb +14 -0
- data/app/views/multi_client/backend/create_client_service/_form.haml +22 -0
- data/config/initializers/assets.rb +2 -0
- data/config/locales/de.yml +6 -0
- data/config/locales/en.yml +6 -0
- data/config/rbac.master.yml +24 -0
- data/config/routes.rb +10 -0
- data/lib/generators/multi_client/backend/install/install_generator.rb +31 -0
- data/lib/generators/multi_client/backend/install/templates/initializer.rb +25 -0
- data/lib/generators/multi_client/backend/install/templates/routes.source +4 -0
- data/lib/multi_client/backend.rb +7 -0
- data/lib/multi_client/backend/configuration.rb +25 -0
- data/lib/multi_client/backend/engine.rb +11 -0
- data/lib/multi_client/backend/version.rb +5 -0
- data/lib/multi_client_backend.rb +2 -0
- data/lib/tasks/multi_client/backend_tasks.rake +4 -0
- metadata +90 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ff604851566e069b906b1f6722d2b79a0ea08932
|
4
|
+
data.tar.gz: ec4b0bf13e1f5215a3661a31632ece60cb32b931
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7537691b59fb861a266bb5a6a6dcded1e519f7bb0fb722e8215bc44d7dc5b5f085545dbe862b4ee019810d20ca0d69a997ed5f72a9562e4934e442c23489a79a
|
7
|
+
data.tar.gz: d5263320b2007d2cd3655a9c8cc00011b54a917eaa5c925851d71d27d5296b492bd9c4d475b1bbf7da38ca88e124d6675d46c987a103c189b1f60f1c338b85b7
|
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
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 = 'MultiClient::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
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require multi_client/backend/application
|
File without changes
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module MultiClient
|
2
|
+
module Backend
|
3
|
+
class ClientsController < Itsf::Backend::Resource::BaseController
|
4
|
+
def self.resource_class
|
5
|
+
MultiClient::Client
|
6
|
+
end
|
7
|
+
|
8
|
+
private
|
9
|
+
|
10
|
+
def permitted_params
|
11
|
+
params.require(:client).permit(:subdomain, :identifier, :enabled)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module MultiClient
|
2
|
+
module Backend
|
3
|
+
class CreateClientServiceController < Itsf::Backend::Service::BaseController
|
4
|
+
def self.service_class
|
5
|
+
MultiClient::CreateClientService
|
6
|
+
end
|
7
|
+
|
8
|
+
private
|
9
|
+
|
10
|
+
def permitted_params
|
11
|
+
# params.require(:chi_tenants_create_tenant_service).permit(:subdomain, :identifier, :enabled, :brand_primary_color, :logo, :user_emails, :create_roles_and_permissions, product_ids: []).merge(request_host: request.host)
|
12
|
+
params.require(:create_client_service).permit(:subdomain, :identifier, :enabled, :user_emails, :create_roles_and_permissions).merge(request_host: request.host)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Backend</title>
|
5
|
+
<%= stylesheet_link_tag "multi_client/backend/application", media: "all" %>
|
6
|
+
<%= javascript_include_tag "multi_client/backend/application" %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<%= yield %>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
.well
|
2
|
+
%h4= form.object.class.human_attribute_name :tenant
|
3
|
+
= form.input :subdomain
|
4
|
+
= form.input :identifier
|
5
|
+
= form.input :enabled, as: :boolean
|
6
|
+
|
7
|
+
/ .well
|
8
|
+
/ %h4= form.object.class.human_attribute_name :tenant_settings
|
9
|
+
/ = form.input :brand_primary_color, input_html: { type: 'color' }
|
10
|
+
/ = form.input :logo, as: :file
|
11
|
+
|
12
|
+
.well
|
13
|
+
%h4= form.object.class.human_attribute_name :roles_and_permissions
|
14
|
+
= form.input :create_roles_and_permissions, as: :boolean
|
15
|
+
|
16
|
+
.well
|
17
|
+
%h4= form.object.class.human_attribute_name :users
|
18
|
+
= form.input :user_emails, as: :text
|
19
|
+
|
20
|
+
/ .well
|
21
|
+
/ %h4= form.object.class.human_attribute_name :products
|
22
|
+
/ = form.input :product_ids, as: :check_boxes, collection: Chi::Licensing::Product.all, label_method: :human, include_hidden: false
|
@@ -0,0 +1,24 @@
|
|
1
|
+
defaults:
|
2
|
+
permissions:
|
3
|
+
- multi_client/backend/engine
|
4
|
+
- multi_client/client/index
|
5
|
+
- multi_client/client/show
|
6
|
+
- multi_client/client/new
|
7
|
+
- multi_client/client/create
|
8
|
+
- multi_client/client/edit
|
9
|
+
- multi_client/client/update
|
10
|
+
- multi_client/client/destroy
|
11
|
+
roles:
|
12
|
+
multi_client/administrator:
|
13
|
+
- multi_client/backend/engine
|
14
|
+
- multi_client/client/index
|
15
|
+
- multi_client/client/show
|
16
|
+
- multi_client/client/new
|
17
|
+
- multi_client/client/create
|
18
|
+
- multi_client/client/edit
|
19
|
+
- multi_client/client/update
|
20
|
+
- multi_client/client/destroy
|
21
|
+
multi_client/reviewer:
|
22
|
+
- multi_client/backend/engine
|
23
|
+
- multi_client/client/index
|
24
|
+
- multi_client/client/show
|
data/config/routes.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
module MultiClient
|
2
|
+
module Backend
|
3
|
+
module Generators
|
4
|
+
class InstallGenerator < Rails::Generators::Base
|
5
|
+
desc 'Generates the initializer'
|
6
|
+
|
7
|
+
source_root File.expand_path('../templates', __FILE__)
|
8
|
+
|
9
|
+
def generate_initializer
|
10
|
+
copy_file 'initializer.rb', 'config/initializers/multi_client_backend.rb'
|
11
|
+
end
|
12
|
+
|
13
|
+
def generate_routes
|
14
|
+
route File.read(File.join(File.expand_path('../templates', __FILE__), 'routes.source'))
|
15
|
+
end
|
16
|
+
|
17
|
+
def add_to_itsf_backend
|
18
|
+
insert_into_itsf_backend_config(MultiClient::Backend::Engine)
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def insert_into_itsf_backend_config(engine_name)
|
24
|
+
inject_into_file 'config/initializers/001_itsf_backend.rb', after: "config.backend_engines = %w(\n" do
|
25
|
+
" #{engine_name}\n"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
MultiClient::Backend.configure do |config|
|
2
|
+
# Set the resources, that will be shown in the backend menu.
|
3
|
+
#
|
4
|
+
# Default: config.registered_controllers = -> {[
|
5
|
+
# MultiClient::Backend::ClientsController
|
6
|
+
# ]}
|
7
|
+
#
|
8
|
+
config.registered_controllers = lambda {
|
9
|
+
[
|
10
|
+
MultiClient::Backend::ClientsController
|
11
|
+
]
|
12
|
+
}
|
13
|
+
|
14
|
+
# Set the services, that will be shown in the backend menu.
|
15
|
+
#
|
16
|
+
# Default: config.registered_services = -> {[
|
17
|
+
# MultiClient::Backend::CreateClientServiceController
|
18
|
+
# ]}
|
19
|
+
#
|
20
|
+
config.registered_services = -> {
|
21
|
+
[
|
22
|
+
MultiClient::Backend::CreateClientServiceController
|
23
|
+
]
|
24
|
+
}
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module MultiClient
|
2
|
+
module Backend
|
3
|
+
module Configuration
|
4
|
+
def configure
|
5
|
+
yield self
|
6
|
+
end
|
7
|
+
|
8
|
+
mattr_accessor(:registered_controllers) do
|
9
|
+
->() do
|
10
|
+
[
|
11
|
+
MultiClient::Backend::ClientsController
|
12
|
+
]
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
mattr_accessor(:registered_services) do
|
17
|
+
->() do
|
18
|
+
[
|
19
|
+
MultiClient::Backend::CreateClientServiceController
|
20
|
+
]
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: multi_client_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-02-03 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: MultiClient::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/multi_client/backend/application.js
|
38
|
+
- app/assets/javascripts/multi_client/backend/application/dummy.js
|
39
|
+
- app/assets/javascripts/multi_client_backend.js
|
40
|
+
- app/assets/stylesheets/multi_client/backend/application.css
|
41
|
+
- app/assets/stylesheets/multi_client/backend/application/dummy.css
|
42
|
+
- app/assets/stylesheets/multi_client_backend.css
|
43
|
+
- app/controllers/multi_client/backend/clients_controller.rb
|
44
|
+
- app/controllers/multi_client/backend/create_client_service_controller.rb
|
45
|
+
- app/controllers/multi_client/backend/home_controller.rb
|
46
|
+
- app/helpers/multi_client/backend/application_helper.rb
|
47
|
+
- app/policies/multi_client/backend/engine_policy.rb
|
48
|
+
- app/policies/multi_client/client_policy.rb
|
49
|
+
- app/views/layouts/multi_client/backend/application.html.erb
|
50
|
+
- app/views/multi_client/backend/create_client_service/_form.haml
|
51
|
+
- config/initializers/assets.rb
|
52
|
+
- config/locales/de.yml
|
53
|
+
- config/locales/en.yml
|
54
|
+
- config/rbac.master.yml
|
55
|
+
- config/routes.rb
|
56
|
+
- lib/generators/multi_client/backend/install/install_generator.rb
|
57
|
+
- lib/generators/multi_client/backend/install/templates/initializer.rb
|
58
|
+
- lib/generators/multi_client/backend/install/templates/routes.source
|
59
|
+
- lib/multi_client/backend.rb
|
60
|
+
- lib/multi_client/backend/configuration.rb
|
61
|
+
- lib/multi_client/backend/engine.rb
|
62
|
+
- lib/multi_client/backend/version.rb
|
63
|
+
- lib/multi_client_backend.rb
|
64
|
+
- lib/tasks/multi_client/backend_tasks.rake
|
65
|
+
homepage: https://github.com/robotex82/multi_client_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.4.8
|
86
|
+
signing_key:
|
87
|
+
specification_version: 4
|
88
|
+
summary: MultiClient::Backend.
|
89
|
+
test_files: []
|
90
|
+
has_rdoc:
|