administrador 0.0.18.pre → 0.0.20.pre

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 431f521918445d34b9f07aabf3b2f549c4369d1d7aff2087025056173237db15
4
- data.tar.gz: 76d6e4223f62d62a178778d49ee5b3a336217a0b7887b4e8b17ff6482ded99c7
3
+ metadata.gz: 2ad8cd4cb5041f5517a72bc1773b3e4beb3173eafe8279b91e07e9d8a1b2959a
4
+ data.tar.gz: 44f057cc7b528958cb0e7c300487959fb0c5a06da0be131394b8c80ad7859068
5
5
  SHA512:
6
- metadata.gz: f0be5c4dd719224c102de42e807176c26c9c9337ccd8281222491409e4eb7802ae400928db4d91b93351f633a6f05f3d62e93909dc9fa12794b0a7f78e977ff1
7
- data.tar.gz: 1436c9cb8b7e9674c3db76b06f72250ef1a98296466743b9fc8c32369ad49fcb74a119bf32546d755003d24291c3037fe2984ee5e264a54c5ebaafca5bc89590
6
+ metadata.gz: 58196187a300961480f91403620b6aa3a775e5b225eb423ecb6ef98239ed86558fbf620975993996019f6360fbe1ca71652a112c113aeaaa6528a307545b85e3
7
+ data.tar.gz: f68a1141540c4f5ee24ee870073ef29f67ac769a4f8b57916e7cd5bdacb990ae1286bca5ce171afdebe7e8cdc68e9e570e2f3de045fc6a97bb901ef3f56c9b8b
@@ -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
@@ -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.20.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.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-15 00:00:00.000000000 Z
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.3
520
+ rubygems_version: 3.0.4
521
521
  signing_key:
522
522
  specification_version: 4
523
523
  summary: Administrador - The rails administration interface.