trusty-cms 4.2.1 → 4.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +91 -95
- data/LICENSE.md +1 -1
- data/app/helpers/admin/node_helper.rb +1 -1
- data/app/models/asset.rb +3 -3
- data/app/models/page.rb +3 -3
- data/app/models/standard_tags.rb +3 -3
- data/app/models/user.rb +1 -1
- data/config/database.mysql.yml +10 -2
- data/db/migrate/20210331134718_create_active_storage_tables.active_storage.rb +36 -0
- data/lib/generators/extension/templates/test_helper.rb +6 -8
- data/lib/login_system.rb +1 -1
- data/lib/trusty_cms.rb +1 -1
- data/spec/dummy/config/database.yml +6 -2
- data/trusty_cms.gemspec +2 -3
- data/vendor/extensions/clipped-extension/lib/asset_tags.rb +4 -4
- metadata +9 -174
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/base.rb +0 -195
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/check_box.rb +0 -65
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/checkable.rb +0 -18
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/collection_check_boxes.rb +0 -35
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/collection_helpers.rb +0 -118
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/collection_radio_buttons.rb +0 -30
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/collection_select.rb +0 -30
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/color_field.rb +0 -26
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/date_field.rb +0 -14
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/date_select.rb +0 -73
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/datetime_field.rb +0 -31
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/datetime_local_field.rb +0 -20
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/datetime_select.rb +0 -10
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/email_field.rb +0 -10
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/file_field.rb +0 -10
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/grouped_collection_select.rb +0 -31
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/hidden_field.rb +0 -10
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/label.rb +0 -80
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/month_field.rb +0 -14
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/number_field.rb +0 -20
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/password_field.rb +0 -14
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/placeholderable.rb +0 -24
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/radio_button.rb +0 -32
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/range_field.rb +0 -10
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/search_field.rb +0 -27
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/select.rb +0 -42
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/tel_field.rb +0 -10
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/text_area.rb +0 -24
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/text_field.rb +0 -33
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/time_field.rb +0 -14
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/time_select.rb +0 -10
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/time_zone_select.rb +0 -22
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/translator.rb +0 -39
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/url_field.rb +0 -10
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/week_field.rb +0 -14
@@ -1,20 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ActionView
|
4
|
-
module Helpers
|
5
|
-
module Tags # :nodoc:
|
6
|
-
class DatetimeLocalField < DatetimeField # :nodoc:
|
7
|
-
class << self
|
8
|
-
def field_type
|
9
|
-
@field_type ||= "datetime-local"
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
private
|
14
|
-
def format_date(value)
|
15
|
-
value.try(:strftime, "%Y-%m-%dT%T")
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ActionView
|
4
|
-
module Helpers
|
5
|
-
module Tags # :nodoc:
|
6
|
-
class GroupedCollectionSelect < Base # :nodoc:
|
7
|
-
def initialize(object_name, method_name, template_object, collection, group_method, group_label_method, option_key_method, option_value_method, options, html_options)
|
8
|
-
@collection = collection
|
9
|
-
@group_method = group_method
|
10
|
-
@group_label_method = group_label_method
|
11
|
-
@option_key_method = option_key_method
|
12
|
-
@option_value_method = option_value_method
|
13
|
-
@html_options = html_options
|
14
|
-
|
15
|
-
super(object_name, method_name, template_object, options)
|
16
|
-
end
|
17
|
-
|
18
|
-
def render
|
19
|
-
option_tags_options = {
|
20
|
-
selected: @options.fetch(:selected) { value },
|
21
|
-
disabled: @options[:disabled]
|
22
|
-
}
|
23
|
-
|
24
|
-
select_content_tag(
|
25
|
-
option_groups_from_collection_for_select(@collection, @group_method, @group_label_method, @option_key_method, @option_value_method, option_tags_options), @options, @html_options
|
26
|
-
)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,80 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ActionView
|
4
|
-
module Helpers
|
5
|
-
module Tags # :nodoc:
|
6
|
-
class Label < Base # :nodoc:
|
7
|
-
class LabelBuilder # :nodoc:
|
8
|
-
attr_reader :object
|
9
|
-
|
10
|
-
def initialize(template_object, object_name, method_name, object, tag_value)
|
11
|
-
@template_object = template_object
|
12
|
-
@object_name = object_name
|
13
|
-
@method_name = method_name
|
14
|
-
@object = object
|
15
|
-
@tag_value = tag_value
|
16
|
-
end
|
17
|
-
|
18
|
-
def translation
|
19
|
-
method_and_value = @tag_value.present? ? "#{@method_name}.#{@tag_value}" : @method_name
|
20
|
-
|
21
|
-
content ||= Translator
|
22
|
-
.new(object, @object_name, method_and_value, scope: "helpers.label")
|
23
|
-
.translate
|
24
|
-
content ||= @method_name.humanize
|
25
|
-
|
26
|
-
content
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def initialize(object_name, method_name, template_object, content_or_options = nil, options = nil)
|
31
|
-
options ||= {}
|
32
|
-
|
33
|
-
content_is_options = content_or_options.is_a?(Hash)
|
34
|
-
if content_is_options
|
35
|
-
options.merge! content_or_options
|
36
|
-
@content = nil
|
37
|
-
else
|
38
|
-
@content = content_or_options
|
39
|
-
end
|
40
|
-
|
41
|
-
super(object_name, method_name, template_object, options)
|
42
|
-
end
|
43
|
-
|
44
|
-
def render(&block)
|
45
|
-
options = @options.stringify_keys
|
46
|
-
tag_value = options.delete("value")
|
47
|
-
name_and_id = options.dup
|
48
|
-
|
49
|
-
if name_and_id["for"]
|
50
|
-
name_and_id["id"] = name_and_id["for"]
|
51
|
-
else
|
52
|
-
name_and_id.delete("id")
|
53
|
-
end
|
54
|
-
|
55
|
-
add_default_name_and_id_for_value(tag_value, name_and_id)
|
56
|
-
options.delete("index")
|
57
|
-
options.delete("namespace")
|
58
|
-
options["for"] = name_and_id["id"] unless options.key?("for")
|
59
|
-
|
60
|
-
builder = LabelBuilder.new(@template_object, @object_name, @method_name, @object, tag_value)
|
61
|
-
|
62
|
-
content = if block_given?
|
63
|
-
@template_object.capture(builder, &block)
|
64
|
-
elsif @content.present?
|
65
|
-
@content.to_s
|
66
|
-
else
|
67
|
-
render_component(builder)
|
68
|
-
end
|
69
|
-
|
70
|
-
label_tag(name_and_id["id"], content, options)
|
71
|
-
end
|
72
|
-
|
73
|
-
private
|
74
|
-
def render_component(builder)
|
75
|
-
builder.translation
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/number_field.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ActionView
|
4
|
-
module Helpers
|
5
|
-
module Tags # :nodoc:
|
6
|
-
class NumberField < TextField # :nodoc:
|
7
|
-
def render
|
8
|
-
options = @options.stringify_keys
|
9
|
-
|
10
|
-
if range = options.delete("in") || options.delete("within")
|
11
|
-
options.update("min" => range.min, "max" => range.max)
|
12
|
-
end
|
13
|
-
|
14
|
-
@options = options
|
15
|
-
super
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ActionView
|
4
|
-
module Helpers
|
5
|
-
module Tags # :nodoc:
|
6
|
-
module Placeholderable # :nodoc:
|
7
|
-
def initialize(*)
|
8
|
-
super
|
9
|
-
|
10
|
-
if tag_value = @options[:placeholder]
|
11
|
-
placeholder = tag_value if tag_value.is_a?(String)
|
12
|
-
method_and_value = tag_value.is_a?(TrueClass) ? @method_name : "#{@method_name}.#{tag_value}"
|
13
|
-
|
14
|
-
placeholder ||= Tags::Translator
|
15
|
-
.new(object, @object_name, method_and_value, scope: "helpers.placeholder")
|
16
|
-
.translate
|
17
|
-
placeholder ||= @method_name.humanize
|
18
|
-
@options[:placeholder] = placeholder
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/radio_button.rb
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "action_view/helpers/tags/checkable"
|
4
|
-
|
5
|
-
module ActionView
|
6
|
-
module Helpers
|
7
|
-
module Tags # :nodoc:
|
8
|
-
class RadioButton < Base # :nodoc:
|
9
|
-
include Checkable
|
10
|
-
|
11
|
-
def initialize(object_name, method_name, template_object, tag_value, options)
|
12
|
-
@tag_value = tag_value
|
13
|
-
super(object_name, method_name, template_object, options)
|
14
|
-
end
|
15
|
-
|
16
|
-
def render
|
17
|
-
options = @options.stringify_keys
|
18
|
-
options["type"] = "radio"
|
19
|
-
options["value"] = @tag_value
|
20
|
-
options["checked"] = "checked" if input_checked?(options)
|
21
|
-
add_default_name_and_id_for_value(@tag_value, options)
|
22
|
-
tag("input", options)
|
23
|
-
end
|
24
|
-
|
25
|
-
private
|
26
|
-
def checked?(value)
|
27
|
-
value.to_s == @tag_value.to_s
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/search_field.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ActionView
|
4
|
-
module Helpers
|
5
|
-
module Tags # :nodoc:
|
6
|
-
class SearchField < TextField # :nodoc:
|
7
|
-
def render
|
8
|
-
options = @options.stringify_keys
|
9
|
-
|
10
|
-
if options["autosave"]
|
11
|
-
if options["autosave"] == true
|
12
|
-
options["autosave"] = request.host.split(".").reverse.join(".")
|
13
|
-
end
|
14
|
-
options["results"] ||= 10
|
15
|
-
end
|
16
|
-
|
17
|
-
if options["onsearch"]
|
18
|
-
options["incremental"] = true unless options.has_key?("incremental")
|
19
|
-
end
|
20
|
-
|
21
|
-
@options = options
|
22
|
-
super
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/select.rb
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ActionView
|
4
|
-
module Helpers
|
5
|
-
module Tags # :nodoc:
|
6
|
-
class Select < Base # :nodoc:
|
7
|
-
def initialize(object_name, method_name, template_object, choices, options, html_options)
|
8
|
-
@choices = block_given? ? template_object.capture { yield || "" } : choices
|
9
|
-
@choices = @choices.to_a if @choices.is_a?(Range)
|
10
|
-
|
11
|
-
@html_options = html_options
|
12
|
-
|
13
|
-
super(object_name, method_name, template_object, options)
|
14
|
-
end
|
15
|
-
|
16
|
-
def render
|
17
|
-
option_tags_options = {
|
18
|
-
selected: @options.fetch(:selected) { value },
|
19
|
-
disabled: @options[:disabled]
|
20
|
-
}
|
21
|
-
|
22
|
-
option_tags = if grouped_choices?
|
23
|
-
grouped_options_for_select(@choices, option_tags_options)
|
24
|
-
else
|
25
|
-
options_for_select(@choices, option_tags_options)
|
26
|
-
end
|
27
|
-
|
28
|
-
select_content_tag(option_tags, @options, @html_options)
|
29
|
-
end
|
30
|
-
|
31
|
-
private
|
32
|
-
# Grouped choices look like this:
|
33
|
-
#
|
34
|
-
# [nil, []]
|
35
|
-
# { nil => [] }
|
36
|
-
def grouped_choices?
|
37
|
-
!@choices.blank? && @choices.first.respond_to?(:last) && Array === @choices.first.last
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/text_area.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "action_view/helpers/tags/placeholderable"
|
4
|
-
|
5
|
-
module ActionView
|
6
|
-
module Helpers
|
7
|
-
module Tags # :nodoc:
|
8
|
-
class TextArea < Base # :nodoc:
|
9
|
-
include Placeholderable
|
10
|
-
|
11
|
-
def render
|
12
|
-
options = @options.stringify_keys
|
13
|
-
add_default_name_and_id(options)
|
14
|
-
|
15
|
-
if size = options.delete("size")
|
16
|
-
options["cols"], options["rows"] = size.split("x") if size.respond_to?(:split)
|
17
|
-
end
|
18
|
-
|
19
|
-
content_tag("textarea", options.delete("value") { value_before_type_cast }, options)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/text_field.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "action_view/helpers/tags/placeholderable"
|
4
|
-
|
5
|
-
module ActionView
|
6
|
-
module Helpers
|
7
|
-
module Tags # :nodoc:
|
8
|
-
class TextField < Base # :nodoc:
|
9
|
-
include Placeholderable
|
10
|
-
|
11
|
-
def render
|
12
|
-
options = @options.stringify_keys
|
13
|
-
options["size"] = options["maxlength"] unless options.key?("size")
|
14
|
-
options["type"] ||= field_type
|
15
|
-
options["value"] = options.fetch("value") { value_before_type_cast } unless field_type == "file"
|
16
|
-
add_default_name_and_id(options)
|
17
|
-
tag("input", options)
|
18
|
-
end
|
19
|
-
|
20
|
-
class << self
|
21
|
-
def field_type
|
22
|
-
@field_type ||= name.split("::").last.sub("Field", "").downcase
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
private
|
27
|
-
def field_type
|
28
|
-
self.class.field_type
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|