administrador 0.0.18.pre → 0.0.24.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 431f521918445d34b9f07aabf3b2f549c4369d1d7aff2087025056173237db15
4
- data.tar.gz: 76d6e4223f62d62a178778d49ee5b3a336217a0b7887b4e8b17ff6482ded99c7
3
+ metadata.gz: ae2df99a9d2737e3d0cb4f3340b7425f0fdffd7cfb2351a3697f3c52f76dd969
4
+ data.tar.gz: ade5053fb15f202ba0977ff92203af5e02bb3289eb06dc03f62cdc8943f3602e
5
5
  SHA512:
6
- metadata.gz: f0be5c4dd719224c102de42e807176c26c9c9337ccd8281222491409e4eb7802ae400928db4d91b93351f633a6f05f3d62e93909dc9fa12794b0a7f78e977ff1
7
- data.tar.gz: 1436c9cb8b7e9674c3db76b06f72250ef1a98296466743b9fc8c32369ad49fcb74a119bf32546d755003d24291c3037fe2984ee5e264a54c5ebaafca5bc89590
6
+ metadata.gz: 28ac22991ca090d69268b721401274d101331190eae07a49ee465b59351061e268f50f069a5725e98104f0cc0b60bb6e8dbc5cc80ed54af7e82150e2844fc5c6
7
+ data.tar.gz: bfc1f5e9b6a0698f05016e2036edf79a7ac29ac96d8cfdda2c2d71c89ef290190f04cccbc40bc8e165153a8cca9af1c7a0a2dbdd5cdc781ca3cb23ee4be29f0b
@@ -0,0 +1,6 @@
1
+ //= require rails-ujs
2
+ //= require activestorage
3
+ //= require rao-component/acts_as_list
4
+ //= require rao-component/awesome_nested_set
5
+ //= require simple_sidebar
6
+ //= require administrador/application
@@ -10,9 +10,4 @@
10
10
  // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
11
  // about supported directives.
12
12
  //
13
- //= require rails-ujs
14
- //= require activestorage
15
- //= require rao-component/acts_as_list
16
- //= require rao-component/awesome_nested_set
17
- //= require simple_sidebar
18
13
  //= require_tree ./application
@@ -0,0 +1,4 @@
1
+ /*
2
+ *= require simple_sidebar
3
+ *= require administrador/application
4
+ */
@@ -1,16 +1,4 @@
1
1
  /*
2
- * This is a manifest file that'll be compiled into application.css, which will include all the files
3
- * listed below.
4
- *
5
- * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
- * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
- *
8
- * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
- * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
- * files in this directory. Styles in this file should be added after the last require_* statement.
11
- * It is generally better to create a new file per style scope.
12
- *
13
- *= require simple_sidebar
14
2
  *= require_tree ./application
15
3
  *= require_self
16
4
  */
@@ -1,3 +1,5 @@
1
1
  body.administrador textarea {
2
2
  height: 40vh;
3
+ font-family: monospace;
4
+ font-size: 120%;
3
5
  }
@@ -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?(:current_engine, true) && c.current_engine.present?
33
- breadcrumbs << { label: t("classes.#{c.current_engine.name.underscore}"), url: send(c.current_engine.engine_name).root_path, link_html_options: {}, li_html_options: {} }
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
@@ -29,8 +29,8 @@
29
29
 
30
30
  = csrf_meta_tags
31
31
  = csp_meta_tag
32
- = stylesheet_link_tag "administrador/application", media: "all"
33
- = javascript_include_tag "administrador/application"
32
+ = stylesheet_link_tag "administrador", media: "all"
33
+ = javascript_include_tag "administrador"
34
34
 
35
35
  = render partial: 'html_head_extras'
36
36
  %body{ administrador_helper(self).body_html }
@@ -0,0 +1 @@
1
+ Rails.application.config.assets.precompile += %w( administrador.js administrador.css )
@@ -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:
@@ -1,8 +1,19 @@
1
1
  en:
2
2
  administrador:
3
3
  application:
4
- engine_navigation:
5
- home: 'Home'
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
- new: 'Ausführen'
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
- @name.deconstantize.underscore.gsub('/', '_')
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
@@ -1,3 +1,3 @@
1
1
  module Administrador
2
- VERSION = '0.0.18.pre'.freeze
2
+ VERSION = '0.0.24.pre'.freeze
3
3
  end
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.18.pre
4
+ version: 0.0.24.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-15 00:00:00.000000000 Z
11
+ date: 2020-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -58,28 +58,28 @@ dependencies:
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 0.0.23.pre
61
+ version: 0.0.33.pre
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 0.0.23.pre
68
+ version: 0.0.33.pre
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rao-component
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 0.0.30.pre
75
+ version: 0.0.43.pre
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 0.0.30.pre
82
+ version: 0.0.43.pre
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rao-resource_controller
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: 0.0.23.pre
103
+ version: 0.0.43.pre
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 0.0.23.pre
110
+ version: 0.0.43.pre
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rao-service_controller
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -385,9 +385,11 @@ files:
385
385
  - README.md
386
386
  - Rakefile
387
387
  - app/assets/config/administrador_manifest.js
388
+ - app/assets/javascripts/administrador.js
388
389
  - app/assets/javascripts/administrador/application.js
389
390
  - app/assets/javascripts/administrador/application/keep.js
390
391
  - app/assets/javascripts/administrador/application/sidebar.js.coffee~
392
+ - app/assets/stylesheets/administrador.css
391
393
  - app/assets/stylesheets/administrador/application.css
392
394
  - app/assets/stylesheets/administrador/application/bootstrap-btn-responsive.css
393
395
  - app/assets/stylesheets/administrador/application/bootstrap-btn-xs.css
@@ -484,6 +486,7 @@ files:
484
486
  - app/views/administrador/sidebar_controller/base/show.html.haml
485
487
  - app/views/breadcrumbs/_render.html.haml
486
488
  - app/views/layouts/administrador/application.html.haml
489
+ - config/initializers/assets.rb
487
490
  - config/initializers/localized_engines_fix.rb
488
491
  - config/locales/de.yml
489
492
  - config/locales/en.yml
@@ -517,7 +520,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
517
520
  - !ruby/object:Gem::Version
518
521
  version: 1.3.1
519
522
  requirements: []
520
- rubygems_version: 3.0.3
523
+ rubygems_version: 3.1.3
521
524
  signing_key:
522
525
  specification_version: 4
523
526
  summary: Administrador - The rails administration interface.