pg_rails 7.0.8.pre.alpha.40 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e0c75ae98afcfa4e17e28f00db9876e5fe0aa2073a2ed596fb69f4f34511409e
4
- data.tar.gz: 5015d88ae570ea79dd08316aa2abdc9039b00ad34f2d4d19288a76cef25e8273
3
+ metadata.gz: eae95722a5c742a339e40bffb5495f911f9bc44e77aab21c27ad50019d2db7d2
4
+ data.tar.gz: ca1e43109b3c16974bc272e35257e6dcae606b2fc195e996436dfbf7860fbd56
5
5
  SHA512:
6
- metadata.gz: 4fe2178fed0e0d8938718d2cd75fed98b86c116bd682362528e70fd138e31fba9f6372fc1a03f26a5afd42f08278d846076bfcfdf55340720890aba02cefabf4
7
- data.tar.gz: e22997837342010977b73599a1082e141a22e63367911e5a7aeb884b7ae28109b04adcd70e45b395d6ea0f4e156b13adff7df2eb6c522269b143435ccc19a4ab
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
@@ -56,7 +56,7 @@ module PgEngine
56
56
 
57
57
  before_action do
58
58
  @breakpoint_navbar_expand = 'md'
59
- @navbar_opened_class = if cookies[:navbar_expand] == 'false' || !user_signed_in?
59
+ @navbar_opened_class = if cookies[:navbar_expand] == 'false'
60
60
  ''
61
61
  else
62
62
  'opened'
@@ -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-muted') + \
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,6 +2,13 @@ module SimpleForm
2
2
  module Components
3
3
  module Errors
4
4
  def error_text
5
+ begin
6
+ if object.errors.details[attribute_name].map(&:values).flatten.include? :blank
7
+ return
8
+ end
9
+ rescue StandardError => e
10
+ pg_err e
11
+ end
5
12
  text = has_custom_error? ? options[:error] : errors.reject(&:empty?).send(error_method)
6
13
  return if text.blank?
7
14
 
@@ -46,14 +46,18 @@ es:
46
46
  # prompts:
47
47
  # defaults:
48
48
  # age: 'Select your age'
49
- errors:
50
- messages:
51
- blank: ''
52
- empty: ''
49
+ # errors:
50
+ # messages:
51
+ # blank: ''
52
+ # empty: ''
53
53
  devise:
54
54
  sign_in: ¿Ya tenés una cuenta? Iniciar sesión
55
55
  sign_out: Cerrar sesión
56
56
  sign_up: Crear una cuenta
57
+ sessions:
58
+ signed_in: ''
59
+ signed_out: ''
60
+ already_signed_out: ''
57
61
  registrations:
58
62
  new:
59
63
  sign_up: Crear una cuenta
@@ -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: 9em;
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
+ }
@@ -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,5 +1,5 @@
1
1
  - content_for :content do
2
- .container.text-center
2
+ .container.text-center.pt-4
3
3
  = yield
4
4
 
5
5
  css:
@@ -1,67 +1,14 @@
1
- <nav class="navbar navbar-expand-<%= @breakpoint_navbar_expand %> bg-light">
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-primary me-2 d-none d-<%= @breakpoint_navbar_expand %>-inline-block">
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-primary d-inline-block d-<%= @breakpoint_navbar_expand %>-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasExample" aria-controls="offcanvasExample">
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
- <!-- <a class="navbar-brand" href="#">Navbar</a> -->
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 bg-gradient d-none d-<%= @breakpoint_navbar_expand %>-block">
2
- <% if user_signed_in? %>
3
- <div class="sidebar--large-items">
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
- <%# <div class="sidebar--small-items">
6
- <ul class="list-unstyled ps-0">
7
- <li class="mb-1 text-center">
8
- <a href="javascript:void(0)" class="nav-link" data-bs-toggle="tooltip" data-bs-title="Agenda">
9
- <i class="bi bi-calendar"></i>
10
- </a>
11
- </li>
12
- </ul>
13
- </div> %>
14
- <div class="sidebar--large-items">
15
- <ul class="list-unstyled ps-0">
16
- <% @navbar.bar('sidebar').each do |entry| %>
17
- <% next if @navbar.hide_entry?(entry) %>
18
- <% random_id = rand(99999).to_s %>
19
- <li class="mb-1">
20
- <% if entry[:children].present? %>
21
- <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">
22
- <%= entry[:title] %>
23
- </button>
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
- <ul class="navbar-nav mb-2 mb-lg-0">
8
- <% @navbar.bar('topbar.before').each do |entry| %>
9
- <li class="nav-item">
10
- <a class="nav-link" href="<%= entry[:path] %>">
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
- <% if user_signed_in? %>
16
- <li class="nav-item dropdown">
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>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.0.8-alpha.40'
4
+ VERSION = '7.0.8-alpha.42'
5
5
  end
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.40
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-22 00:00:00.000000000 Z
11
+ date: 2024-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails