administrador 0.0.9.pre → 0.0.10.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: 46048331e06682dab34b2e1c9547ec55069fc7e8808b58c895c2aec832e59c60
4
- data.tar.gz: 2268651c5949d3d63ab414ecfbd9b0492dec267edf2bacbb06f39eafb014ec4f
3
+ metadata.gz: ccf355a462b3ac438d1d0150a61fb3f75817feb427720bd7eb050ff5838f0944
4
+ data.tar.gz: 399cc94c0c8316678db40b523e368799f8c83d9bf88d921336fc855dba5ea130
5
5
  SHA512:
6
- metadata.gz: eb7ed2cd43aa10b92f6d9447f084bf5c073d06a736372080cbd120351a92bc7cf7998a7fade196b27ccf17925c645bbd81bb2830fd26f1e782d32481078a5b11
7
- data.tar.gz: 2a6a06e9f69e3224050ecb876aba79d72c64d0f0d5c335b0df79c28d91a306eba8e261f75932de17e800a00d7ec2b5cf31b9ef369cc7ba66285e787fbbf69869
6
+ metadata.gz: 4c2b00af3c5b04263e8cd06cb1545481be67450ee0b2eea837ab0f48ee0fa69dc27f6b00c2909b34966ae75db8bd99c3e6c7fd7583bdca53741eecd150793c29
7
+ data.tar.gz: 774c0776c61d23bbdb8177b9202d59192aecee2a51117e0b090cec7739a99e9262b2252a5cdebd50521ba9e7ac81452669e8f059c6d9e7da695ec757a01a12c9
@@ -13,4 +13,5 @@
13
13
  //= require rails-ujs
14
14
  //= require activestorage
15
15
  //= require rao-component/acts_as_list
16
- //= require_tree .
16
+ //= require simple_sidebar
17
+ //= require_tree ./application
@@ -1,7 +1,17 @@
1
- #engine-sidebar .administrador-object-count {
1
+ #sidebar-engines .administrador-engine-actions {
2
+ width: 1rem;
3
+ min-height: 1px;
2
4
  margin-right: 1rem;
3
5
  }
4
6
 
5
- #engine-sidebar .list-group-item {
6
- padding: 0.2rem 0.3rem;
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;
7
17
  }
@@ -13,29 +13,4 @@ body {
13
13
 
14
14
  #main-navbar-tools .navbar-nav li {
15
15
  margin-left: 0.75rem;
16
- }
17
-
18
- #main-sidebar {
19
- padding: 0;
20
- }
21
-
22
- @media (min-width: 768px) {
23
- #main-sidebar {
24
- min-height: 100vh;
25
- }
26
-
27
- #main-sidebar > .container-fluid > .row {
28
- height: 100vh;
29
- }
30
- }
31
-
32
- #main-sidebar-bottom-content {
33
- width: 100%;
34
- display: flex;
35
- justify-content: space-between;
36
- flex-wrap: wrap;
37
- }
38
-
39
- #main-sidebar-bottom-content .btn {
40
- margin-bottom: 0.75rem;
41
- }
16
+ }
@@ -0,0 +1,6 @@
1
+ .sidebar {
2
+ background-color: white;
3
+ }
4
+ .sidebar-left.sidebar-push, .sidebar-right.sidebar-push {
5
+ margin-top: 4rem;
6
+ }
@@ -10,6 +10,7 @@
10
10
  * files in this directory. Styles in this file should be added after the last require_* statement.
11
11
  * It is generally better to create a new file per style scope.
12
12
  *
13
+ *= require simple_sidebar
13
14
  *= require_tree ./application
14
15
  *= require_self
15
16
  */
@@ -5,7 +5,6 @@ module Administrador
5
5
 
6
6
  included do
7
7
  view_helper Administrador::ApplicationViewHelper, as: :administrador_helper
8
- view_helper Administrador::OffcanvasViewHelper, as: :offcanvas
9
8
  view_helper Administrador::BreadcrumbsViewHelper, as: :breadcrumbs
10
9
 
11
10
  prepend Administrador::EngineRoutable::LocalizedConcern
@@ -3,9 +3,11 @@ module Administrador
3
3
  class Base < Administrador::ApplicationController
4
4
  layout false
5
5
 
6
- def self.icon_name
7
- :'ellipsis-v'
8
- end
6
+ def self.icon_name; end
7
+ def self.sidebar_position; end
8
+ def self.sidebar_size; end
9
+ def self.sidebar_url; end
10
+ def self.sidebar_mode; end
9
11
 
10
12
  def show
11
13
  respond_to do |format|
@@ -2,13 +2,13 @@
2
2
  #main-navbar-content
3
3
  %ul.navbar-nav
4
4
  %li.nav-item
5
- %button.btn.btn-circle.btn-lg.btn-light#engine-sidebar-trigger
5
+ %button.btn.btn-circle.btn-lg.btn-light{ data: { sidebar: { trigger: '#sidebar-engines' } } }
6
6
  %i.fas.fa-bars
7
7
  #main-navbar-tools
8
8
  %ul.navbar-nav
9
9
  - administrador_helper(self).engines.each do |_, engine|
10
10
  - engine.sidebar_controllers.each do |sc|
11
11
  %li.nav-item
12
- %button.btn.btn-circle.btn-lg.btn-light{ id: "#{sc.name.underscore.gsub('/', '-')}-trigger" }
13
- %i.fas{ class: "fa-#{sc.icon_name}"}
12
+ %button.btn.btn-circle.btn-lg.btn-light{ data: { sidebar: { trigger: "#sidebar-#{sc.name.underscore.gsub('/', '-')}" } } }
13
+ %i.fas{ class: "fa-#{(sc.icon_name || :'ellipsis-v')}"}
14
14
 
@@ -1,32 +1,33 @@
1
- %aside#engine-sidebar.py-2
1
+ %aside#sidebar-engines.p-2.pr-0{ data: { sidebar: { position: :left, size: '20rem', state: :closed, mode: :push } } }
2
2
  .container-fluid
3
3
  .row
4
4
  .col-12
5
5
  - administrador_helper(self).engines.each do |_, engine|
6
- .administrador-engine-in-sidebar.mb-4{ id: dom_id(engine), class: dom_class(engine) }
7
- %h5.administrador-engine-name= engine.translated_name
8
- .list-group
9
- %a.list-group-item.administrador-link-to-engine-home{ href: send(engine.router_name).root_path }
10
- %i.fas.fa-home
11
- %span.hidden-sm-down.small= t('.home')
6
+ .administrador-engine.mb-4.text-secondary{ id: dom_id(engine), class: dom_class(engine) }
7
+ %h6.text-uppercase.administrador-engine-name
8
+ %i.fas.fa-home
9
+ = link_to(send(engine.router_name).root_path, class: 'administrador-link-to-engine-home') do
10
+ = engine.translated_name
11
+ %ul.list-group.list-group-flush
12
12
  - engine.resources_controllers.each do |rc|
13
- .list-group-item
14
- %a.administrador-link-to-resources{ href: send(engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :index) }
15
- %i.fas.fa-folder
16
- %span.hidden-sm-down.small= rc.resource_class.model_name.human(count: :other)
17
- - if rc.available_rest_actions.include?(:new)
18
- %a.float-right.btn.btn-xs.btn-primary.administrador-link-to-new-resources{ href: send(engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :new) }
19
- %i.fas.fa-plus
20
- %span.administrador-object-count.float-right.badge.badge-pill.badge-light= rc.resource_count
13
+ %li.list-group-item
14
+ .administrador-engine-resources-count.float-right
15
+ %span.badge.badge-pill.badge-success= rc.resource_count
16
+ .administrador-engine-actions.float-right
17
+ - if rc.available_rest_actions.include?(:new)
18
+ %a.administrador-link-to-new-resources{ href: send(engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :new) }
19
+ %i.fas.fa-plus
20
+ %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' : ''}" }
21
+ = rc.resource_class.model_name.human(count: :other)
21
22
  - engine.resource_controllers.each do |rc|
22
- .list-group-item
23
- %a.administrador-link-to-resources{ href: send(engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :show) }
24
- %i.fas.fa-file
25
- %span.hidden-sm-down.small= rc.resource_class.model_name.human
26
- - if rc.available_rest_actions.include?(:new)
27
- %a.float-right.btn.btn-xs.btn-primary.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
23
+ %li.list-group-item
24
+ .administrador-engine-actions.float-right
25
+ - if rc.available_rest_actions.include?(:new)
26
+ %a.administrador-link-to-new-resources{ href: send(engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :new) }
27
+ %i.fas.fa-plus
28
+ %a.administrador-link-to-resource{ href: send(engine.router_name).url_for(controller: "/#{rc.name.underscore.gsub('_controller', '')}", action: :show) }
29
+ = rc.resource_class.model_name.human(count: :other)
29
30
  - engine.service_controllers.each do |sc|
30
- %a.list-group-item{ href: send(engine.router_name).url_for(controller: "/#{sc.name.underscore.gsub('_controller', '')}", action: :new) }
31
- %i.fas.fa-running
32
- %span.hidden-sm-down.small= sc.service_class.model_name.human(count: :other)
31
+ %li.list-group-item
32
+ %a.administrador-link-to-service{ href: send(engine.router_name).url_for(controller: "/#{sc.name.underscore.gsub('_controller', '')}", action: :new) }
33
+ = sc.service_class.model_name.human(count: :other)
@@ -1,4 +1,7 @@
1
1
  - engine.sidebar_controllers.each do |sc|
2
- - id = sc.name.underscore.gsub('/', '-')
3
- %aside.py-2{ id: "#{id}-sidebar" }
4
- = offcanvas(self).offcanvas("#{id}-sidebar", modifiers: 'right,overlay', triggerButton: "##{id}-trigger", load: send(engine.router_name).url_for(controller: "/#{sc.name.underscore.gsub('_controller', '')}", action: :show, format: :html, only_path: true) )
2
+ - id = "sidebar-#{sc.name.underscore.gsub('/', '-')}"
3
+ - position = sc.sidebar_position || :right
4
+ - size = sc.sidebar_size || '250px'
5
+ - url = sc.sidebar_url || send(engine.router_name).url_for(controller: "/#{sc.name.underscore.gsub('_controller', '')}", action: :show, format: :html, only_path: true)
6
+ - mode = sc.sidebar_mode || :modal
7
+ %aside.py-2{ id: id, data: { sidebar: { position: position, size: size, state: :closed, mode: :modal, load: url } } }
@@ -8,8 +8,6 @@
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
- / js-offcanvas CSS
12
- %link{:href => "https://unpkg.com/js-offcanvas@1.2.8/dist/_css/prefixed/js-offcanvas.css", :rel => "stylesheet"}/
13
11
  / Fonts
14
12
  %link{:href => "https://fonts.googleapis.com/css?family=Poppins", :rel => "stylesheet"}/
15
13
  / jQuery JS
@@ -18,8 +16,6 @@
18
16
  %script{:crossorigin => "anonymous", :integrity => "sha256-T0Vest3yCU7pafRw9r+settMBX6JkKN06dqBnpQ8d30=", :src => "https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.js"}
19
17
  / jQuery redirect JS
20
18
  %script{:src => "https://cdn.jsdelivr.net/npm/jquery.redirect@1.1.4/jquery.redirect.min.js"}
21
- / js-offcanvas JS
22
- %script{:src => "https://unpkg.com/js-offcanvas@1.2.8/dist/_js/js-offcanvas.pkgd.min.js"}
23
19
 
24
20
  - Administrador::Configuration.engines.each do |engine, options|
25
21
  = "<!-- Javascript for #{engine} -->".html_safe
@@ -38,25 +34,24 @@
38
34
 
39
35
  = render partial: 'html_head_extras'
40
36
  %body{ administrador_helper(self).body_html }
41
- .container-fluid.c-offcanvas-content-wrapper
42
- .row
43
- .col-12.px-0
44
- #main-navbar.mb-4
45
- = render '/administrador/application/navbar'
46
- #main-breadcrumbs.container-fluid
47
- .row
48
- .col-12
49
- = breadcrumbs(self).render
50
- #main-container.container-fluid
51
- .row
52
- .col-12
53
- #main-content
37
+ #main-content
38
+ .container-fluid
39
+ .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
54
50
  #flash-messages
55
51
  = administrador_helper(self).flash_messages
56
52
  = yield
57
53
 
58
54
  = render "/administrador/application/sidebars/engine"
59
- = offcanvas(self).offcanvas("engine-sidebar", modifiers: 'left,overlay', triggerButton: "#engine-sidebar-trigger" )
60
55
 
61
56
  = administrador_helper(self).render_engine_sidebars
62
57
  / Optional JavaScript
@@ -2,8 +2,6 @@ de:
2
2
  administrador:
3
3
  application:
4
4
  sidebars:
5
- engine:
6
- home: 'Home'
7
5
  i18n:
8
6
  title: 'Überseztungen'
9
7
  messages:
@@ -1,3 +1,3 @@
1
1
  module Administrador
2
- VERSION = '0.0.9.pre'.freeze
2
+ VERSION = '0.0.10.pre'.freeze
3
3
  end
data/lib/administrador.rb CHANGED
@@ -8,6 +8,7 @@ require "rao-resource_controller"
8
8
  require "rao-resources_controller"
9
9
  require "rao-service_controller"
10
10
  require "simple_form"
11
+ require "simple_sidebar"
11
12
  require "bootstrap4-kaminari-views"
12
13
  require "rails-i18n"
13
14
  require "administrador/feature"
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.9.pre
4
+ version: 0.0.10.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-04-03 00:00:00.000000000 Z
11
+ date: 2019-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -164,6 +164,20 @@ dependencies:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: simple_sidebar
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: 0.0.4.pre
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: 0.0.4.pre
167
181
  - !ruby/object:Gem::Dependency
168
182
  name: bootstrap4-kaminari-views
169
183
  requirement: !ruby/object:Gem::Requirement
@@ -385,6 +399,7 @@ files:
385
399
  - app/assets/stylesheets/administrador/application/layout.css
386
400
  - app/assets/stylesheets/administrador/application/page-actions.css
387
401
  - app/assets/stylesheets/administrador/application/query_form.css
402
+ - app/assets/stylesheets/administrador/application/sidebar-theme.css
388
403
  - app/assets/stylesheets/administrador/application/sidebar.css~
389
404
  - app/concerns/administrador/controller/application_concern.rb
390
405
  - app/concerns/administrador/controller/engine_concern.rb
@@ -404,8 +419,6 @@ files:
404
419
  - app/models/administrador/application_record.rb
405
420
  - app/view_helpers/administrador/application_view_helper.rb
406
421
  - app/view_helpers/administrador/breadcrumbs_view_helper.rb
407
- - app/view_helpers/administrador/offcanvas_view_helper.rb
408
- - app/views/administrador/application/_main_sidebar_right.html.haml
409
422
  - app/views/administrador/application/_navbar.html.haml
410
423
  - app/views/administrador/application/sidebars/_engine.html.haml
411
424
  - app/views/administrador/application/sidebars/_i18n.html.haml
@@ -469,7 +482,6 @@ files:
469
482
  - app/views/administrador/sidebar_controller/base/show.html.haml
470
483
  - app/views/breadcrumbs/_render.html.haml
471
484
  - app/views/layouts/administrador/application.html.haml
472
- - app/views/offcanvas_view_helper/_offcanvas.html.erb
473
485
  - config/initializers/localized_engines_fix.rb
474
486
  - config/locales/de.yml
475
487
  - config/locales/en.yml
@@ -1,8 +0,0 @@
1
- module Administrador
2
- class OffcanvasViewHelper < Rao::ViewHelper::Base
3
- def offcanvas(id, options = {})
4
- on_open_url = options.delete(:load)
5
- c.render partial: 'offcanvas_view_helper/offcanvas', locals: { id: id, options: options, on_open_url: on_open_url }
6
- end
7
- end
8
- end
@@ -1 +0,0 @@
1
- %aside#offcanvas-right.py-2
@@ -1,11 +0,0 @@
1
- <script>
2
- $(document).ready(function() {
3
- $('#<%= id %>').offcanvas({
4
- <%= options.collect { |k,v| " #{k}: \"#{v}\"" }.join(",\n").html_safe %>
5
- })
6
- <% if on_open_url.present? %>
7
- .on( "open.offcanvas", function( e ){ $( "#<%= id %>" ).load("<%= on_open_url %>"); } )
8
- <% end %>
9
- ;
10
- });
11
- </script>