administrador 0.0.18.pre → 0.0.20.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/administrador/application/forms.css +2 -0
- data/app/concerns/administrador/controller/application_concern.rb +2 -0
- data/app/view_helpers/administrador/breadcrumbs_view_helper.rb +7 -3
- data/app/views/administrador/application/sidebars/_engine.html.haml +1 -0
- data/config/locales/de.yml +3 -0
- data/config/locales/en.yml +34 -5
- data/lib/administrador/registered_engine.rb +45 -1
- data/lib/administrador/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ad8cd4cb5041f5517a72bc1773b3e4beb3173eafe8279b91e07e9d8a1b2959a
|
4
|
+
data.tar.gz: 44f057cc7b528958cb0e7c300487959fb0c5a06da0be131394b8c80ad7859068
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58196187a300961480f91403620b6aa3a775e5b225eb423ecb6ef98239ed86558fbf620975993996019f6360fbe1ca71652a112c113aeaaa6528a307545b85e3
|
7
|
+
data.tar.gz: f68a1141540c4f5ee24ee870073ef29f67ac769a4f8b57916e7cd5bdacb990ae1286bca5ce171afdebe7e8cdc68e9e570e2f3de045fc6a97bb901ef3f56c9b8b
|
@@ -3,6 +3,8 @@ module Administrador
|
|
3
3
|
module ApplicationConcern
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
|
6
|
+
include Administrador::Controller::EngineConcern
|
7
|
+
|
6
8
|
included do
|
7
9
|
view_helper Administrador::ApplicationViewHelper, as: :administrador_helper
|
8
10
|
view_helper Administrador::BreadcrumbsViewHelper, as: :breadcrumbs
|
@@ -27,10 +27,14 @@ module Administrador
|
|
27
27
|
|
28
28
|
def generate_breadcrumbs!
|
29
29
|
[].tap do |breadcrumbs|
|
30
|
+
# Add breadcrumb to home page
|
30
31
|
breadcrumbs << { label: t('.home'), url: c.administrador.root_path, link_html_options: {}, li_html_options: {}}
|
31
|
-
|
32
|
-
if c.respond_to?(:
|
33
|
-
|
32
|
+
|
33
|
+
if c.respond_to?(:engine_class, true) && c.engine_class.present?
|
34
|
+
engine = Administrador::Configuration.engines[c.engine_class.name]
|
35
|
+
if engine.present?
|
36
|
+
breadcrumbs << { label: t("classes.#{engine.engine.name.underscore}"), url: c.send(engine.router_name).root_path, link_html_options: {}, li_html_options: {} }
|
37
|
+
end
|
34
38
|
end
|
35
39
|
|
36
40
|
# if c.respond_to?(:resource_class, true) && c.respond_to?(:available_rest_actions) && c.available_rest_actions.include?(:index)
|
@@ -3,6 +3,7 @@
|
|
3
3
|
.row
|
4
4
|
.col-12
|
5
5
|
- administrador_helper(self).engines.each do |_, engine|
|
6
|
+
- next unless engine.options[:show_in_engine_sidebar]
|
6
7
|
.administrador-engine.mb-4.text-secondary{ id: dom_id(engine), class: dom_class(engine) }
|
7
8
|
%h6.text-uppercase.administrador-engine-name
|
8
9
|
%i.fas.fa-home
|
data/config/locales/de.yml
CHANGED
@@ -40,6 +40,8 @@ de:
|
|
40
40
|
destroy: "Löschen"
|
41
41
|
service_controller:
|
42
42
|
base:
|
43
|
+
create:
|
44
|
+
title: "%{service_name} ausgeführt"
|
43
45
|
new:
|
44
46
|
title: "%{service_name} ausführen"
|
45
47
|
new_actions:
|
@@ -55,6 +57,7 @@ de:
|
|
55
57
|
edit: 'Bearbeiten'
|
56
58
|
new: 'Erstellen'
|
57
59
|
service:
|
60
|
+
create: 'Ausgeführt'
|
58
61
|
new: 'Ausführen'
|
59
62
|
page: "Seite %{page_number}"
|
60
63
|
helpers:
|
data/config/locales/en.yml
CHANGED
@@ -1,8 +1,19 @@
|
|
1
1
|
en:
|
2
2
|
administrador:
|
3
3
|
application:
|
4
|
-
|
5
|
-
|
4
|
+
sidebars:
|
5
|
+
i18n:
|
6
|
+
title: 'Translations'
|
7
|
+
messages:
|
8
|
+
title: 'Messages'
|
9
|
+
notifications:
|
10
|
+
title: 'Notifications'
|
11
|
+
settings:
|
12
|
+
title: 'Settings'
|
13
|
+
search:
|
14
|
+
title: 'Search'
|
15
|
+
user:
|
16
|
+
title: 'Profile'
|
6
17
|
controller:
|
7
18
|
confirmations:
|
8
19
|
destroy: "Are you sure?"
|
@@ -29,9 +40,12 @@ en:
|
|
29
40
|
destroy: "Delete"
|
30
41
|
service_controller:
|
31
42
|
base:
|
43
|
+
create:
|
44
|
+
title: "Ran %{service_name}"
|
32
45
|
new:
|
33
|
-
back: "Back"
|
34
46
|
title: "Run %{service_name}"
|
47
|
+
new_actions:
|
48
|
+
back: "Back"
|
35
49
|
administrador/breadcrumbs_view_helper:
|
36
50
|
generate_breadcrumbs!:
|
37
51
|
home: 'Home'
|
@@ -39,10 +53,25 @@ en:
|
|
39
53
|
breadcrumbs_concern:
|
40
54
|
actions:
|
41
55
|
default:
|
56
|
+
create: 'Create'
|
42
57
|
edit: 'Edit'
|
43
58
|
new: 'New'
|
44
59
|
service:
|
45
|
-
|
60
|
+
create: 'Ran'
|
61
|
+
new: 'Run'
|
46
62
|
page: "Page %{page_number}"
|
63
|
+
helpers:
|
64
|
+
submit:
|
65
|
+
administrador:
|
66
|
+
service:
|
67
|
+
create: 'Run'
|
68
|
+
q:
|
69
|
+
create: 'Filter'
|
47
70
|
routes:
|
48
|
-
administrador-engine: backend
|
71
|
+
administrador-engine: backend
|
72
|
+
views:
|
73
|
+
pagination:
|
74
|
+
first: "<<"
|
75
|
+
next: ">"
|
76
|
+
last: ">>"
|
77
|
+
previous: "<"
|
@@ -1,8 +1,44 @@
|
|
1
1
|
module Administrador
|
2
|
+
# A registered engine represents a rails engine that is registered to
|
3
|
+
# administrador.
|
4
|
+
#
|
5
|
+
# You can register an engine as follows:
|
6
|
+
#
|
7
|
+
# # blorgh/app/config/initializers/administrador.rb
|
8
|
+
# Administrador.configure { |c| c.register_engine(Blorgh::Engine', {}) }
|
9
|
+
#
|
10
|
+
# The register_engine methods accepts an option hash. Available options are:
|
11
|
+
#
|
12
|
+
# * show_in_engine_sidebar:
|
13
|
+
# default: true
|
14
|
+
# Controls wether the engine will be shown in the main menu (engine sidebar) or not.
|
15
|
+
#
|
16
|
+
# A special case is when you want to register your rails application into
|
17
|
+
# administrador. You can do that like this:
|
18
|
+
#
|
19
|
+
# # app/config/initializers/main_app.rb
|
20
|
+
# require 'example_app/configuration'
|
21
|
+
# Administrador.configure { |c| c.register_engine('ExampleApp::Application', {}) }
|
22
|
+
#
|
23
|
+
# You will need to add a confifguration module:
|
24
|
+
#
|
25
|
+
# # lib/example_app/configuration.rb
|
26
|
+
# module ExampleApp
|
27
|
+
# module Configuration
|
28
|
+
# # mattr_accessor(:resources_controllers) { ->{[]} }
|
29
|
+
# # mattr_accessor(:resource_controllers) { ->{[]} }
|
30
|
+
# # mattr_accessor(:service_controllers) { ->{[]} }
|
31
|
+
# # mattr_accessor(:sidebar_controllers) { ->{[]} }
|
32
|
+
# end
|
33
|
+
# end
|
34
|
+
#
|
2
35
|
class RegisteredEngine
|
3
36
|
attr_accessor :options, :name
|
4
37
|
|
5
38
|
def initialize(name, options)
|
39
|
+
options.reverse_merge!(
|
40
|
+
show_in_engine_sidebar: true
|
41
|
+
)
|
6
42
|
@name, @options = name, options
|
7
43
|
end
|
8
44
|
|
@@ -10,6 +46,10 @@ module Administrador
|
|
10
46
|
@name.constantize
|
11
47
|
end
|
12
48
|
|
49
|
+
def main_app?
|
50
|
+
engine.ancestors.include?(::Rails::Application)
|
51
|
+
end
|
52
|
+
|
13
53
|
def to_key
|
14
54
|
@name.underscore.split("/")
|
15
55
|
end
|
@@ -23,7 +63,11 @@ module Administrador
|
|
23
63
|
end
|
24
64
|
|
25
65
|
def router_name
|
26
|
-
|
66
|
+
if main_app?
|
67
|
+
:main_app
|
68
|
+
else
|
69
|
+
@name.deconstantize.underscore.gsub('/', '_')
|
70
|
+
end
|
27
71
|
end
|
28
72
|
|
29
73
|
def configuration
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: administrador
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.20.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Vasquez Angel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -517,7 +517,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
517
517
|
- !ruby/object:Gem::Version
|
518
518
|
version: 1.3.1
|
519
519
|
requirements: []
|
520
|
-
rubygems_version: 3.0.
|
520
|
+
rubygems_version: 3.0.4
|
521
521
|
signing_key:
|
522
522
|
specification_version: 4
|
523
523
|
summary: Administrador - The rails administration interface.
|