system_settings 0.7.0 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -12
  3. data/app/assets/config/manifest.js +1 -0
  4. data/app/assets/stylesheets/system_settings/application.css +227 -0
  5. data/app/controllers/system_settings/application_controller.rb +3 -9
  6. data/app/controllers/system_settings/settings_controller.rb +25 -21
  7. data/app/helpers/system_settings/application_helper.rb +36 -0
  8. data/app/models/system_settings/application_record.rb +2 -4
  9. data/app/models/system_settings/boolean_setting.rb +3 -5
  10. data/app/models/system_settings/configurator.rb +100 -94
  11. data/app/models/system_settings/decimal_list_setting.rb +6 -0
  12. data/app/models/system_settings/decimal_setting.rb +6 -0
  13. data/app/models/system_settings/errors/error.rb +2 -4
  14. data/app/models/system_settings/errors/not_found_error.rb +8 -3
  15. data/app/models/system_settings/errors/not_loaded_error.rb +2 -4
  16. data/app/models/system_settings/errors/settings_read_error.rb +2 -4
  17. data/app/models/system_settings/integer_list_setting.rb +3 -5
  18. data/app/models/system_settings/integer_setting.rb +3 -5
  19. data/app/models/system_settings/list_of_decimals_validator.rb +35 -0
  20. data/app/models/system_settings/list_of_integers_validator.rb +23 -25
  21. data/app/models/system_settings/list_of_strings_validator.rb +23 -25
  22. data/app/models/system_settings/setting.rb +3 -5
  23. data/app/models/system_settings/string_list_setting.rb +3 -5
  24. data/app/models/system_settings/string_setting.rb +7 -4
  25. data/app/models/system_settings/type/decimal_list.rb +40 -0
  26. data/app/models/system_settings/type/integer_list.rb +24 -33
  27. data/app/models/system_settings/type/string_list.rb +19 -21
  28. data/app/views/layouts/system_settings/application.html.erb +21 -0
  29. data/app/views/system_settings/settings/_common_attributes.html.erb +14 -0
  30. data/app/views/system_settings/settings/_form.html.erb +18 -0
  31. data/app/views/system_settings/settings/edit.html.erb +2 -0
  32. data/app/views/system_settings/settings/index.html.erb +29 -0
  33. data/app/views/system_settings/settings/show.html.erb +9 -0
  34. data/config/locales/system_settings.en.yml +27 -1
  35. data/config/locales/system_settings.lv.yml +65 -0
  36. data/config/routes.rb +5 -4
  37. data/lib/system_settings/engine.rb +3 -12
  38. data/lib/system_settings/version.rb +1 -1
  39. data/lib/system_settings.rb +1 -0
  40. metadata +18 -19
  41. data/app/controllers/system_settings/root_controller.rb +0 -13
  42. data/app/models/system_settings/pagination.rb +0 -20
  43. data/frontend/build/asset-manifest.json +0 -15
  44. data/frontend/build/favicon.ico +0 -0
  45. data/frontend/build/index.html +0 -1
  46. data/frontend/build/precache-manifest.3d1bd8b01752fe34cb52390bc898ad26.js +0 -22
  47. data/frontend/build/service-worker.js +0 -39
  48. data/frontend/build/static/css/main.04fc5f62.chunk.css +0 -2
  49. data/frontend/build/static/css/main.04fc5f62.chunk.css.map +0 -1
  50. data/frontend/build/static/js/2.8729aa12.chunk.js +0 -2
  51. data/frontend/build/static/js/2.8729aa12.chunk.js.map +0 -1
  52. data/frontend/build/static/js/main.8f1e7b9c.chunk.js +0 -2
  53. data/frontend/build/static/js/main.8f1e7b9c.chunk.js.map +0 -1
  54. data/frontend/build/static/js/runtime~main.ea5ad98e.js +0 -2
  55. data/frontend/build/static/js/runtime~main.ea5ad98e.js.map +0 -1
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module SystemSettings
4
- module Errors
5
- class Error < StandardError
6
- end
3
+ module SystemSettings::Errors
4
+ class Error < StandardError
7
5
  end
8
6
  end
@@ -1,8 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module SystemSettings
4
- module Errors
5
- class NotFoundError < SystemSettings::Errors::Error
3
+ module SystemSettings::Errors
4
+ class NotFoundError < SystemSettings::Errors::Error
5
+ if ActiveSupport.const_defined?("ActionableError")
6
+ include ActiveSupport::ActionableError
7
+
8
+ action "Load all settings" do
9
+ SystemSettings.load
10
+ end
6
11
  end
7
12
  end
8
13
  end
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module SystemSettings
4
- module Errors
5
- class NotLoadedError < SystemSettings::Errors::Error
6
- end
3
+ module SystemSettings::Errors
4
+ class NotLoadedError < SystemSettings::Errors::Error
7
5
  end
8
6
  end
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module SystemSettings
4
- module Errors
5
- class SettingsReadError < SystemSettings::Errors::Error
6
- end
3
+ module SystemSettings::Errors
4
+ class SettingsReadError < SystemSettings::Errors::Error
7
5
  end
8
6
  end
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module SystemSettings
4
- class IntegerListSetting < SystemSettings::Setting
5
- attribute :value, SystemSettings::Type::IntegerList.new
6
- validates :value, "system_settings/list_of_integers": true
7
- end
3
+ class SystemSettings::IntegerListSetting < SystemSettings::Setting
4
+ attribute :value, SystemSettings::Type::IntegerList.new(limit: 8)
5
+ validates :value, "system_settings/list_of_integers": true
8
6
  end
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module SystemSettings
4
- class IntegerSetting < SystemSettings::Setting
5
- attribute :value, :integer
6
- validates :value, numericality: { only_integer: true }
7
- end
3
+ class SystemSettings::IntegerSetting < SystemSettings::Setting
4
+ attribute :value, :integer, limit: 8
5
+ validates :value, numericality: { only_integer: true }
8
6
  end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ class SystemSettings::ListOfDecimalsValidator < ActiveModel::EachValidator
4
+ LIST_REGEXP = /\A[+-]?\d+(?:\.\d+){0,1}(?:; *[+-]?\d+(?:\.\d+){0,1})*\z/.freeze
5
+ SINGLE_REGEXP = /\A[+-]?\d+(?:\.\d+){0,1}\z/.freeze
6
+
7
+ def validate_each(record, attr_name, value)
8
+ came_from_user = :"#{attr_name}_came_from_user?"
9
+
10
+ raw_value = record.read_attribute_before_type_cast(attr_name) if record.respond_to?(came_from_user) && record.public_send(came_from_user)
11
+ raw_value ||= value
12
+
13
+ raw_value = value if record_attribute_changed_in_place?(record, attr_name)
14
+
15
+ record.errors.add(attr_name, :not_a_list_of_decimals) unless matches_list_of_decimals_regexp?(raw_value)
16
+ end
17
+
18
+ private
19
+
20
+ def record_attribute_changed_in_place?(record, attr_name)
21
+ record.respond_to?(:attribute_changed_in_place?) &&
22
+ record.attribute_changed_in_place?(attr_name.to_s)
23
+ end
24
+
25
+ def matches_list_of_decimals_regexp?(raw_value)
26
+ case raw_value
27
+ when String
28
+ LIST_REGEXP.match?(raw_value)
29
+ when Array
30
+ raw_value.all? { |v| SINGLE_REGEXP.match?(v.to_s) }
31
+ else
32
+ false
33
+ end
34
+ end
35
+ end
@@ -1,37 +1,35 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module SystemSettings
4
- class ListOfIntegersValidator < ActiveModel::EachValidator
5
- LIST_REGEXP = /\A[+-]?\d+(?:; *[+-]?\d+)*\z/.freeze
6
- SINGLE_REGEXP = /\A[+-]?\d+\z/.freeze
3
+ class SystemSettings::ListOfIntegersValidator < ActiveModel::EachValidator
4
+ LIST_REGEXP = /\A[+-]?\d+(?:; *[+-]?\d+)*\z/.freeze
5
+ SINGLE_REGEXP = /\A[+-]?\d+\z/.freeze
7
6
 
8
- def validate_each(record, attr_name, value)
9
- came_from_user = :"#{attr_name}_came_from_user?"
7
+ def validate_each(record, attr_name, value)
8
+ came_from_user = :"#{attr_name}_came_from_user?"
10
9
 
11
- raw_value = record.read_attribute_before_type_cast(attr_name) if record.respond_to?(came_from_user) && record.public_send(came_from_user)
12
- raw_value ||= value
10
+ raw_value = record.read_attribute_before_type_cast(attr_name) if record.respond_to?(came_from_user) && record.public_send(came_from_user)
11
+ raw_value ||= value
13
12
 
14
- raw_value = value if record_attribute_changed_in_place?(record, attr_name)
13
+ raw_value = value if record_attribute_changed_in_place?(record, attr_name)
15
14
 
16
- record.errors.add(attr_name, :not_a_list_of_integers) unless matches_list_of_integers_regexp?(raw_value)
17
- end
15
+ record.errors.add(attr_name, :not_a_list_of_integers) unless matches_list_of_integers_regexp?(raw_value)
16
+ end
18
17
 
19
- private
18
+ private
20
19
 
21
- def record_attribute_changed_in_place?(record, attr_name)
22
- record.respond_to?(:attribute_changed_in_place?) &&
23
- record.attribute_changed_in_place?(attr_name.to_s)
24
- end
20
+ def record_attribute_changed_in_place?(record, attr_name)
21
+ record.respond_to?(:attribute_changed_in_place?) &&
22
+ record.attribute_changed_in_place?(attr_name.to_s)
23
+ end
25
24
 
26
- def matches_list_of_integers_regexp?(raw_value)
27
- case raw_value
28
- when String
29
- LIST_REGEXP.match?(raw_value)
30
- when Array
31
- raw_value.all? { |v| SINGLE_REGEXP.match?(v.to_s) }
32
- else
33
- false
34
- end
25
+ def matches_list_of_integers_regexp?(raw_value)
26
+ case raw_value
27
+ when String
28
+ LIST_REGEXP.match?(raw_value)
29
+ when Array
30
+ raw_value.all? { |v| SINGLE_REGEXP.match?(v.to_s) }
31
+ else
32
+ false
35
33
  end
36
34
  end
37
35
  end
@@ -1,38 +1,36 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module SystemSettings
4
- class ListOfStringsValidator < ActiveModel::EachValidator
5
- NON_WHITESPACE_REGEXP = /[^[:space:]]/.freeze
3
+ class SystemSettings::ListOfStringsValidator < ActiveModel::EachValidator
4
+ NON_WHITESPACE_REGEXP = /[^[:space:]]/.freeze
6
5
 
7
- def validate_each(record, attr_name, value)
8
- came_from_user = :"#{attr_name}_came_from_user?"
6
+ def validate_each(record, attr_name, value)
7
+ came_from_user = :"#{attr_name}_came_from_user?"
9
8
 
10
- raw_value = record.read_attribute_before_type_cast(attr_name) if record.respond_to?(came_from_user) && record.public_send(came_from_user)
11
- raw_value ||= value
9
+ raw_value = record.read_attribute_before_type_cast(attr_name) if record.respond_to?(came_from_user) && record.public_send(came_from_user)
10
+ raw_value ||= value
12
11
 
13
- raw_value = value if record_attribute_changed_in_place?(record, attr_name)
12
+ raw_value = value if record_attribute_changed_in_place?(record, attr_name)
14
13
 
15
- record.errors.add(attr_name, :not_a_list_of_strings) unless matches_list_of_strings_regexp?(raw_value)
16
- end
14
+ record.errors.add(attr_name, :not_a_list_of_strings) unless matches_list_of_strings_regexp?(raw_value)
15
+ end
17
16
 
18
- private
17
+ private
19
18
 
20
- def record_attribute_changed_in_place?(record, attr_name)
21
- record.respond_to?(:attribute_changed_in_place?) &&
22
- record.attribute_changed_in_place?(attr_name.to_s)
23
- end
19
+ def record_attribute_changed_in_place?(record, attr_name)
20
+ record.respond_to?(:attribute_changed_in_place?) &&
21
+ record.attribute_changed_in_place?(attr_name.to_s)
22
+ end
24
23
 
25
- def matches_list_of_strings_regexp?(raw_value)
26
- case raw_value
27
- when String
28
- raw_value.split(SystemSettings::Type::StringList::DELIMITER_REGEXP).all? do |value|
29
- NON_WHITESPACE_REGEXP.match?(value)
30
- end
31
- when Array
32
- raw_value.all? { |v| NON_WHITESPACE_REGEXP.match?(v.to_s) }
33
- else
34
- false
24
+ def matches_list_of_strings_regexp?(raw_value)
25
+ case raw_value
26
+ when String
27
+ raw_value.split(SystemSettings::Type::StringList::DELIMITER_REGEXP).all? do |value|
28
+ NON_WHITESPACE_REGEXP.match?(value)
35
29
  end
30
+ when Array
31
+ raw_value.all? { |v| NON_WHITESPACE_REGEXP.match?(v.to_s) }
32
+ else
33
+ false
36
34
  end
37
35
  end
38
36
  end
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module SystemSettings
4
- class Setting < SystemSettings::ApplicationRecord
5
- validates :type, presence: true
6
- validates :name, presence: true, uniqueness: true
7
- end
3
+ class SystemSettings::Setting < SystemSettings::ApplicationRecord
4
+ validates :type, presence: true
5
+ validates :name, presence: true, uniqueness: true
8
6
  end
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module SystemSettings
4
- class StringListSetting < SystemSettings::Setting
5
- attribute :value, SystemSettings::Type::StringList.new
6
- validates :value, "system_settings/list_of_strings": true
7
- end
3
+ class SystemSettings::StringListSetting < SystemSettings::Setting
4
+ attribute :value, SystemSettings::Type::StringList.new
5
+ validates :value, "system_settings/list_of_strings": true
8
6
  end
@@ -1,8 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module SystemSettings
4
- class StringSetting < SystemSettings::Setting
5
- attribute :value, :string
6
- validates :value, presence: true
3
+ class SystemSettings::StringSetting < SystemSettings::Setting
4
+ attribute :value, :string
5
+ validates :value, presence: true
6
+
7
+ def value=(original_value)
8
+ next_value = original_value.to_s.blank? ? nil : original_value.to_s.strip
9
+ super(next_value)
7
10
  end
8
11
  end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SystemSettings::Type
4
+ class DecimalList < ActiveModel::Type::Value
5
+ SEPARATOR = ";"
6
+
7
+ def initialize(precision: nil, limit: nil, scale: nil)
8
+ super
9
+ @single_type = ActiveModel::Type::Decimal.new(precision: precision, limit: limit, scale: scale)
10
+ end
11
+
12
+ def type
13
+ :decimal_list
14
+ end
15
+
16
+ def deserialize(value)
17
+ result = value.presence && JSON.parse(value)
18
+ if result.is_a?(Array)
19
+ result.map { |v| @single_type.cast(v) }
20
+ else
21
+ result
22
+ end
23
+ end
24
+
25
+ def serialize(value)
26
+ JSON.dump(value) unless value.nil?
27
+ end
28
+
29
+ private
30
+
31
+ def cast_value(value)
32
+ case value
33
+ when Array
34
+ value.map { |v| @single_type.cast(v) }
35
+ when String
36
+ value.split(SEPARATOR).map { |v| @single_type.cast(v) }
37
+ end
38
+ end
39
+ end
40
+ end
@@ -1,43 +1,34 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module SystemSettings
4
- module Type
5
- class IntegerList < ActiveModel::Type::Value
6
- SEPARATOR = ";"
3
+ module SystemSettings::Type
4
+ class IntegerList < ActiveModel::Type::Value
5
+ SEPARATOR = ";"
7
6
 
8
- def type
9
- :integer_list
10
- end
7
+ def initialize(precision: nil, limit: nil, scale: nil)
8
+ super
9
+ @single_type = ActiveModel::Type::Integer.new(precision: precision, limit: limit, scale: scale)
10
+ end
11
11
 
12
- def deserialize(value)
13
- value.presence && JSON.parse(value)
14
- end
12
+ def type
13
+ :integer_list
14
+ end
15
15
 
16
- def serialize(value)
17
- JSON.dump(value) unless value.nil?
18
- end
16
+ def deserialize(value)
17
+ value.presence && JSON.parse(value)
18
+ end
19
+
20
+ def serialize(value)
21
+ JSON.dump(value) unless value.nil?
22
+ end
19
23
 
20
- private
24
+ private
21
25
 
22
- def cast_value(value)
23
- case value
24
- when Array
25
- value.map do |v|
26
- begin
27
- v.to_i
28
- rescue StandardError
29
- nil
30
- end
31
- end
32
- when String
33
- value.split(SEPARATOR).map do |v|
34
- begin
35
- v.to_i
36
- rescue StandardError
37
- nil
38
- end
39
- end
40
- end
26
+ def cast_value(value)
27
+ case value
28
+ when Array
29
+ value.map { |v| @single_type.cast(v) }
30
+ when String
31
+ value.split(SEPARATOR).map { |v| @single_type.cast(v) }
41
32
  end
42
33
  end
43
34
  end
@@ -1,30 +1,28 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module SystemSettings
4
- module Type
5
- class StringList < ActiveModel::Type::Value
6
- DELIMITER_REGEXP = /(?<=[^\\]);/.freeze
7
- def type
8
- :string_list
9
- end
3
+ module SystemSettings::Type
4
+ class StringList < ActiveModel::Type::Value
5
+ DELIMITER_REGEXP = /(?<=[^\\]);/.freeze
6
+ def type
7
+ :string_list
8
+ end
10
9
 
11
- def deserialize(value)
12
- value.presence && JSON.parse(value)
13
- end
10
+ def deserialize(value)
11
+ value.presence && JSON.parse(value)
12
+ end
14
13
 
15
- def serialize(value)
16
- JSON.dump(value) unless value.nil?
17
- end
14
+ def serialize(value)
15
+ JSON.dump(value) unless value.nil?
16
+ end
18
17
 
19
- private
18
+ private
20
19
 
21
- def cast_value(value)
22
- case value
23
- when Array
24
- value.map { |v| String(v).strip }
25
- when String
26
- value.split(DELIMITER_REGEXP).map(&:strip).map { |str| str.gsub("\\;", ";") }
27
- end
20
+ def cast_value(value)
21
+ case value
22
+ when Array
23
+ value.map { |v| String(v).strip }
24
+ when String
25
+ value.split(DELIMITER_REGEXP).map(&:strip).map { |str| str.gsub("\\;", ";") }
28
26
  end
29
27
  end
30
28
  end
@@ -0,0 +1,21 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title><%= SystemSettings::Setting.model_name.human(count: 2) %> - <%= SystemSettings::VERSION %></title>
6
+ <%= csrf_meta_tags %>
7
+ <%= stylesheet_link_tag 'system_settings/application', media: 'all' %>
8
+ </head>
9
+ <body>
10
+ <header>
11
+ <div class="container">
12
+ <%= link_to SystemSettings::Setting.model_name.human(count: 2), root_path, class: "app-name" %>
13
+ </div>
14
+ </header>
15
+ <main>
16
+ <div class="container">
17
+ <%= yield %>
18
+ </div>
19
+ </main>
20
+ </body>
21
+ </html>
@@ -0,0 +1,14 @@
1
+ <div class="attribute">
2
+ <div class="name"><%= setting.class.human_attribute_name(:name) %></div>
3
+ <div class="value">
4
+ <span class="sys-name"><%= setting.name %></span>
5
+ </div>
6
+ </div>
7
+ <div class="attribute">
8
+ <div class="name"><%= setting.class.human_attribute_name(:type) %></div>
9
+ <div class="value"><%= setting.model_name.human %></div>
10
+ </div>
11
+ <div class="attribute">
12
+ <div class="name"><%= setting.class.human_attribute_name(:description) %></div>
13
+ <div class="value"><%= setting.description %></div>
14
+ </div>
@@ -0,0 +1,18 @@
1
+ <%= form_for setting, as: :setting, url: setting_path(setting), method: "post" do |f| %>
2
+ <div class="attribute">
3
+ <%= f.label :value, class: "name" %>
4
+ <% if f.object.is_a?(SystemSettings::BooleanSetting) %>
5
+ <%= f.check_box :value, value: f.object.value %>
6
+ <% else %>
7
+ <%= f.text_field :value, value: format_value_for_form(f.object), class: "value" %>
8
+ <% end %>
9
+ <% if f.object.errors.messages[:value].any? %>
10
+ <div class="errors"><%= f.object.errors.messages[:value].join("; ") %></div>
11
+ <% end %>
12
+ <div class="hint"><%= t(f.object.type, scope: "system_settings.settings.form.hints_by_type", default: "").html_safe %></div>
13
+ </div>
14
+ <div class="buttons">
15
+ <%= f.submit t(".save"), class: "primary" %>
16
+ <%= link_to t(".back"), setting_path(setting), class: "button" %>
17
+ </div>
18
+ <% end %>
@@ -0,0 +1,2 @@
1
+ <%= render "common_attributes", setting: @setting %>
2
+ <%= render "form", setting: @setting %>
@@ -0,0 +1,29 @@
1
+ <table class="settings-table">
2
+ <thead>
3
+ <tr>
4
+ <th class="name"><%= SystemSettings::Setting.human_attribute_name(:name) %></th>
5
+ <th class="description"><%= SystemSettings::Setting.human_attribute_name(:description) %></th>
6
+ <th class="value"><%= SystemSettings::Setting.human_attribute_name(:value) %></th>
7
+ </tr>
8
+ </thead>
9
+ <tbody>
10
+ <% if @settings.any? %>
11
+ <% @settings.each do |setting| %>
12
+ <tr>
13
+ <td class="name"><%= link_to setting.name, setting_path(setting), class: "sys-name" %></td>
14
+ <td class="description"><%= setting.description %></td>
15
+ <td class="value"><%= format_value setting.value %></td>
16
+ </tr>
17
+ <% end %>
18
+ <% else %>
19
+ <tr>
20
+ <td colspan="3" class="no-entries"><%= t(".no_settings").html_safe %></td>
21
+ </tr>
22
+ <% end %>
23
+ </tbody>
24
+ <tfoot>
25
+ <tr>
26
+ <td colspan="3"><%= t(".add_new", path: display_settings_file_path).html_safe %></td>
27
+ </tr>
28
+ </tfoot>
29
+ </table>
@@ -0,0 +1,9 @@
1
+ <%= render "common_attributes", setting: @setting %>
2
+ <div class="attribute">
3
+ <div class="name"><%= @setting.class.human_attribute_name(:value) %></div>
4
+ <div class="value"><%= format_value @setting.value %></div>
5
+ </div>
6
+ <div class="buttons">
7
+ <%= link_to t(".edit"), edit_setting_path(@setting), class: "button primary" %>
8
+ <%= link_to t(".back"), root_path, class: "button" %>
9
+ </div>
@@ -16,11 +16,21 @@ en:
16
16
  system_settings/string_setting:
17
17
  one: "System Setting (String)"
18
18
  other: "System Settings (String)"
19
+ system_settings/decimal_setting:
20
+ one: "System Setting (Decimal)"
21
+ other: "System Settings (Decimal)"
22
+ system_settings/decimal_list_setting:
23
+ one: "System Setting (Decimal list)"
24
+ other: "System Settings (Decimal list)"
25
+ system_settings/boolean_setting:
26
+ one: "System Setting (Boolean)"
27
+ other: "System Settings (Boolean)"
19
28
  attributes:
20
29
  system_settings/setting:
21
30
  id: "ID"
22
31
  name: "Name"
23
32
  type: "Type"
33
+ value: "Value"
24
34
  description: "Description"
25
35
  created_at: "Created at"
26
36
  uploaded_at: "Updated at"
@@ -31,7 +41,23 @@ en:
31
41
  value:
32
42
  not_a_list_of_integers: "not a list of integers"
33
43
  not_a_list_of_strings: "not a list of strings"
44
+ not_a_list_of_decimals: "not a list of decimals"
34
45
  system_settings/boolean_setting:
35
46
  attributes:
36
47
  value:
37
- inclusion: "must be set to true or false"
48
+ inclusion: "must be set to true or false"
49
+ system_settings:
50
+ settings:
51
+ index:
52
+ no_settings: "No settings"
53
+ add_new: "Add new entries in <code>%{path}</code>"
54
+ show:
55
+ edit: Edit
56
+ back: Back
57
+ form:
58
+ save: Save
59
+ back: Back
60
+ hints_by_type:
61
+ "SystemSettings::StringListSetting": "Separate values by <code>;</code> character."
62
+ "SystemSettings::IntegerListSetting": "Separate values by <code>;</code> character."
63
+ "SystemSettings::DecimalListSetting": "Decimal separator is the <code>.</code> character. Separate multiple values by <code>;</code> character."
@@ -0,0 +1,65 @@
1
+ lv:
2
+ activerecord:
3
+ models:
4
+ system_settings/setting:
5
+ one: "Sistēmas iestatījums"
6
+ other: "Sistēmas iestatījumi"
7
+ system_settings/integer_list_setting:
8
+ one: "Sistēmas iestatījums (Veselu skaitļu virkne)"
9
+ other: "Sistēmas iestatījumi (Veselu skaitļu virkne)"
10
+ system_settings/integer_setting:
11
+ one: "Sistēmas iestatījums (Vesels skaitlis)"
12
+ other: "Sistēmas iestatījumi (Veseli skaitļi)"
13
+ system_settings/string_list_setting:
14
+ one: "Sistēmas iestatījums (Vārdu virkne)"
15
+ other: "Sistēmas iestatījumi (Vārdu virkne)"
16
+ system_settings/string_setting:
17
+ one: "Sistēmas iestatījums (Vārds)"
18
+ other: "Sistēmas iestatījumi (Vārds)"
19
+ system_settings/decimal_setting:
20
+ one: "Sistēmas iestatījums (Decimālskaitlis)"
21
+ other: "Sistēmas iestatījumi (Decimālskaitļi)"
22
+ system_settings/decimal_list_setting:
23
+ one: "Sistēmas iestatījums (Decimālskaitļu virkne)"
24
+ other: "Sistēmas iestatījumi (Decimālskaitļu virkne)"
25
+ system_settings/boolean_setting:
26
+ one: "Sistēmas iestatījums (Patiesumvērtība)"
27
+ other: "Sistēmas iestatījumi (Patiesumvērtības)"
28
+ attributes:
29
+ system_settings/setting:
30
+ id: "ID"
31
+ name: "Nosaukums"
32
+ type: "Tips"
33
+ value: "Vērtība"
34
+ description: "Apraksts"
35
+ created_at: "Izveides datums"
36
+ uploaded_at: "Atjaunošanas datums"
37
+ errors:
38
+ models:
39
+ system_settings/setting:
40
+ attributes:
41
+ value:
42
+ blank: "vērtībai ir jābūt aizpildītai"
43
+ not_a_number: "vērtība nav skaitlis"
44
+ not_a_list_of_integers: "vērtība nav virkne ar veseliem skaitļiem"
45
+ not_a_list_of_strings: "vērtība nav virke ar vārdiem"
46
+ not_a_list_of_decimals: "vērtība nav virkne ar decimālskaitļiem"
47
+ system_settings/boolean_setting:
48
+ attributes:
49
+ value:
50
+ inclusion: "ir jābūt aizpildītam"
51
+ system_settings:
52
+ settings:
53
+ index:
54
+ no_settings: "Nav ierakstu"
55
+ add_new: "Jaunus ierakstus iespējams pievienot: <code>%{path}</code>"
56
+ show:
57
+ edit: Labot
58
+ back: Atpakaļ
59
+ form:
60
+ save: Saglabāt
61
+ back: Atpakaļ
62
+ hints_by_type:
63
+ "SystemSettings::StringListSetting": "Vairākas vērtības atdala ar <code>;</code> simbolu."
64
+ "SystemSettings::IntegerListSetting": "Vairākas vērtības atdala ar <code>;</code> simbolu."
65
+ "SystemSettings::DecimalListSetting": "Decimālskaitļu veselo skaitli no decimāldaļas atdala ar <code>.</code> simbolu. Vairākas vērtības atdala ar <code>;</code> simbolu."