pg_rails 7.0.8.pre.alpha.41 → 7.0.8.pre.alpha.42
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/pg_engine/app/admin/users.rb +9 -0
- data/pg_engine/app/controllers/pg_engine/base_controller.rb +1 -1
- data/pg_engine/app/lib/pg_engine/filtros_builder.rb +1 -1
- data/pg_engine/config/locales/es.yml +4 -0
- data/pg_layout/app/assets/stylesheets/sidebar.scss +21 -5
- data/pg_layout/app/lib/navbar.rb +8 -0
- data/pg_layout/app/views/devise/shared/_links.html.erb +1 -1
- data/pg_layout/app/views/layouts/pg_layout/base.html.slim +3 -3
- data/pg_layout/app/views/layouts/pg_layout/devise.html.slim +1 -1
- data/pg_layout/app/views/pg_layout/_navbar.html.erb +4 -57
- data/pg_layout/app/views/pg_layout/_sidebar.html.erb +23 -40
- data/pg_layout/app/views/pg_layout/_sidebar_mobile.html.erb +24 -83
- data/pg_rails/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eae95722a5c742a339e40bffb5495f911f9bc44e77aab21c27ad50019d2db7d2
|
4
|
+
data.tar.gz: ca1e43109b3c16974bc272e35257e6dcae606b2fc195e996436dfbf7860fbd56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07fd10c304f3bfdaa3fef2e08aad45f9f36e0d869c7e68c3a76f82f52e80260871a4d8b129f270d4bea312f05d0b416532d315f5e9413bbc08a1e961750a6666
|
7
|
+
data.tar.gz: 8d0a25184049339ec20bcc7d0fc46eabcde6e9a7cde39795d25d9123163268a4c4b40b76cc610a6edef08e29de9c90a1a59e78ba0a0b34d2d9e47aaf95c9c80d
|
@@ -30,6 +30,11 @@ ActiveAdmin.register User do
|
|
30
30
|
user.skip_confirmation! if action_name == 'create'
|
31
31
|
end
|
32
32
|
|
33
|
+
member_action :confirm, method: :put do
|
34
|
+
resource.update(confirmed_at: Time.zone.now)
|
35
|
+
redirect_to resource_path, notice: 'Confirmed!'
|
36
|
+
end
|
37
|
+
|
33
38
|
member_action :discard, method: :put do
|
34
39
|
resource.discard!
|
35
40
|
redirect_to resource_path, notice: 'Discarded!'
|
@@ -44,6 +49,10 @@ ActiveAdmin.register User do
|
|
44
49
|
link_to 'Discard', discard_active_admin_user_path(resource), method: :put if resource.kept?
|
45
50
|
end
|
46
51
|
|
52
|
+
action_item :view, only: :show do
|
53
|
+
link_to 'Confirm', confirm_active_admin_user_path(resource), method: :put if resource.kept?
|
54
|
+
end
|
55
|
+
|
47
56
|
action_item :view, only: :show do
|
48
57
|
link_to 'Restore', restore_active_admin_user_path(resource), method: :put if resource.discarded?
|
49
58
|
end
|
@@ -322,7 +322,7 @@ module PgEngine
|
|
322
322
|
def filtro_fecha(campo, placeholder = '')
|
323
323
|
content_tag :div, class: 'col-auto' do
|
324
324
|
content_tag :div, class: 'filter' do
|
325
|
-
label_tag(nil, placeholder, class: 'text-
|
325
|
+
label_tag(nil, placeholder, class: 'text-body-secondary') + \
|
326
326
|
date_field_tag(
|
327
327
|
campo, parametros_controller[campo], class: 'form-control form-control-sm d-inline-block w-auto ms-1', placeholder:, autocomplete: 'off'
|
328
328
|
)
|
@@ -2,10 +2,6 @@ html, body {
|
|
2
2
|
height: 100%;
|
3
3
|
}
|
4
4
|
|
5
|
-
.navbar {
|
6
|
-
--#{$prefix}navbar-toggler-border-color: #{$primary};
|
7
|
-
}
|
8
|
-
|
9
5
|
/* Style & Colors */
|
10
6
|
$text-color: $gray-300;
|
11
7
|
$text-hover-color: $gray-100;
|
@@ -95,7 +91,7 @@ $chevron-color: 200,200,200,.5;
|
|
95
91
|
|
96
92
|
&.opened {
|
97
93
|
// display: block!important;
|
98
|
-
flex-basis:
|
94
|
+
flex-basis: 10em;
|
99
95
|
}
|
100
96
|
& > * {
|
101
97
|
width: 9em;
|
@@ -119,3 +115,23 @@ $chevron-color: 200,200,200,.5;
|
|
119
115
|
.btn-toggle[aria-expanded="true"]::before {
|
120
116
|
transform: rotate(90deg);
|
121
117
|
}
|
118
|
+
|
119
|
+
// FLASH
|
120
|
+
#flash-wrapper {
|
121
|
+
position: fixed;
|
122
|
+
right: 0;
|
123
|
+
left: 0;
|
124
|
+
z-index: 1030;
|
125
|
+
}
|
126
|
+
|
127
|
+
@include media-breakpoint-up(md) {
|
128
|
+
#flash-wrapper {
|
129
|
+
top: 0;
|
130
|
+
}
|
131
|
+
}
|
132
|
+
|
133
|
+
@include media-breakpoint-down(md) {
|
134
|
+
#flash-wrapper {
|
135
|
+
bottom: 0;
|
136
|
+
}
|
137
|
+
}
|
data/pg_layout/app/lib/navbar.rb
CHANGED
@@ -2,6 +2,7 @@ class Navbar
|
|
2
2
|
include Rails.application.routes.url_helpers
|
3
3
|
|
4
4
|
attr_reader :extensiones
|
5
|
+
attr_accessor :logo
|
5
6
|
|
6
7
|
def initialize(user)
|
7
8
|
@user = user
|
@@ -19,6 +20,12 @@ class Navbar
|
|
19
20
|
@yaml_data[key] << ActiveSupport::HashWithIndifferentAccess.new(obj)
|
20
21
|
end
|
21
22
|
|
23
|
+
def sidebar
|
24
|
+
ret = bar(@user.present? ? 'sidebar.signed_in' : 'sidebar.not_signed_in')
|
25
|
+
ret.push(*bar('sidebar.developer')) if @user.present? && @user.developer?
|
26
|
+
ret
|
27
|
+
end
|
28
|
+
|
22
29
|
def bar(key)
|
23
30
|
bar_data = @yaml_data[key]
|
24
31
|
return [] if bar_data.blank?
|
@@ -27,6 +34,7 @@ class Navbar
|
|
27
34
|
bar_data.map do |item|
|
28
35
|
{
|
29
36
|
title: item['name'],
|
37
|
+
attributes: item['attributes']&.html_safe, # rubocop:disable Rails/OutputSafety
|
30
38
|
path: eval(item['path']),
|
31
39
|
show: item['policy'] ? eval(item['policy']) : true
|
32
40
|
}
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<%= link_to t(".forgot_your_password"), new_password_path(resource_name) %>
|
12
12
|
<% end %>
|
13
13
|
|
14
|
-
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
14
|
+
<%- if false # devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
15
15
|
<%= link_to t('.didn_t_receive_confirmation_instructions'), new_confirmation_path(resource_name) %>
|
16
16
|
<% end %>
|
17
17
|
|
@@ -22,15 +22,15 @@ html
|
|
22
22
|
meta name="rollbar-token" content="#{@rollbar_token}"
|
23
23
|
meta name="rollbar-env" content="#{Rails.env}"
|
24
24
|
body
|
25
|
+
#flash-wrapper.d-flex.justify-content-around
|
26
|
+
#flash.flash.z-1
|
27
|
+
= render partial: 'pg_layout/flash'
|
25
28
|
= render partial: 'pg_layout/sidebar_mobile'
|
26
29
|
|
27
30
|
div class="#{ @sidebar == false ? '' : 'with-sidebar' }"
|
28
31
|
- unless @sidebar == false
|
29
32
|
= render partial: 'pg_layout/sidebar'
|
30
33
|
div
|
31
|
-
.position-relative.d-flex.justify-content-around
|
32
|
-
#flash.flash.position-absolute.z-1.mt-1
|
33
|
-
= render partial: 'pg_layout/flash'
|
34
34
|
= render partial: 'pg_layout/navbar'
|
35
35
|
div
|
36
36
|
- if user_signed_in? && breadcrumbs.any?
|
@@ -1,67 +1,14 @@
|
|
1
|
-
<nav class="navbar navbar-expand-<%= @breakpoint_navbar_expand %>
|
1
|
+
<nav class="navbar navbar-expand-<%= @breakpoint_navbar_expand %>">
|
2
2
|
<div class="container-fluid">
|
3
3
|
<% unless @sidebar == false %>
|
4
|
-
<button data-controller="navbar" data-action="navbar#expandNavbar" class="btn btn-outline-
|
4
|
+
<button data-controller="navbar" data-action="navbar#expandNavbar" class="btn btn-outline-light me-2 d-none d-<%= @breakpoint_navbar_expand %>-inline-block">
|
5
5
|
<i class="bi bi-list"></i>
|
6
6
|
</button>
|
7
7
|
|
8
|
-
<button class="btn btn-outline-
|
8
|
+
<button class="btn btn-outline-light d-inline-block d-<%= @breakpoint_navbar_expand %>-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasExample" aria-controls="offcanvasExample">
|
9
9
|
<i class="bi bi-list"></i>
|
10
10
|
</button>
|
11
|
-
|
12
11
|
<% end %>
|
13
|
-
|
14
|
-
<%# <button class="navbar-toggler btn btn-outline-primary me-2" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
15
|
-
<i class="bi bi-list"></i>
|
16
|
-
<!-- <span class="navbar-toggler-icon"></span> -->
|
17
|
-
</button> %>
|
18
|
-
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
19
|
-
<ul class="navbar-nav mb-2 mb-lg-0">
|
20
|
-
<% @navbar.bar('topbar.before').each do |entry| %>
|
21
|
-
<li class="nav-item">
|
22
|
-
<a class="nav-link" href="<%= entry[:path] %>">
|
23
|
-
<%= entry[:title] %>
|
24
|
-
</a>
|
25
|
-
</li>
|
26
|
-
<% end %>
|
27
|
-
<% if user_signed_in? %>
|
28
|
-
<li class="nav-item dropdown">
|
29
|
-
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
30
|
-
<%= Current.user %>
|
31
|
-
</a>
|
32
|
-
<ul class="dropdown-menu">
|
33
|
-
<% if policy(Current.user).edit? %>
|
34
|
-
<li>
|
35
|
-
<%= link_to "Mi perfil", edit_user_registration_path, class: 'dropdown-item' %>
|
36
|
-
</li>
|
37
|
-
<% end %>
|
38
|
-
<% @navbar.bar('topbar.dropdown_user').each do |entry| %>
|
39
|
-
<% next if @navbar.hide_entry?(entry) %>
|
40
|
-
<li>
|
41
|
-
<a class="dropdown-item" href="<%= entry[:path] %>">
|
42
|
-
<%= entry[:title] %>
|
43
|
-
</a>
|
44
|
-
</li>
|
45
|
-
<% end %>
|
46
|
-
|
47
|
-
<li>
|
48
|
-
<%= link_to t("devise.sign_out"), destroy_user_session_path, data: { 'turbo-method': 'delete' }, class: 'dropdown-item' %>
|
49
|
-
</li>
|
50
|
-
</ul>
|
51
|
-
</li>
|
52
|
-
<% end %>
|
53
|
-
</ul>
|
54
|
-
<% unless user_signed_in? %>
|
55
|
-
<%= link_to t("devise.sign_up"), new_user_registration_path, class: 'btn btn-success' %>
|
56
|
-
<ul class="navbar-nav mb-2 mb-lg-0">
|
57
|
-
<li class="nav-item">
|
58
|
-
<%= link_to t("devise.sign_in"), new_user_session_path, class: 'nav-link' %>
|
59
|
-
</li>
|
60
|
-
</ul>
|
61
|
-
<% end %>
|
62
|
-
<% @navbar.extensiones.each do |extension| %>
|
63
|
-
<%= extension %>
|
64
|
-
<% end %>
|
65
|
-
</div>
|
12
|
+
<%= @navbar.logo if @navbar.logo.present? %>
|
66
13
|
</div>
|
67
14
|
</nav>
|
@@ -1,42 +1,25 @@
|
|
1
|
-
<div id="sidebar" class="<%= @navbar_opened_class %> flex-shrink-0
|
2
|
-
|
3
|
-
|
1
|
+
<div id="sidebar" class="<%= @navbar_opened_class %> flex-shrink-0 d-none d-<%= @breakpoint_navbar_expand %>-block">
|
2
|
+
<div class="mt-4">
|
3
|
+
<% if user_signed_in? %>
|
4
|
+
<span class="ms-3 text-light"><%= Current.user %></span>
|
4
5
|
<hr>
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
<div class="collapse <%= @navbar.any_children_active?(entry, request) ? 'show' : '' %>" id="<%= 'collapse-' + random_id %>">
|
25
|
-
<ul class="btn-toggle-nav list-unstyled fw-normal pb-1 small">
|
26
|
-
<% entry[:children].each do |child| %>
|
27
|
-
<% next if @navbar.hide_entry?(child) %>
|
28
|
-
<li><a href="<%= child[:path] %>" class="<%= @navbar.active_entry?(child, request) ? 'active' : '' %> d-inline-flex text-decoration-none rounded"><%= child[:title] %></a></li>
|
29
|
-
<% end %>
|
30
|
-
</ul>
|
31
|
-
</div>
|
32
|
-
<% else %>
|
33
|
-
<a href="<%= entry[:path] %>" class="<%= @navbar.active_entry?(entry, request) ? 'active' : '' %> d-inline-flex text-decoration-none ms-4"><%= entry[:title] %></a>
|
34
|
-
<% end %>
|
35
|
-
</li>
|
36
|
-
<% end %>
|
37
|
-
</ul>
|
38
|
-
<hr>
|
39
|
-
</div>
|
40
|
-
</div>
|
41
|
-
<% end %>
|
6
|
+
<% end %>
|
7
|
+
<ul class="list-unstyled ps-0">
|
8
|
+
<% @navbar.sidebar.each do |entry| %>
|
9
|
+
<% next if @navbar.hide_entry?(entry) %>
|
10
|
+
|
11
|
+
<li class="mb-1">
|
12
|
+
<a
|
13
|
+
href="<%= entry[:path] %>"
|
14
|
+
class="
|
15
|
+
d-inline-flex text-decoration-none ms-3
|
16
|
+
<%= @navbar.active_entry?(entry, request) ? 'active' : '' %>"
|
17
|
+
<%= entry[:attributes] %>
|
18
|
+
>
|
19
|
+
<%= entry[:title] %>
|
20
|
+
</a>
|
21
|
+
</li>
|
22
|
+
<% end %>
|
23
|
+
</ul>
|
24
|
+
</div>
|
42
25
|
</div>
|
@@ -4,94 +4,35 @@
|
|
4
4
|
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
|
5
5
|
</div>
|
6
6
|
<div class="offcanvas-body">
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
<% if user_signed_in? %>
|
8
|
+
<span class="text-body-secondary"><%= Current.user %></span>
|
9
|
+
<hr>
|
10
|
+
<% end %>
|
11
|
+
<ul class="list-unstyled mt-4">
|
12
|
+
<% @navbar.sidebar.each do |entry| %>
|
13
|
+
<% next if @navbar.hide_entry?(entry) %>
|
14
|
+
|
15
|
+
<li>
|
16
|
+
<a
|
17
|
+
href="<%= entry[:path] %>"
|
18
|
+
class="<%= @navbar.active_entry?(entry, request) ? 'active' : '' %>"
|
19
|
+
<%= entry[:attributes] %>
|
20
|
+
>
|
11
21
|
<%= entry[:title] %>
|
12
22
|
</a>
|
13
23
|
</li>
|
14
24
|
<% end %>
|
15
|
-
<%
|
16
|
-
|
17
|
-
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
18
|
-
<%= Current.user %>
|
19
|
-
</a>
|
20
|
-
<ul class="dropdown-menu">
|
21
|
-
<% if policy(Current.user).edit? %>
|
22
|
-
<li>
|
23
|
-
<%= link_to "Mi perfil", edit_user_registration_path, class: 'dropdown-item' %>
|
24
|
-
</li>
|
25
|
-
<% end %>
|
26
|
-
<% @navbar.bar('topbar.dropdown_user').each do |entry| %>
|
27
|
-
<% next if @navbar.hide_entry?(entry) %>
|
28
|
-
<li>
|
29
|
-
<a class="dropdown-item" href="<%= entry[:path] %>">
|
30
|
-
<%= entry[:title] %>
|
31
|
-
</a>
|
32
|
-
</li>
|
33
|
-
<% end %>
|
34
|
-
|
35
|
-
<li>
|
36
|
-
<%= link_to t("devise.sign_out"), destroy_user_session_path, data: { 'turbo-method': 'delete' }, class: 'dropdown-item' %>
|
37
|
-
</li>
|
38
|
-
</ul>
|
39
|
-
</li>
|
25
|
+
<% @navbar.extensiones.each do |extension| %>
|
26
|
+
<%= extension %>
|
40
27
|
<% end %>
|
41
28
|
</ul>
|
42
|
-
<% unless user_signed_in? %>
|
43
|
-
<%= link_to t("devise.sign_up"), new_user_registration_path, class: 'btn btn-success' %>
|
44
|
-
<ul class="navbar-nav mb-2 mb-lg-0">
|
45
|
-
<li class="nav-item">
|
46
|
-
<%= link_to t("devise.sign_in"), new_user_session_path, class: 'nav-link' %>
|
47
|
-
</li>
|
48
|
-
</ul>
|
49
|
-
<% end %>
|
50
|
-
<% @navbar.extensiones.each do |extension| %>
|
51
|
-
<%= extension %>
|
52
|
-
<% end %>
|
53
|
-
|
54
|
-
|
55
|
-
<% if user_signed_in? %>
|
56
|
-
<div class="sidebar--large-items">
|
57
|
-
<hr>
|
58
|
-
<%# <div class="sidebar--small-items">
|
59
|
-
<ul class="list-unstyled ps-0">
|
60
|
-
<li class="mb-1 text-center">
|
61
|
-
<a href="javascript:void(0)" class="nav-link" data-bs-toggle="tooltip" data-bs-title="Agenda">
|
62
|
-
<i class="bi bi-calendar"></i>
|
63
|
-
</a>
|
64
|
-
</li>
|
65
|
-
</ul>
|
66
|
-
</div> %>
|
67
|
-
<div class="sidebar--large-items">
|
68
|
-
<ul class="list-unstyled ps-0">
|
69
|
-
<% @navbar.bar('sidebar').each do |entry| %>
|
70
|
-
<% next if @navbar.hide_entry?(entry) %>
|
71
|
-
<% random_id = rand(99999).to_s %>
|
72
|
-
<li class="mb-1">
|
73
|
-
<% if entry[:children].present? %>
|
74
|
-
<button class="btn btn-toggle d-inline-flex align-items-center rounded border-0 collapsed" data-bs-toggle="collapse" data-bs-target="#<%= 'collapse-' + random_id %>" aria-expanded="true">
|
75
|
-
<%= entry[:title] %>
|
76
|
-
</button>
|
77
|
-
<div class="collapse <%= @navbar.any_children_active?(entry, request) ? 'show' : '' %>" id="<%= 'collapse-' + random_id %>">
|
78
|
-
<ul class="btn-toggle-nav list-unstyled fw-normal pb-1 small">
|
79
|
-
<% entry[:children].each do |child| %>
|
80
|
-
<% next if @navbar.hide_entry?(child) %>
|
81
|
-
<li><a href="<%= child[:path] %>" class="<%= @navbar.active_entry?(child, request) ? 'active' : '' %> d-inline-flex text-decoration-none rounded"><%= child[:title] %></a></li>
|
82
|
-
<% end %>
|
83
|
-
</ul>
|
84
|
-
</div>
|
85
|
-
<% else %>
|
86
|
-
<a href="<%= entry[:path] %>" class="<%= @navbar.active_entry?(entry, request) ? 'active' : '' %> d-inline-flex text-decoration-none ms-4"><%= entry[:title] %></a>
|
87
|
-
<% end %>
|
88
|
-
</li>
|
89
|
-
<% end %>
|
90
|
-
</ul>
|
91
|
-
<hr>
|
92
|
-
</div>
|
93
|
-
</div>
|
94
|
-
<% end %>
|
95
|
-
|
96
29
|
</div>
|
97
30
|
</div>
|
31
|
+
<style type="text/css">
|
32
|
+
.offcanvas a {
|
33
|
+
text-decoration: none;
|
34
|
+
}
|
35
|
+
.offcanvas li {
|
36
|
+
margin-top: 0.75em;
|
37
|
+
}
|
38
|
+
</style>
|
data/pg_rails/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pg_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.8.pre.alpha.
|
4
|
+
version: 7.0.8.pre.alpha.42
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martín Rosso
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-04-
|
11
|
+
date: 2024-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|