lato_settings 3.0.7 → 3.0.9

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: 827e04e9bc7927a17babc838fef6d11a3e26caf038d979328386107bbe8182c4
4
- data.tar.gz: 8c6647f1e62d79bed33b7e09a00af16a7a940c2b234aa7bc6422a0da0f82c7cd
3
+ metadata.gz: 344cb9bd875b8e2f79d5aa42376c97d66895092109eab6af77e578962a3e908a
4
+ data.tar.gz: d47ae3971d99b0d89b037297bc7bea4b3d90e9c87974df2d798e7a6623645721
5
5
  SHA512:
6
- metadata.gz: 4c0642f41e044ec289d0a263ac34b02e392f187a88d3563ea3d55744c26ffa9989e18748d16411b2f13d0b5bd3675a0f572f570fd592e6764685e8d9b3890d67
7
- data.tar.gz: 83ca32b58dd2666d0591fe9ec82100a3164184dd15105b88e64942a50176b08c4660ed9ff7ce68d2afe4594360809d9417336e16bd3da11a7a1c9f037146dbf0
6
+ metadata.gz: ae5bdecc751184385138b77225ac05a7d1beac18ebc79ec778c4d7ec20ed85571c27352c3803decd0f38927e17a911bef5648eb08cc316598df6950221e34ab5
7
+ data.tar.gz: cba5f0c6e033fe893cd07013b7ef159b835010235f4afdcbd95a2482005f67e9adc22fca3c0c8995c5c30b294f88374bb605b778e2a31ed65cbb840a7cfa2241
data/README.md CHANGED
@@ -1,7 +1,11 @@
1
1
  # Lato Settings
2
2
  Manage application settings on Lato projects.
3
3
 
4
+ Setting values, keys, and labels are displayed as plain text in the administration interface, including values saved before upgrading. HTML in these fields is escaped.
5
+
4
6
  ## Installation
7
+
8
+ Requires Rails 8.1.3.1 or newer in the 8.1 series and Lato 3.25.0 or newer. Existing applications must install the new Lato session migration before deployment; previous sessions are invalidated.
5
9
  Add required dependencies to your application's Gemfile:
6
10
 
7
11
  ```ruby
@@ -5,7 +5,11 @@ module LatoSettings
5
5
  end
6
6
 
7
7
  def lato_settings_setting_value(setting)
8
- print_content(setting, setting.value_formatted, :value)
8
+ if setting.typology == 'text'
9
+ content_tag(:pre, setting.value_formatted.to_s, class: 'p-2 bg-light border rounded mb-0', style: 'max-height: 200px; overflow: auto;')
10
+ else
11
+ print_content(setting, setting.value_formatted, :value)
12
+ end
9
13
  end
10
14
 
11
15
  def lato_settings_setting_label(setting)
@@ -32,14 +36,21 @@ module LatoSettings
32
36
  end
33
37
 
34
38
  def print_content(setting, content, type)
35
- raw "
36
- <div class=\"input-group input-group-sm\" data-controller=\"lato-copyclip\">
37
- <input type=\"text\" class=\"form-control\" placeholder=\"#{setting.label || setting.key}\" aria-label=\"#{setting.label || setting.key}\" aria-describedby=\"#{type}_#{setting.id}\" value=\"#{content}\" data-lato-copyclip-target=\"input\" readonly>
38
- <button class=\"btn btn-primary\" type=\"button\" id=\"#{type}_#{setting.id}\" data-lato-copyclip-target=\"button\" data-action=\"lato-copyclip#onButtonClick\" title=\"#{I18n.t('lato_settings.cta_copy')}\" aria-label=\"#{I18n.t('lato_settings.cta_copy')}\" data-copy-text=\"<i class='bi bi-clipboard-check'></i>\">
39
- <i class=\"bi bi-clipboard\"></i>
40
- </button>
41
- </div>
42
- "
39
+ label = setting.label || setting.key
40
+ button_id = "#{type}_#{setting.id}"
41
+ copy_label = I18n.t("lato_settings.cta_copy")
42
+
43
+ content_tag(:div, class: "input-group input-group-sm", data: { controller: "lato-copyclip" }) do
44
+ concat tag.input(type: "text", class: "form-control", placeholder: label,
45
+ aria: { label: label, describedby: button_id }, value: content, readonly: true,
46
+ data: { lato_copyclip_target: "input" })
47
+ concat content_tag(:button, type: "button", id: button_id, class: "btn btn-primary",
48
+ title: copy_label, aria: { label: copy_label },
49
+ data: { lato_copyclip_target: "button", action: "lato-copyclip#onButtonClick",
50
+ copy_text: "<i class='bi bi-clipboard-check'></i>" }) {
51
+ content_tag(:i, "", class: "bi bi-clipboard")
52
+ }
53
+ end
43
54
  end
44
55
  end
45
56
  end
@@ -8,6 +8,7 @@ module LatoSettings
8
8
  date: 2,
9
9
  select: 3,
10
10
  integer: 4,
11
+ text: 5
11
12
  }, prefix: true
12
13
 
13
14
  validates :key, presence: true, uniqueness: true, format: { with: /\A[a-zA-Z0-9_]+\z/ }
@@ -51,6 +52,8 @@ module LatoSettings
51
52
  option_values.include?(value) ? value : nil
52
53
  when 'integer'
53
54
  value.to_i
55
+ when 'text'
56
+ value.to_s
54
57
  else
55
58
  value.to_s
56
59
  end
@@ -44,6 +44,11 @@ setting ||= LatoSettings::Setting.new
44
44
  <%= lato_form_item_label form, :value %>
45
45
  <%= lato_form_item_input_select form, :value, options_for_select(setting.option_values, setting.value), required: true %>
46
46
  </div>
47
+ <% elsif setting.typology == 'text' %>
48
+ <div class="mb-3">
49
+ <%= lato_form_item_label form, :value %>
50
+ <%= lato_form_item_input_textarea form, :value, required: true, rows: 5 %>
51
+ </div>
47
52
  <% else %>
48
53
  <div class="mb-3">
49
54
  <%= lato_form_item_label form, :value %>
@@ -1,3 +1,3 @@
1
1
  module LatoSettings
2
- VERSION = "3.0.7"
2
+ VERSION = "3.0.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lato_settings
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.7
4
+ version: 3.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregorio Galante
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2026-01-17 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rails
@@ -16,28 +15,34 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: 7.1.1
18
+ version: 8.1.3.1
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: '8.2'
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
23
25
  requirements:
24
26
  - - ">="
25
27
  - !ruby/object:Gem::Version
26
- version: 7.1.1
28
+ version: 8.1.3.1
29
+ - - "<"
30
+ - !ruby/object:Gem::Version
31
+ version: '8.2'
27
32
  - !ruby/object:Gem::Dependency
28
33
  name: lato
29
34
  requirement: !ruby/object:Gem::Requirement
30
35
  requirements:
31
36
  - - ">="
32
37
  - !ruby/object:Gem::Version
33
- version: '0'
38
+ version: 3.25.0
34
39
  type: :runtime
35
40
  prerelease: false
36
41
  version_requirements: !ruby/object:Gem::Requirement
37
42
  requirements:
38
43
  - - ">="
39
44
  - !ruby/object:Gem::Version
40
- version: '0'
45
+ version: 3.25.0
41
46
  description: A Rails engine to manage application settings on Lato projects!
42
47
  email:
43
48
  - me@gregoriogalante.com
@@ -80,7 +85,6 @@ licenses:
80
85
  metadata:
81
86
  homepage_uri: https://github.com/Lato-org/lato_settings
82
87
  source_code_uri: https://github.com/Lato-org/lato_settings
83
- post_install_message:
84
88
  rdoc_options: []
85
89
  require_paths:
86
90
  - lib
@@ -95,8 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
99
  - !ruby/object:Gem::Version
96
100
  version: '0'
97
101
  requirements: []
98
- rubygems_version: 3.4.1
99
- signing_key:
102
+ rubygems_version: 4.0.9
100
103
  specification_version: 4
101
104
  summary: Another engine for Lato projects
102
105
  test_files: []