pg_rails 7.0.8.pre.alpha.35 → 7.0.8.pre.alpha.37

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: 93eefb2a65a83f488ee2d3cc62e955844b5eb497aa3425714ca9ff1ad0e63f2f
4
- data.tar.gz: ec802a0a627d82d7f6abe4afed70bb08a764a93c29941657d3a8e9056a635ad1
3
+ metadata.gz: fc5297175e67ac85e03b8fbf4781139dc77a9d491c5c5ab15b0cf6d3d2c6dd48
4
+ data.tar.gz: fa9e5a41db685275a80b90b737a9ff9772798d8c96c7cc4ab3c9b9d16a550716
5
5
  SHA512:
6
- metadata.gz: b5dc96061a84f93538f5357b4d4638580101c65b338310f619e26436d096788bef33d923549872148da73d1fe05b560cbb8f3eede283576a3bc160380b1f0bb6
7
- data.tar.gz: 437c2837c6595cf6df6d2e9fb05b446bc1e65c22743a89dae9f5fb4b7eb9ac2be71f4892854ab5a7d29f69fdfdcc943ec79683cdfb3261f1d8e49d2cf4f4244e
6
+ metadata.gz: ed39f31e8b7cebaf0d0c3055db4df0f044867d3df6d749720fe4093c400fbab88bbbdf3ef8869d43198f78345cf07b6854ef14339b1c579e3d1602f0526b7794
7
+ data.tar.gz: 8752b125d74aa41ee9b9db26cca6a4fa94e17c58337c5eb95751d451ddbbaa175d9bf9f31d2cd0b33f4dcb0987c3837f38978efed0057895c8121285d65703ca
@@ -8,6 +8,7 @@ ActiveAdmin.register User do
8
8
  column :email
9
9
  column :current_sign_in_at
10
10
  column :created_at
11
+ column :developer
11
12
  actions
12
13
  end
13
14
  filter :email
@@ -32,7 +32,7 @@ module PgEngine
32
32
  end
33
33
 
34
34
  def new
35
- add_breadcrumb 'Crear'
35
+ add_breadcrumb instancia_modelo.submit_default_value
36
36
  end
37
37
 
38
38
  def edit
@@ -46,6 +46,10 @@ module PgEngine
46
46
  # [:alert, :notice, :warning, :success]
47
47
  add_flash_types :warning, :success
48
48
 
49
+ before_action do
50
+ console if params[:show_web_console]
51
+ end
52
+
49
53
  before_action do
50
54
  @breakpoint_navbar_expand = 'md'
51
55
  @navbar_opened_class = if cookies[:navbar_expand] == 'false' || !user_signed_in?
@@ -78,15 +78,11 @@ module PgEngine
78
78
  def new_link(remote: nil, klass: 'btn-warning')
79
79
  return unless Pundit.policy!(helpers.send(PgEngine.configuracion.current_user_method), object).new?
80
80
 
81
- word_to_create = I18n.t("form.#{object.class.nombre_singular.downcase}.create", default: :'form.create')
82
-
83
- full_text = "#{word_to_create} #{object.class.nombre_singular.downcase}"
84
-
85
- helpers.content_tag :span, rel: :tooltip, title: word_to_create do
81
+ helpers.content_tag :span, rel: :tooltip, title: submit_default_value do
86
82
  helpers.link_to(new_object_url, class: "btn btn-sm #{klass}",
87
83
  remote:) do
88
84
  helpers.content_tag(:span, nil,
89
- class: clase_icono('plus').to_s) + "<span class='d-none d-sm-inline'> #{full_text}</span>".html_safe
85
+ class: clase_icono('plus').to_s) + "<span class='d-none d-sm-inline'> #{submit_default_value}</span>".html_safe
90
86
  end
91
87
  end
92
88
  end
@@ -111,6 +107,17 @@ module PgEngine
111
107
  pg_namespace.present? ? [pg_namespace, object.class] : object.class
112
108
  end
113
109
 
110
+ # actionview-7.1.3.2/lib/action_view/helpers/form_helper.rb
111
+ def submit_default_value
112
+ key = :create
113
+ model = object.model_name.human
114
+ defaults = []
115
+ defaults << :"helpers.submit.#{object.model_name.i18n_key}.#{key}"
116
+ defaults << :"helpers.submit.#{key}"
117
+ defaults << "#{key.to_s.humanize} #{model}"
118
+ I18n.t(defaults.shift, model:, default: defaults)
119
+ end
120
+
114
121
  private
115
122
 
116
123
  def clase_icono(icono)
@@ -101,7 +101,13 @@ module PgEngine
101
101
  def print_currency(number, simbolo: '$', precision: nil)
102
102
  return if number.blank?
103
103
 
104
- precision ||= (number % 1).positive? ? 2 : 0
104
+ # FIXME: testear
105
+ precision ||= if (number % 0.01).positive?
106
+ 3
107
+ else
108
+ (number % 1).positive? ? 2 : 0
109
+ end
110
+
105
111
  "#{simbolo} #{number_with_precision(number, delimiter: '.', separator: ',',
106
112
  precision:)}"
107
113
  end
@@ -34,7 +34,9 @@ div
34
34
  tr
35
35
  - atributos_para_listar.each do |att|
36
36
  th = encabezado att, ordenable: true
37
- th.text-end = @clase_modelo.new.decorate.export_link(request.url)
37
+ th.text-end
38
+ - unless @export_link == false
39
+ = @clase_modelo.new.decorate.export_link(request.url)
38
40
  tbody
39
41
  - @collection.each do |object|
40
42
  - object = object.decorate
@@ -11,8 +11,6 @@ es:
11
11
  confirmed_at: Fecha de confirmación
12
12
  actualizado_por: Actualizado por
13
13
  creado_por: Creado por
14
- form:
15
- create: Crear
16
14
  ancestry:
17
15
  exclude_self: No puede ser hijx de si mismx
18
16
  simple_form:
@@ -73,6 +73,9 @@ $chevron-color: 200,200,200,.5;
73
73
  }
74
74
  }
75
75
  }
76
+ .offcanvas {
77
+ --bs-offcanvas-width: 250px;
78
+ }
76
79
  /* Layout */
77
80
  .with-sidebar {
78
81
  display: flex;
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.0.8-alpha.35'
4
+ VERSION = '7.0.8-alpha.37'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
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.35
4
+ version: 7.0.8.pre.alpha.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso