administrador 0.0.28.pre → 0.0.30.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 +10 -4
  44. metadata +46 -17
  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: 8d0d8000ae9288c26f8ac3a7fc8d21285abd251da3615ac1a878edd84ea83631
4
+ data.tar.gz: 6ca07e3d122594f25b115d4e963d03964024770549b29b42aea4a24470f16cc9
5
5
  SHA512:
6
- metadata.gz: 7a2ed5973892bbcd7d722910984c5847f1fa71664b79f3d7a384342e1fe4dfd54abcecd3519a177023fedc672df270cbc6f0808149c6262d886ec7a0801da0ab
7
- data.tar.gz: a7e951054c9e4a42e25ba8046a8dc7d871b45db07a5928930469792d93f9094a384d1dcce006c629b07eaccf9c00f0047eb501067ccba6d47b80119ad28b62d6
6
+ metadata.gz: c08bf0cfac988d8c3966274567a9611cf0d14c2d765f275a5374de8e6c8dcc70eb24012fe72316b2c497f09eaa0102d17904593cb1f6821ac73a3415f74b1799
7
+ data.tar.gz: a0eaced5fad91caae9fb2e4c93a846c8d52846416707cfc0661cb9d52424c6029d1bdf190741cf584d22a7fc78cd9bdb974ab44f19f71d6dcc48a2a809e1ff5a
@@ -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