administrador 0.0.9.pre → 0.0.10.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/administrador/application.js +2 -1
- data/app/assets/stylesheets/administrador/application/engine-sidebar.css +13 -3
- data/app/assets/stylesheets/administrador/application/layout.css +1 -26
- data/app/assets/stylesheets/administrador/application/sidebar-theme.css +6 -0
- data/app/assets/stylesheets/administrador/application.css +1 -0
- data/app/concerns/administrador/controller/application_concern.rb +0 -1
- data/app/controllers/administrador/sidebar_controller/base.rb +5 -3
- data/app/views/administrador/application/_navbar.html.haml +3 -3
- data/app/views/administrador/application/sidebars/_engine.html.haml +26 -25
- data/app/views/administrador/application_view_helper/_render_engine_sidebars.html.haml +6 -3
- data/app/views/layouts/administrador/application.html.haml +13 -18
- data/config/locales/de.yml +0 -2
- data/lib/administrador/version.rb +1 -1
- data/lib/administrador.rb +1 -0
- metadata +17 -5
- data/app/view_helpers/administrador/offcanvas_view_helper.rb +0 -8
- data/app/views/administrador/application/_main_sidebar_right.html.haml +0 -1
- data/app/views/offcanvas_view_helper/_offcanvas.html.erb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccf355a462b3ac438d1d0150a61fb3f75817feb427720bd7eb050ff5838f0944
|
4
|
+
data.tar.gz: 399cc94c0c8316678db40b523e368799f8c83d9bf88d921336fc855dba5ea130
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c2b00af3c5b04263e8cd06cb1545481be67450ee0b2eea837ab0f48ee0fa69dc27f6b00c2909b34966ae75db8bd99c3e6c7fd7583bdca53741eecd150793c29
|
7
|
+
data.tar.gz: 774c0776c61d23bbdb8177b9202d59192aecee2a51117e0b090cec7739a99e9262b2252a5cdebd50521ba9e7ac81452669e8f059c6d9e7da695ec757a01a12c9
|
@@ -1,7 +1,17 @@
|
|
1
|
-
#
|
1
|
+
#sidebar-engines .administrador-engine-actions {
|
2
|
+
width: 1rem;
|
3
|
+
min-height: 1px;
|
2
4
|
margin-right: 1rem;
|
3
5
|
}
|
4
6
|
|
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;
|
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
|
+
}
|
@@ -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
|
-
|
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#
|
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{
|
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#
|
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
|
7
|
-
%
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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
|
-
|
15
|
-
%
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
%
|
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
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
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
|
-
%
|
31
|
-
%
|
32
|
-
|
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
|
-
|
4
|
-
|
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
|
-
|
42
|
-
.
|
43
|
-
.
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
.
|
48
|
-
.
|
49
|
-
|
50
|
-
|
51
|
-
.
|
52
|
-
.
|
53
|
-
|
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
|
data/config/locales/de.yml
CHANGED
data/lib/administrador.rb
CHANGED
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.
|
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-
|
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>
|