administrador 0.0.28.pre → 0.0.29.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/administrador/application/pagination_size.js.coffee +13 -0
  3. data/app/assets/javascripts/administrador.js +1 -1
  4. data/app/assets/stylesheets/administrador/application/breadcrumbs.css +1 -1
  5. data/app/assets/stylesheets/administrador/application/engines.css +36 -0
  6. data/app/assets/stylesheets/administrador/application/layout.css +23 -0
  7. data/app/assets/stylesheets/administrador/application/page-actions.css +13 -3
  8. data/app/assets/stylesheets/administrador/application/pagination.css +6 -0
  9. data/app/assets/stylesheets/administrador/application/sidebar-theme.css +2 -2
  10. data/app/assets/stylesheets/administrador.css +1 -0
  11. data/app/concerns/administrador/controller/engine_sidebar_concern.rb +17 -0
  12. data/app/concerns/administrador/controller/resources_concern.rb +4 -0
  13. data/app/controllers/administrador/home_controller/base.rb +1 -0
  14. data/app/controllers/administrador/home_controller.rb +2 -0
  15. data/app/controllers/administrador/resource_controller/base.rb +1 -0
  16. data/app/controllers/administrador/resources_controller/base.rb +1 -0
  17. data/app/controllers/administrador/service_controller/base.rb +1 -0
  18. data/app/view_helpers/administrador/application_view_helper.rb +9 -5
  19. data/app/view_helpers/administrador/breadcrumbs_view_helper.rb +5 -5
  20. data/app/views/administrador/application/_navbar.html.haml +4 -4
  21. data/app/views/administrador/application/sidebars/_engine.html.haml +32 -27
  22. data/app/views/administrador/application_view_helper/_render_engine_sidebars.html.haml +2 -1
  23. data/app/views/administrador/application_view_helper/_render_registered_engine_widget.html.haml +41 -0
  24. data/app/views/administrador/home/index.de.html.haml +4 -6
  25. data/app/views/administrador/home_controller/base/index.html.haml +2 -3
  26. data/app/views/administrador/resources_controller/base/_edit_actions.html.haml +1 -2
  27. data/app/views/administrador/resources_controller/base/_new_actions.html.haml +1 -2
  28. data/app/views/administrador/resources_controller/base/_pagination.html.haml +8 -1
  29. data/app/views/administrador/resources_controller/base/_show_actions.html.haml +1 -2
  30. data/app/views/administrador/resources_controller/base/edit.html.haml +1 -1
  31. data/app/views/administrador/resources_controller/base/index.html.haml +8 -4
  32. data/app/views/administrador/resources_controller/base/new.html.haml +1 -1
  33. data/app/views/administrador/service_controller/base/create.html.haml +1 -1
  34. data/app/views/administrador/service_controller/base/new.html.haml +1 -1
  35. data/app/views/layouts/administrador/application.html.haml +35 -22
  36. data/config/locales/de.yml +4 -1
  37. data/config/locales/en.yml +4 -1
  38. data/lib/administrador/configuration.rb +6 -2
  39. data/lib/administrador/feature.rb +2 -0
  40. data/lib/administrador/registered_engine.rb +41 -10
  41. data/lib/administrador/version.rb +1 -1
  42. data/lib/administrador.rb +1 -0
  43. data/lib/generators/administrador/install/templates/initializer.rb +8 -2
  44. metadata +17 -16
  45. data/app/assets/javascripts/administrador/application/sidebar.js.coffee~ +0 -104
  46. data/app/assets/stylesheets/administrador/application/engine-sidebar.css +0 -17
  47. data/app/assets/stylesheets/administrador/application/sidebar.css~ +0 -51
  48. data/app/views/administrador/resources_controller/base/_index_table_actions.html.haml~ +0 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5167050451ba9760bb4678226586b6a3b4f5002090926fdd2dc35258ae8e3af7
4
- data.tar.gz: 80242dc969c800c2b56e2994ee77b4b7e4de8612755a96979d9dc4259e449147
3
+ metadata.gz: 64ed33cc2480c73e23abf8b7cb1a36fc1f9f45286b663e52cb6f06749ed111be
4
+ data.tar.gz: a22f0b79ef8fd03fe9f900733957cedd2c8df95cd45f8ad008f9ad3a71fa4cd3
5
5
  SHA512:
6
- metadata.gz: 7a2ed5973892bbcd7d722910984c5847f1fa71664b79f3d7a384342e1fe4dfd54abcecd3519a177023fedc672df270cbc6f0808149c6262d886ec7a0801da0ab
7
- data.tar.gz: a7e951054c9e4a42e25ba8046a8dc7d871b45db07a5928930469792d93f9094a384d1dcce006c629b07eaccf9c00f0047eb501067ccba6d47b80119ad28b62d6
6
+ metadata.gz: 576c6c74e7aeb4accc89baacd6052b114ff587ba45e83efab110df72e963ef89abe8c32ef81d3d0087dc08fe6ef3fa1958bbcfd381feeb5234d5c005483b2a63
7
+ data.tar.gz: e8557e255e1928ecb20fd0bd4b349a04b5b5da01aacb77f5eee78ec2f766ae9fcc7fae36b00ad28317d5a56060237165ecc044a262ada65eafd558aa1f123062
@@ -0,0 +1,13 @@
1
+ $ ->
2
+ $('[data-select-pagination-size]').on 'change', (e) ->
3
+ queryParameters = {}
4
+ queryString = location.search.substring(1)
5
+ re = /([^&=]+)=([^&]*)/g
6
+ m = undefined
7
+
8
+ while m = re.exec(queryString)
9
+ queryParameters[decodeURIComponent(m[1])] = decodeURIComponent(m[2])
10
+
11
+ per_page = $(@).val()
12
+ queryParameters['per_page'] = per_page
13
+ location.search = $.param(queryParameters)
@@ -4,4 +4,4 @@
4
4
  //= require rao-component/awesome_nested_set
5
5
  //= require simple_sidebar
6
6
  //= require simple_form-datetimepicker
7
- //= require administrador/application
7
+ //= require administrador/application
@@ -1,6 +1,6 @@
1
1
  #main-breadcrumbs {
2
2
  background-color: #e2e6ea;
3
- margin-top: 4rem;
3
+ /* margin-top: 4rem; */
4
4
  }
5
5
 
6
6
  #main-breadcrumbs ol.breadcrumb {
@@ -0,0 +1,36 @@
1
+ #sidebar-engines .administrador-engine-actions {
2
+ width: 1rem;
3
+ min-height: 1px;
4
+ margin-right: 1rem;
5
+ }
6
+
7
+ #sidebar-engines .administrador-engine-resources-count, .registered-engine-widget .administrador-engine-resources-count {
8
+ width: 1rem;
9
+ }
10
+
11
+ #sidebar-engines .administrador-engine a {
12
+ color: grey;
13
+ }
14
+
15
+ #sidebar-engines .administrador-engine .badge-pill, .registered-engine-widget .badge-pill {
16
+ min-width: 1.75rem;
17
+ }
18
+
19
+ #sidebar-engines .administrador-engine-actions, .registered-engine-widget .administrador-engine-actions {
20
+ /* width: 2.5rem; */
21
+ min-height: 1px;
22
+ margin-right: 0.5rem;
23
+ }
24
+
25
+
26
+ .administrador-engine-actions, .administrador-engine-resources-count {
27
+ display: inline-block;
28
+ }
29
+
30
+ .administrador-engine-resources-count {
31
+ margin-right: 0.5rem;
32
+ }
33
+
34
+ .registered-engine-widget .badge-pill {
35
+ min-width: 2.3rem;
36
+ }
@@ -2,10 +2,19 @@ body {
2
2
  font-family: 'Poppins', sans-serif;
3
3
  }
4
4
 
5
+ #main-content {
6
+ padding-top: 4rem;
7
+ padding-bottom: 3rem;
8
+ }
9
+
5
10
  #main-container {
6
11
  padding-top: 1rem;
7
12
  }
8
13
 
14
+ #main-navbar {
15
+ /* height: 4rem; */
16
+ }
17
+
9
18
  #main-navbar-tools .navbar-nav {
10
19
  flex-direction: row;
11
20
  flex-wrap: wrap;
@@ -13,4 +22,18 @@ body {
13
22
 
14
23
  #main-navbar-tools .navbar-nav li {
15
24
  margin-left: 0.75rem;
25
+ }
26
+
27
+ #page-footer {
28
+ height: 3rem;
29
+ position: fixed;
30
+ bottom: 0;
31
+ width: 100%;
32
+ }
33
+
34
+ .collection-table {
35
+ white-space: nowrap;
36
+ }
37
+ .collection-table td:last-child {
38
+ width: 100%;
16
39
  }
@@ -1,3 +1,13 @@
1
- .edit-actions .btn, .show-actions .btn, .index-actions .btn, .new-actions .btn, .create-actions .btn {
2
- margin-left: 0.5rem;
3
- }
1
+ .edit-actions,
2
+ .show-actions,
3
+ .index-actions,
4
+ .new-actions,
5
+ .create-actions {
6
+ padding: 1rem;
7
+ }
8
+
9
+ .edit-actions .btn,
10
+ .show-actions .btn,
11
+ .index-actions .btn,
12
+ .new-actions .btn,
13
+ .create-actions .btn {}
@@ -0,0 +1,6 @@
1
+ .pagination-controls {
2
+ padding-top: 1rem;
3
+ padding-bottom: 1rem;
4
+ }
5
+
6
+ .pagination-controls ul.pagination { margin: 0; }
@@ -2,6 +2,6 @@
2
2
  background-color: white;
3
3
  }
4
4
  .sidebar-left.sidebar-push, .sidebar-right.sidebar-push {
5
- margin-top: 4rem;
6
- height: calc(100% - 4rem);
5
+ margin-top: calc(4rem + 2px);
6
+ height: calc(100% - 7rem - 2px);
7
7
  }
@@ -3,3 +3,4 @@
3
3
  *= require simple_form-datetimepicker
4
4
  *= require administrador/application
5
5
  */
6
+
@@ -0,0 +1,17 @@
1
+ module Administrador
2
+ module Controller
3
+ module EngineSidebarConcern
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+ helper_method :initial_engine_sidebar_state
8
+ end
9
+
10
+ private
11
+
12
+ def initial_engine_sidebar_state
13
+ Administrador::Configuration.initial_engine_sidebar_state
14
+ end
15
+ end
16
+ end
17
+ end
@@ -22,6 +22,10 @@ module Administrador
22
22
  with_conditions_from_query(super)
23
23
  end if Administrador.features?(:rao_query)
24
24
 
25
+ def per_page_default
26
+ Administrador::Configuration.features[:kaminari].options[:per_page_default] || super
27
+ end if Administrador.features?(:kaminari)
28
+
25
29
 
26
30
  module ResourcesCountConcern
27
31
  extend ActiveSupport::Concern
@@ -1,6 +1,7 @@
1
1
  module Administrador
2
2
  class HomeController::Base < ApplicationController
3
3
  include Administrador::Controller::EngineConcern
4
+ include Administrador::Controller::EngineSidebarConcern
4
5
 
5
6
  def index; end
6
7
  end
@@ -1,5 +1,7 @@
1
1
  module Administrador
2
2
  class HomeController < Administrador::ApplicationController
3
+ include Controller::EngineSidebarConcern
4
+
3
5
  def index
4
6
  end
5
7
  end
@@ -2,6 +2,7 @@ module Administrador
2
2
  module ResourceController
3
3
  class Base < Administrador::ApplicationController
4
4
  include Administrador::Controller::ResourceConcern
5
+ include Administrador::Controller::EngineSidebarConcern
5
6
  end
6
7
  end
7
8
  end
@@ -2,6 +2,7 @@ module Administrador
2
2
  module ResourcesController
3
3
  class Base < Administrador::ApplicationController
4
4
  include Administrador::Controller::ResourcesConcern
5
+ include Administrador::Controller::EngineSidebarConcern
5
6
  end
6
7
  end
7
8
  end
@@ -2,6 +2,7 @@ module Administrador
2
2
  module ServiceController
3
3
  class Base < Administrador::ApplicationController
4
4
  include Administrador::Controller::ServiceConcern
5
+ include Administrador::Controller::EngineSidebarConcern
5
6
  end
6
7
  end
7
8
  end
@@ -1,7 +1,7 @@
1
1
  module Administrador
2
2
  class ApplicationViewHelper < Rao::ViewHelper::Base
3
- def engines
4
- Administrador::Configuration.engines
3
+ def registered_engines
4
+ Administrador::RegisteredEngine.all
5
5
  end
6
6
 
7
7
  def filter_attributes_for_form(attribute_names)
@@ -24,16 +24,20 @@ module Administrador
24
24
  end
25
25
 
26
26
  def render_engine_sidebars
27
- engines.collect do |_, engine|
28
- c.render partial: 'administrador/application_view_helper/render_engine_sidebars', locals: { engine: engine }
27
+ registered_engines.collect do |registered_engine|
28
+ c.render partial: 'administrador/application_view_helper/render_engine_sidebars', locals: { engine: registered_engine }
29
29
  end.join.html_safe
30
30
  end
31
31
 
32
32
  def body_html
33
- css_classes = ['administrador', c.controller.class.name.underscore.gsub('/', '-').chomp('_controller'), c.action_name].compact.join(' ')
33
+ css_classes = ['administrador', 'd-flex flex-column h-100', c.controller.class.name.underscore.gsub('/', '-').chomp('_controller'), c.action_name].compact.join(' ')
34
34
  { class: css_classes }
35
35
  end
36
36
 
37
+ def render_registered_engine_widget(registered_engine)
38
+ render registered_engine: registered_engine
39
+ end
40
+
37
41
  private
38
42
 
39
43
  def bootstrapify_flash_keys(flash)
@@ -10,9 +10,9 @@ module Administrador
10
10
  if identifier.start_with?('.')
11
11
  prefix = self.class.name.underscore
12
12
  caller_method = caller[0].split(' ').last.gsub("'", '')
13
- I18n.t("#{prefix}.#{caller_method}.#{identifier}", options)
13
+ I18n.t("#{prefix}.#{caller_method}.#{identifier}", *options)
14
14
  else
15
- I18n.t(identifier, options)
15
+ I18n.t(identifier, **options)
16
16
  end
17
17
  end
18
18
 
@@ -31,9 +31,9 @@ module Administrador
31
31
  breadcrumbs << { label: t('.home'), url: c.administrador.root_path, link_html_options: {}, li_html_options: {}}
32
32
 
33
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: {} }
34
+ registered_engine = Administrador::RegisteredEngine.find_by_class(c.engine_class)
35
+ if registered_engine.present?
36
+ breadcrumbs << { label: t("classes.#{registered_engine.engine_class.name.underscore}"), url: c.send(registered_engine.router_name).root_path, link_html_options: {}, li_html_options: {} }
37
37
  end
38
38
  end
39
39
 
@@ -1,13 +1,13 @@
1
- %nav.navbar.navbar-light.fixed-top
1
+ %nav.navbar.navbar-dark.bg-dark.fixed-top
2
2
  #main-navbar-content
3
3
  %ul.navbar-nav
4
4
  %li.nav-item
5
- %button.btn.btn-circle.btn-lg.btn-light{ data: { sidebar: { trigger: '#sidebar-engines' } } }
5
+ %button.btn.btn-circle.btn-lg.btn-dark{ data: { sidebar: { trigger: '#sidebar-engines' } } }
6
6
  %i.fas.fa-bars
7
7
  #main-navbar-tools
8
8
  %ul.navbar-nav
9
- - administrador_helper(self).engines.each do |_, engine|
10
- - engine.sidebar_controllers.each do |sc|
9
+ - administrador_helper(self).registered_engines.each do |registered_engine|
10
+ - registered_engine.sidebar_controllers.each do |sc|
11
11
  %li.nav-item
12
12
  %button.btn.btn-circle.btn-lg.btn-light{ data: { sidebar: { trigger: "#sidebar-#{sc.name.underscore.gsub('/', '-')}" } } }
13
13
  %i.fas{ class: "fa-#{(sc.icon_name || :'ellipsis-v')}"}
@@ -1,34 +1,39 @@
1
- %aside#sidebar-engines.p-2.pr-0{ data: { sidebar: { position: :left, size: '20rem', state: :closed, mode: :push } } }
1
+ %aside#sidebar-engines.p-2.pr-0{ data: { sidebar: { position: :left, size: '20rem', state: initial_engine_sidebar_state, mode: :push } } }
2
2
  .container-fluid
3
3
  .row
4
4
  .col-12
5
- - administrador_helper(self).engines.each do |_, engine|
5
+ - administrador_helper(self).registered_engines.each_with_index do |(engine), index|
6
6
  - next unless engine.options[:show_in_engine_sidebar]
7
7
  .administrador-engine.mb-4.text-secondary{ id: dom_id(engine), class: dom_class(engine) }
8
- %h6.text-uppercase.administrador-engine-name
9
- %i.fas.fa-home
8
+ %h6.administrador-engine-name.d-flex.text-uppercase
9
+ %i.fas.fa-home.mr-1
10
10
  = link_to(send(engine.router_name).root_path, class: 'administrador-link-to-engine-home') do
11
11
  = engine.translated_name
12
- %ul.list-group.list-group-flush
13
- - engine.resources_controllers.each do |rc|
14
- %li.list-group-item
15
- .administrador-engine-resources-count.float-right
16
- %span.badge.badge-pill.badge-success= rc.resource_count
17
- .administrador-engine-actions.float-right
18
- - if rc.available_rest_actions.include?(:new)
19
- %a.administrador-link-to-new-resources{ href: send(engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :new) }
20
- %i.fas.fa-plus
21
- %a.administrador-link-to-resources{ href: send(engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :index), class: "#{rc.name.underscore.gsub('_controller', '').split('/').last == controller_name ? 'current selected' : ''}" }
22
- = rc.resource_class.model_name.human(count: :other)
23
- - engine.resource_controllers.each do |rc|
24
- %li.list-group-item
25
- .administrador-engine-actions.float-right
26
- - if rc.available_rest_actions.include?(:new)
27
- %a.administrador-link-to-new-resources{ href: send(engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :new) }
28
- %i.fas.fa-plus
29
- %a.administrador-link-to-resource{ href: send(engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :show) }
30
- = rc.resource_class.model_name.human(count: :other)
31
- - engine.service_controllers.each do |sc|
32
- %li.list-group-item
33
- %a.administrador-link-to-service{ href: send(engine.router_name).url_for(controller: "/#{sc.name.underscore.gsub('_controller', '')}", action: :new) }
34
- = sc.service_class.model_name.human(count: :other)
12
+ %span.ml-auto
13
+ %a{ data: { toggle: "collapse" }, href: "#engine-menu-#{index}", role: 'button', aria: { expanded: "false", controls: "engine-menu-#{index}" } }
14
+ %i.fas.fa-chevron-down
15
+ .engine-menu.collapse{ id: "engine-menu-#{index}", class: (engine.engine_class == controller.engine_class) ? "show" : nil }
16
+ %span
17
+ %ul.list-group.list-group-flush
18
+ - engine.resources_controllers.each do |rc|
19
+ %li.list-group-item
20
+ .administrador-engine-resources-count.float-right
21
+ %span.badge.badge-pill.badge-success= rc.resource_count
22
+ .administrador-engine-actions.float-right
23
+ - if rc.available_rest_actions.include?(:new)
24
+ %a.administrador-link-to-new-resources{ href: send(engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :new) }
25
+ %i.fas.fa-plus
26
+ %a.administrador-link-to-resources{ href: send(engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :index), class: "#{rc.name.underscore.gsub('_controller', '').split('/').last == controller_name ? 'current selected' : ''}" }
27
+ = rc.resource_class.model_name.human(count: :other)
28
+ - engine.resource_controllers.each do |rc|
29
+ %li.list-group-item
30
+ .administrador-engine-actions.float-right
31
+ - if rc.available_rest_actions.include?(:new)
32
+ %a.administrador-link-to-new-resources{ href: send(engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :new) }
33
+ %i.fas.fa-plus
34
+ %a.administrador-link-to-resource{ href: send(engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :show) }
35
+ = rc.resource_class.model_name.human(count: :other)
36
+ - engine.service_controllers.each do |sc|
37
+ %li.list-group-item
38
+ %a.administrador-link-to-service{ href: send(engine.router_name).url_for(controller: "/#{sc.name.underscore.gsub('_controller', '')}", action: :new) }
39
+ = sc.service_class.model_name.human(count: :other)
@@ -4,4 +4,5 @@
4
4
  - size = sc.sidebar_size || '250px'
5
5
  - url = sc.sidebar_url || send(engine.router_name).send("#{sc.name.demodulize.underscore.gsub('_controller', '').singularize}_path")
6
6
  - mode = sc.sidebar_mode || :modal
7
- %aside.py-2{ id: id, data: { sidebar: { position: position, size: size, state: :closed, mode: :modal, load: url } } }
7
+ %aside.py-2{ id: id, data: { sidebar: { position: position, size: size, state: :closed, mode: :modal, load: url } } }
8
+
@@ -0,0 +1,41 @@
1
+ .registered-engine-widget
2
+ .row
3
+ .col-12
4
+ %h3= t("classes.#{registered_engine.name.underscore}")
5
+
6
+ .row.mb-4
7
+ .col-12
8
+ %ul.list-group.list-group-flush
9
+ - registered_engine.resources_controllers.each do |rc|
10
+ %li.list-group-item.d-flex
11
+ %a.administrador-link-to-resources{ href: send(registered_engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :index), class: "#{rc.name.underscore.gsub('_controller', '').split('/').last == controller_name ? 'current selected' : ''}" }
12
+ = rc.resource_class.model_name.human(count: :other)
13
+ .ml-auto
14
+ .administrador-engine-actions
15
+ .btn-group
16
+ - if rc.available_rest_actions.include?(:new)
17
+ %a.btn.btn-xs.btn-success{ href: send(registered_engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :new) }
18
+ %i.fas.fa-plus
19
+ - if rc.available_rest_actions.include?(:index)
20
+ %a.btn.btn-xs.btn-primary{ href: send(registered_engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :index) }
21
+ %i.fas.fa-eye
22
+ .administrador-engine-resources-count
23
+ %span.badge.badge-pill.badge-success= rc.resource_count
24
+
25
+ - registered_engine.resource_controllers.each do |rc|
26
+ %li.list-group-item
27
+ .administrador-engine-actions.float-right
28
+ .btn-group
29
+ - if rc.available_rest_actions.include?(:new)
30
+ %a.btn.btn-xs.btn-success{ href: send(registered_engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :new) }
31
+ %i.fas.fa-plus
32
+ - if rc.available_rest_actions.include?(:show)
33
+ %a.btn.btn-xs.btn-primary{ href: send(registered_engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :show) }
34
+ %i.fas.fa-plus
35
+ %a.administrador-link-to-resource{ href: send(registered_engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :show) }
36
+ = rc.resource_class.model_name.human(count: :other)
37
+
38
+ - registered_engine.service_controllers.each do |sc|
39
+ %li.list-group-item
40
+ %a.administrador-link-to-service{ href: send(registered_engine.router_name).url_for(controller: "/#{sc.name.underscore.gsub('_controller', '')}", action: :new) }
41
+ = sc.service_class.model_name.human(count: :other)
@@ -1,6 +1,4 @@
1
- .jumbotron.jumbotron-fluid
2
- .container
3
- %h1.display-4 Hallo,
4
- %p.lead willkommen auf Deiner Administrationsoberfläche!
5
- %hr.my-4/
6
- %p Die in dieser Oberfläche verwalteten Inhalte findest Du mit einem Klick auf das Menü oben links. Zusätzliche Features sind über die Icons oben rechts zu finden.
1
+ .row
2
+ - administrador_helper(self).registered_engines.each do |registered_engine|
3
+ .col-lg-6.col-xl-4
4
+ = administrador_helper(self).render_registered_engine_widget(registered_engine)
@@ -1,5 +1,4 @@
1
- .row
2
- .col-12
3
- %h3= t('.title', engine_name: t("classes.#{engine_class.name.underscore}"))
1
+ - current_registered_engine = Administrador::RegisteredEngine.find_by_class!(engine_class)
2
+ = administrador_helper(self).render_registered_engine_widget(current_registered_engine)
4
3
 
5
4
  = render partial: 'index_extras'
@@ -1,6 +1,5 @@
1
- = link_to({ action: :index }, class: 'btn btn-light btn-responsive') do
1
+ = link_to({ action: :index }, class: 'btn btn-light btn-circle btn-lg') do
2
2
  %i.fas.fa-arrow-left
3
- %span.btn-text= t('.back')
4
3
 
5
4
  .ml-auto
6
5
  = link_to([resource_namespace, resource], class: 'btn btn-success btn-circle btn-lg') do
@@ -1,3 +1,2 @@
1
- = link_to({ action: :index }, class: 'btn btn-light btn-responsive') do
1
+ = link_to({ action: :index }, class: 'btn btn-light btn-circle btn-lg') do
2
2
  %i.fas.fa-arrow-left
3
- %span.btn-text= t('.back')
@@ -1 +1,8 @@
1
- = paginate(collection, theme: 'twitter-bootstrap-4')
1
+ .pagination-controls.w-100.d-flex.justify-content-between
2
+ .d-hide
3
+ .d-flex.align-items-center
4
+ = paginate(collection, theme: 'twitter-bootstrap-4')
5
+
6
+ .d-flex.align-items-center
7
+ %select.pagination-size{ 'data-select-pagination-size': true }
8
+ = options_for_select({ '1': 1, '5': 5, '10': 10, '15': 15, '20': 20, '50': 50, '100': 100, t('views.pagination_size.all') => 'all' }, per_page)
@@ -1,6 +1,5 @@
1
- = link_to({ action: :index }, class: 'btn btn-light btn-responsive') do
1
+ = link_to({ action: :index }, class: 'btn btn-light btn-circle btn-lg') do
2
2
  %i.fas.fa-arrow-left
3
- %span.btn-text= t('.back')
4
3
 
5
4
  .ml-auto
6
5
  - if available_rest_actions.include?(:destroy)
@@ -1,6 +1,6 @@
1
1
  .row
2
2
  .col-12
3
- %h1= t('.title', inflections)
3
+ %h1= t('.title', **inflections)
4
4
 
5
5
  .row
6
6
  .col-12
@@ -1,6 +1,6 @@
1
1
  .row
2
2
  .col-12
3
- %h1= t('.title', inflections)
3
+ %h1= t('.title', **inflections)
4
4
 
5
5
  - if Administrador.features?(:rao_query)
6
6
  .row
@@ -12,17 +12,21 @@
12
12
  .col-12
13
13
  .before-index-table= render partial: 'before_index_table', locals: { collection: @collection }
14
14
 
15
+ - if Administrador.features?(:kaminari) && @collection.respond_to?(:total_pages)
16
+ .row
17
+ .col-12
18
+ = render partial: 'pagination', locals: { collection: @collection }
19
+
15
20
  .row
16
21
  .col-12
17
- = collection_table(collection: @collection, resource_class: resource_class, table_html: "collection-table table table-responsive #{resource_class.name.underscore.pluralize.gsub('/', '-')} table-xs") do |table|
22
+ = collection_table(collection: @collection, resource_class: resource_class, table_html: "collection-table table table-responsive #{resource_class.name.underscore.pluralize.gsub('/', '-')}") do |table|
18
23
  = render partial: 'index_table', locals: { table: table }
19
24
  = render partial: 'index_table_actions', locals: { table: table }
20
25
 
21
26
  - if Administrador.features?(:kaminari) && @collection.respond_to?(:total_pages)
22
27
  .row
23
28
  .col-12.d-flex
24
- .mx-auto
25
- = render partial: 'pagination', locals: { collection: @collection }
29
+ = render partial: 'pagination', locals: { collection: @collection }
26
30
 
27
31
  .row
28
32
  .col-12
@@ -1,6 +1,6 @@
1
1
  .row
2
2
  .col-12
3
- %h1= t('.title', inflections)
3
+ %h1= t('.title', **inflections)
4
4
 
5
5
  .row
6
6
  .col-12
@@ -1,6 +1,6 @@
1
1
  .row
2
2
  .col-12
3
- %h1= t('.title', inflections)
3
+ %h1= t('.title', **inflections)
4
4
 
5
5
  .row
6
6
  .col-12
@@ -1,6 +1,6 @@
1
1
  .row
2
2
  .col-12
3
- %h1= t('.title', inflections)
3
+ %h1= t('.title', **inflections)
4
4
 
5
5
  .row
6
6
  .col-12
@@ -1,5 +1,5 @@
1
1
  !!!
2
- %html{:lang => I18n.locale }
2
+ %html{ lang: I18n.locale, class: "h-100" }
3
3
  %head
4
4
  / Required meta tags
5
5
  %meta{:charset => "utf-8"}/
@@ -8,8 +8,9 @@
8
8
  %link{:crossorigin => "anonymous", :href => "https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css", :integrity => "sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS", :rel => "stylesheet"}/
9
9
  / Font Awesome CSS
10
10
  %link{:crossorigin => "anonymous", :href => "https://use.fontawesome.com/releases/v5.6.3/css/all.css", :integrity => "sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/", :rel => "stylesheet"}/
11
- / Fonts
11
+ / Fonts CSS
12
12
  %link{:href => "https://fonts.googleapis.com/css?family=Poppins", :rel => "stylesheet"}/
13
+
13
14
  / jQuery JS
14
15
  %script{:crossorigin => "anonymous", :integrity => "sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=", :src => "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"}
15
16
  / jQuery UI JS
@@ -17,13 +18,13 @@
17
18
  / jQuery redirect JS
18
19
  %script{:src => "https://cdn.jsdelivr.net/npm/jquery.redirect@1.1.4/jquery.redirect.min.js"}
19
20
 
20
- - Administrador::Configuration.engines.each do |engine, options|
21
- = "<!-- Javascript for #{engine} -->".html_safe
22
- = javascript_include_tag engine.underscore.gsub('/', '_').gsub('_engine', '')
21
+ - Administrador::RegisteredEngine.all.each do |registered_engine|
22
+ = "<!-- Javascript for #{registered_engine} -->".html_safe
23
+ = javascript_include_tag registered_engine.engine_class.name.underscore.gsub('/', '_').gsub('_engine', '')
23
24
 
24
- - Administrador::Configuration.engines.each do |engine, options|
25
- = "<!-- CSS for #{engine} -->".html_safe
26
- = stylesheet_link_tag engine.underscore.gsub('/', '_').gsub('_engine', ''), media: "all"
25
+ - Administrador::RegisteredEngine.all.each do |registered_engine|
26
+ = "<!-- CSS for #{registered_engine} -->".html_safe
27
+ = stylesheet_link_tag registered_engine.engine_class.name.underscore.gsub('/', '_').gsub('_engine', ''), media: "all"
27
28
 
28
29
  %title Administrador
29
30
 
@@ -34,22 +35,34 @@
34
35
 
35
36
  = render partial: 'html_head_extras'
36
37
  %body{ administrador_helper(self).body_html }
37
- #main-content
38
+ %main
39
+ #main-navbar
40
+ = render '/administrador/application/navbar'
41
+ #main-content
42
+ .container-fluid
43
+ .row
44
+ .col-12.px-0
45
+ #main-breadcrumbs.container-fluid
46
+ .row
47
+ .col-12
48
+ = breadcrumbs(self).render
49
+ #main-container.container-fluid
50
+ .row
51
+ .col-12
52
+ #flash-messages
53
+ = administrador_helper(self).flash_messages
54
+ = yield
55
+
56
+ %footer#page-footer.mt-auto.bg-dark.text-white.py-3
38
57
  .container-fluid
39
58
  .row
40
- .col-12.px-0
41
- #main-navbar.mb-4
42
- = render '/administrador/application/navbar'
43
- #main-breadcrumbs.container-fluid
44
- .row
45
- .col-12
46
- = breadcrumbs(self).render
47
- #main-container.container-fluid
48
- .row
49
- .col-12
50
- #flash-messages
51
- = administrador_helper(self).flash_messages
52
- = yield
59
+ .col-12.d-flex
60
+ .ml-auto
61
+ .small
62
+ Administrador
63
+ = Administrador::VERSION
64
+ by
65
+ = link_to("BeeGood IT", "https://www.beegoodit.de/", target: "_blank")
53
66
 
54
67
  = render "/administrador/application/sidebars/engine"
55
68
 
@@ -74,4 +74,7 @@ de:
74
74
  first: "<<"
75
75
  next: ">"
76
76
  last: ">>"
77
- previous: "<"
77
+ previous: "<"
78
+ truncate: "…"
79
+ pagination_size:
80
+ all: "Alle"
@@ -74,4 +74,7 @@ en:
74
74
  first: "<<"
75
75
  next: ">"
76
76
  last: ">>"
77
- previous: "<"
77
+ previous: "<"
78
+ truncate: "…"
79
+ pagination_size:
80
+ all: "All"
@@ -4,13 +4,17 @@ module Administrador
4
4
  yield self
5
5
  end
6
6
 
7
- mattr_accessor(:engines) { {} }
8
7
  mattr_accessor(:features) { {} }
9
8
  mattr_accessor(:resource_label_methods) { [:human, :name, :email, :to_s] }
10
9
  mattr_accessor(:base_controller_class_name) { '::ApplicationController' }
10
+ mattr_accessor(:initial_engine_sidebar_state) { :closed }
11
+
12
+ def self.engines
13
+ Administrador::RegisteredEngine.all
14
+ end
11
15
 
12
16
  def register_engine(name, options = {})
13
- @@engines[name] = Administrador::RegisteredEngine.new(name, options)
17
+ Administrador::RegisteredEngine.create(name: name, options: options)
14
18
  end
15
19
 
16
20
  def enable_feature(name, options = {})
@@ -1,5 +1,7 @@
1
1
  module Administrador
2
2
  class Feature
3
+ attr_reader :options
4
+
3
5
  def initialize(name, options = {})
4
6
  @name, @options = name, options
5
7
  end
@@ -20,7 +20,7 @@ module Administrador
20
20
  # require 'example_app/configuration'
21
21
  # Administrador.configure { |c| c.register_engine('ExampleApp::Application', {}) }
22
22
  #
23
- # You will need to add a confifguration module:
23
+ # You will need to add a configuration module:
24
24
  #
25
25
  # # lib/example_app/configuration.rb
26
26
  # module ExampleApp
@@ -35,19 +35,50 @@ module Administrador
35
35
  class RegisteredEngine
36
36
  attr_accessor :options, :name
37
37
 
38
- def initialize(name, options)
38
+ @store = []
39
+
40
+ def self.create(attributes = {})
41
+ @store << new(attributes)
42
+ end
43
+
44
+ def self.all
45
+ @store
46
+ end
47
+
48
+ def self.find_by_name(name)
49
+ @store.find { |re| re[:name] == name }
50
+ end
51
+
52
+ def self.find_by_class(klass)
53
+ @store.find { |re| re.engine_class == klass }
54
+ end
55
+
56
+ def self.find_by_class!(klass)
57
+ engine = @store.find { |re| re.engine_class == klass }
58
+ raise "Could not find engine #{klass}" if engine.nil?
59
+ engine
60
+ end
61
+
62
+ def self.find_by_class_name(class_name)
63
+ @store.find { |re| re.engine_class.name == class_name }
64
+ end
65
+
66
+ def initialize(attributes = {})
67
+ options = attributes.delete(:options)
39
68
  options.reverse_merge!(
40
69
  show_in_engine_sidebar: true
41
70
  )
42
- @name, @options = name, options
71
+ attributes.merge(options: options).each do |key, value|
72
+ send("#{key}=", value)
73
+ end
43
74
  end
44
75
 
45
- def engine
76
+ def engine_class
46
77
  @name.constantize
47
78
  end
48
79
 
49
80
  def main_app?
50
- engine.ancestors.include?(::Rails::Application)
81
+ engine_class.ancestors.include?(::Rails::Application)
51
82
  end
52
83
 
53
84
  def to_key
@@ -59,7 +90,7 @@ module Administrador
59
90
  end
60
91
 
61
92
  def translated_name
62
- I18n.t("classes.#{engine.name.underscore}")
93
+ I18n.t("classes.#{engine_class.name.underscore}")
63
94
  end
64
95
 
65
96
  def router_name
@@ -80,7 +111,7 @@ module Administrador
80
111
  elsif configuration.respond_to?(:resources_controllers)
81
112
  configuration.resources_controllers.call
82
113
  else
83
- Rails.logger.warn("Administrador: The namespace #{engine.name.deconstantize} either does not define a Configuration class or the class #{engine.name.deconstantize}::Configuration does not respond_to :resources_controllers.")
114
+ Rails.logger.warn("Administrador: The namespace #{engine_class.name.deconstantize} either does not define a Configuration class or the class #{engine_class.name.deconstantize}::Configuration does not respond_to :resources_controllers.")
84
115
  []
85
116
  end
86
117
  end
@@ -89,7 +120,7 @@ module Administrador
89
120
  if configuration.respond_to?(:resource_controllers)
90
121
  configuration.resource_controllers.call
91
122
  else
92
- Rails.logger.warn("Administrador: The namespace #{engine.name.deconstantize} either does not define a Configuration class or the class #{engine.name.deconstantize}::Configuration does not respond_to :resource_controllers.")
123
+ Rails.logger.warn("Administrador: The namespace #{engine_class.name.deconstantize} either does not define a Configuration class or the class #{engine_class.name.deconstantize}::Configuration does not respond_to :resource_controllers.")
93
124
  []
94
125
  end
95
126
  end
@@ -100,7 +131,7 @@ module Administrador
100
131
  elsif configuration.respond_to?(:service_controllers)
101
132
  configuration.service_controllers.call
102
133
  else
103
- Rails.logger.warn("Administrador: The namespace #{engine.name.deconstantize} either does not define a Configuration class or the class #{engine.name.deconstantize}::Configuration does not respond_to :service_controllers.")
134
+ Rails.logger.warn("Administrador: The namespace #{engine_class.name.deconstantize} either does not define a Configuration class or the class #{engine_class.name.deconstantize}::Configuration does not respond_to :service_controllers.")
104
135
  []
105
136
  end
106
137
  end
@@ -109,7 +140,7 @@ module Administrador
109
140
  if configuration.respond_to?(:sidebar_controllers)
110
141
  configuration.sidebar_controllers.call
111
142
  else
112
- Rails.logger.warn("Administrador: The namespace #{engine.name.deconstantize} either does not define a Configuration class or the class #{engine.name.deconstantize}::Configuration does not respond_to :sidebar_controllers.")
143
+ Rails.logger.warn("Administrador: The namespace #{engine_class.name.deconstantize} either does not define a Configuration class or the class #{engine_class.name.deconstantize}::Configuration does not respond_to :sidebar_controllers.")
113
144
  []
114
145
  end
115
146
  end
@@ -1,3 +1,3 @@
1
1
  module Administrador
2
- VERSION = '0.0.28.pre'.freeze
2
+ VERSION = '0.0.29.pre'.freeze
3
3
  end
data/lib/administrador.rb CHANGED
@@ -12,6 +12,7 @@ require "simple_form-datetimepicker"
12
12
  require "simple_sidebar"
13
13
  require "bootstrap4-kaminari-views"
14
14
  require "rails-i18n"
15
+ require "administrador/version"
15
16
  require "administrador/feature"
16
17
  require "administrador/configuration"
17
18
  require "administrador/engine"
@@ -12,13 +12,19 @@ Administrador.configure do |config|
12
12
  #
13
13
  config.base_controller_class_name = '::ApplicationController'
14
14
 
15
+ # Initial state of the engine sidebar. Can be :open or :closed.
16
+ #
17
+ # Default: config.initial_engine_sidebar_state = :closed
18
+ #
19
+ config.initial_engine_sidebar_state = :closed
20
+
15
21
  # Enable additional features here.
16
22
  #
17
- # config.enable_feature(:kaminari, {})
23
+ # config.enable_feature(:kaminari, { per_page_default: 10 })
18
24
  # config.enable_feature(:rao_query, {})
19
25
 
20
26
  # Engines that are registered will be shown in the administrador main menu
21
27
  # sidebar. Additionally they can register sidebars.
22
28
  #
23
- # config.register_engine 'Ecm::Blog::Backend::Engine', {}
29
+ # config.register_engine 'Cmor::Blog::Backend::Engine', {}
24
30
  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.28.pre
4
+ version: 0.0.29.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: 2020-10-25 00:00:00.000000000 Z
11
+ date: 2022-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 5.2.0
19
+ version: '6.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 5.2.0
26
+ version: '6.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: coffee-rails
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - ">="
130
130
  - !ruby/object:Gem::Version
131
- version: 0.0.23.pre
131
+ version: 0.0.48.pre
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
- version: 0.0.23.pre
138
+ version: 0.0.48.pre
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: route_translator
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -184,14 +184,14 @@ dependencies:
184
184
  requirements:
185
185
  - - ">="
186
186
  - !ruby/object:Gem::Version
187
- version: 0.0.4.pre
187
+ version: 0.0.6.pre
188
188
  type: :runtime
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - ">="
193
193
  - !ruby/object:Gem::Version
194
- version: 0.0.4.pre
194
+ version: 0.0.6.pre
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: bootstrap4-kaminari-views
197
197
  requirement: !ruby/object:Gem::Requirement
@@ -226,14 +226,14 @@ dependencies:
226
226
  requirements:
227
227
  - - "~>"
228
228
  - !ruby/object:Gem::Version
229
- version: 1.3.6
229
+ version: '1.4'
230
230
  type: :development
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - "~>"
235
235
  - !ruby/object:Gem::Version
236
- version: 1.3.6
236
+ version: '1.4'
237
237
  - !ruby/object:Gem::Dependency
238
238
  name: capybara-screenshot
239
239
  requirement: !ruby/object:Gem::Requirement
@@ -402,7 +402,7 @@ files:
402
402
  - app/assets/javascripts/administrador.js
403
403
  - app/assets/javascripts/administrador/application.js
404
404
  - app/assets/javascripts/administrador/application/keep.js
405
- - app/assets/javascripts/administrador/application/sidebar.js.coffee~
405
+ - app/assets/javascripts/administrador/application/pagination_size.js.coffee
406
406
  - app/assets/stylesheets/administrador.css
407
407
  - app/assets/stylesheets/administrador/application.css
408
408
  - app/assets/stylesheets/administrador/application/bootstrap-btn-responsive.css
@@ -411,15 +411,16 @@ files:
411
411
  - app/assets/stylesheets/administrador/application/bootstrap-table-xs.css
412
412
  - app/assets/stylesheets/administrador/application/breadcrumbs.css
413
413
  - app/assets/stylesheets/administrador/application/colors.css
414
- - app/assets/stylesheets/administrador/application/engine-sidebar.css
414
+ - app/assets/stylesheets/administrador/application/engines.css
415
415
  - app/assets/stylesheets/administrador/application/forms.css
416
416
  - app/assets/stylesheets/administrador/application/layout.css
417
417
  - app/assets/stylesheets/administrador/application/page-actions.css
418
+ - app/assets/stylesheets/administrador/application/pagination.css
418
419
  - app/assets/stylesheets/administrador/application/query_form.css
419
420
  - app/assets/stylesheets/administrador/application/sidebar-theme.css
420
- - app/assets/stylesheets/administrador/application/sidebar.css~
421
421
  - app/concerns/administrador/controller/application_concern.rb
422
422
  - app/concerns/administrador/controller/engine_concern.rb
423
+ - app/concerns/administrador/controller/engine_sidebar_concern.rb
423
424
  - app/concerns/administrador/controller/resource_concern.rb
424
425
  - app/concerns/administrador/controller/resources_concern.rb
425
426
  - app/concerns/administrador/controller/service_concern.rb
@@ -446,6 +447,7 @@ files:
446
447
  - app/views/administrador/application/sidebars/_user.html.haml
447
448
  - app/views/administrador/application_view_helper/_flash_messages.html.haml
448
449
  - app/views/administrador/application_view_helper/_render_engine_sidebars.html.haml
450
+ - app/views/administrador/application_view_helper/_render_registered_engine_widget.html.haml
449
451
  - app/views/administrador/home/_html_head_extras.html.haml
450
452
  - app/views/administrador/home/index.de.html.haml
451
453
  - app/views/administrador/home/index.en.html.haml
@@ -477,7 +479,6 @@ files:
477
479
  - app/views/administrador/resources_controller/base/_index_actions.html.haml
478
480
  - app/views/administrador/resources_controller/base/_index_table.html.haml
479
481
  - app/views/administrador/resources_controller/base/_index_table_actions.html.haml
480
- - app/views/administrador/resources_controller/base/_index_table_actions.html.haml~
481
482
  - app/views/administrador/resources_controller/base/_new_actions.html.haml
482
483
  - app/views/administrador/resources_controller/base/_pagination.html.haml
483
484
  - app/views/administrador/resources_controller/base/_query_form.html.haml
@@ -527,14 +528,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
527
528
  requirements:
528
529
  - - ">="
529
530
  - !ruby/object:Gem::Version
530
- version: 2.4.4
531
+ version: 2.6.6
531
532
  required_rubygems_version: !ruby/object:Gem::Requirement
532
533
  requirements:
533
534
  - - ">"
534
535
  - !ruby/object:Gem::Version
535
536
  version: 1.3.1
536
537
  requirements: []
537
- rubygems_version: 3.1.4
538
+ rubygems_version: 3.2.3
538
539
  signing_key:
539
540
  specification_version: 4
540
541
  summary: Administrador - The rails administration interface.
@@ -1,104 +0,0 @@
1
- # Usage:
2
- #
3
- # Put all the content that is not in the sidebar in a container with the id #main-content a trigger button and add a sidebar.
4
- #
5
- # <body>
6
- # <div id="main-content">
7
- # <button data-sidebar-trigger="#example-sidebar">
8
- # Toggle the example sidebar!
9
- # </button>
10
- # </div>
11
- # <aside
12
- # id="example-sidebar">
13
- # data-sidebar-load="/de/backend/authentifizierung/user_sidebar.html"
14
- # data-sidebar-mode="overlay"
15
- # data-sidebar-position="right"
16
- # data-sidebar-size="20rem"
17
- # data-sidebar-state="closed"
18
- # <h3>Hello from the example sidebar!</h3>
19
- # </aside>
20
- # </body>
21
- #
22
- # Options:
23
- #
24
- # load: Passing an url to load will load the content of the url via ajax and display it in the sidebar.
25
- # mode:
26
- # push: This will decrease the size of the main content, making room for the sidebar.
27
- # overlay: This will show the sidebar on top of the content, without moving it.
28
- # modal: Like overlay, but with a modal background.
29
- # position: left|right|top|bottom
30
- # size: size that the sidebar will take up (width for left and right, height for top and bottom). Pass any css size in px, rem or whatever you like.
31
- #
32
- $ ->
33
- $('body').on 'click', '#sidebar-modal-background', ->
34
- target = $("##{$(@).data('sidebar-target')}")
35
- closeModal(target)
36
-
37
- $('[data-sidebar-position]').each (_, e) ->
38
- position = $(@).data('sidebar-position')
39
- $(e).addClass("sidebar sidebar-#{position}")
40
- if $(@).data('sidebar-state') == 'opened'
41
- openModal($(@))
42
-
43
- $('[data-sidebar-trigger]').on 'click', ->
44
- target = $($(@).data('sidebar-trigger'))
45
- state = target.data('sidebar-state')
46
-
47
- if state == 'closed'
48
- openModal(target)
49
- else
50
- closeModal(target)
51
-
52
- openModal = (target) ->
53
- main_content = $('#main-content')
54
-
55
- position = target.data('sidebar-position')
56
- mode = target.data('sidebar-mode')
57
- size_attribute = if position in ['top', 'bottom'] then 'height' else 'width'
58
- size = target.data('sidebar-size')
59
-
60
- target.css("display", "inherit")
61
- target.css(size_attribute, size)
62
- main_content.css("margin-#{position}", size) if mode == 'push'
63
-
64
-
65
- # modal
66
- if mode == 'modal'
67
- $("body").append("<div id=\"sidebar-modal-background\" data-sidebar-target=\"#{target.attr('id')}\"></div>")
68
-
69
- # load
70
- if target.data('sidebar-load')
71
- url = target.data('sidebar-load')
72
- $.ajax
73
- type: 'GET'
74
- url: url
75
- success: (response) ->
76
- $(target).html(response)
77
- return
78
-
79
- # set state
80
- target.data('sidebar-state', 'opened')
81
-
82
- closeModal = (target) ->
83
- main_content = $('#main-content')
84
-
85
- position = target.data('sidebar-position')
86
- mode = target.data('sidebar-mode')
87
- size_attribute = if position in ['top', 'bottom'] then 'height' else 'width'
88
- size = target.data('sidebar-size')
89
-
90
- # push
91
- if mode == 'push'
92
- main_content.css("margin-#{position}", size)
93
-
94
- # modal
95
- if mode == 'modal'
96
- $("#sidebar-modal-background").remove()
97
-
98
- target.css(size_attribute, '0px')
99
-
100
- if mode == 'push'
101
- main_content.css("margin-#{position}", '0px')
102
-
103
- # set state
104
- target.data('sidebar-state', 'closed')
@@ -1,17 +0,0 @@
1
- #sidebar-engines .administrador-engine-actions {
2
- width: 1rem;
3
- min-height: 1px;
4
- margin-right: 1rem;
5
- }
6
-
7
- #sidebar-engines .administrador-engine-resources-count {
8
- width: 1rem;
9
- }
10
-
11
- #sidebar-engines .administrador-engine a {
12
- color: grey;
13
- }
14
-
15
- #sidebar-engines .administrador-engine .badge-pill {
16
- min-width: 1.75rem;
17
- }
@@ -1,51 +0,0 @@
1
- .sidebar {
2
- position: fixed;
3
- z-index: 3000;
4
- overflow-x: hidden;
5
- transition: 0.5s;
6
- }
7
-
8
- .sidebar-left {
9
- height: 100%;
10
- width: 0;
11
- top: 0;
12
- left: 0;
13
- }
14
- .sidebar-right {
15
- height: 100%;
16
- width: 0;
17
- top: 0;
18
- right: 0;
19
- }
20
- .sidebar-top {
21
- width: 100%;
22
- height: 0;
23
- left: 0;
24
- top: 0;
25
- }
26
- .sidebar-bottom {
27
- width: 100%;
28
- height: 0;
29
- left: 0;
30
- bottom: 0;
31
- }
32
-
33
- #sidebar-modal-background {
34
- position: fixed;
35
- z-index: 2000;
36
- left: 0;
37
- top: 0;
38
- width: 100%;
39
- height: 100%;
40
- background-color: rgb(0,0,0);
41
- background-color: rgba(0,0,0,0.4);
42
- }
43
-
44
- #main-content {
45
- transition: margin .5s;
46
- }
47
-
48
- /* @media screen and (max-height: 450px) {
49
- .sidebar {padding-top: 15px;}
50
- .sidebar a {font-size: 18px;}
51
- } */
@@ -1,16 +0,0 @@
1
- = table.column(:actions, title: false) do |resource|
2
- - capture_haml do
3
- .w-100.d-flex
4
- .btn-group.ml-auto
5
- - if available_rest_actions.include?(:show)
6
- = link_to({ action: :show, id: resource.to_param }, class: 'show btn btn-xs btn-responsive btn-primary') do
7
- %i.fas.fa-eye
8
- %span.btn-text= t('.show')
9
- - if available_rest_actions.include?(:edit)
10
- = link_to({ action: :edit, id: resource.to_param }, class: 'edit btn btn-xs btn-responsive btn-secondary') do
11
- %i.fas.fa-edit
12
- %span.btn-text= t('.edit')
13
- - if available_rest_actions.include?(:destroy)
14
- = link_to({ action: :show, id: resource.to_param }, class: 'destroy btn btn-xs btn-responsive btn-danger', method: :delete, 'data-confirm': I18n.t('administrador.controller.confirmations.destroy')) do
15
- %i.fas.fa-fire
16
- %span.btn-text= t('.destroy')