kono_utils_bootstrap_view4 0.1.0.pre.rc.3 → 0.1.0
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 +4 -4
- data/app/concepts/kono_utils/object/cell/base.rb +102 -96
- data/app/concepts/kono_utils/object/cell/buttons/base.rb +55 -54
- data/app/concepts/kono_utils/object/cell/buttons/collapse_search.rb +29 -23
- data/app/concepts/kono_utils/object/cell/buttons/create.rb +20 -15
- data/app/concepts/kono_utils/object/cell/buttons/delete.rb +29 -24
- data/app/concepts/kono_utils/object/cell/buttons/download.rb +22 -16
- data/app/concepts/kono_utils/object/cell/buttons/edit.rb +17 -12
- data/app/concepts/kono_utils/object/cell/buttons/list.rb +17 -11
- data/app/concepts/kono_utils/object/cell/buttons/reset_search.rb +21 -15
- data/app/concepts/kono_utils/object/cell/create/base.rb +6 -5
- data/app/concepts/kono_utils/object/cell/create/page_title.rb +11 -6
- data/app/concepts/kono_utils/object/cell/create/side_title.rb +8 -2
- data/app/concepts/kono_utils/object/cell/edits/base.rb +6 -5
- data/app/concepts/kono_utils/object/cell/edits/page_title.rb +11 -6
- data/app/concepts/kono_utils/object/cell/edits/side_title.rb +9 -3
- data/app/concepts/kono_utils/object/cell/form.rb +51 -48
- data/app/concepts/kono_utils/object/cell/forms/base.rb +12 -10
- data/app/concepts/kono_utils/object/cell/forms/container.rb +22 -18
- data/app/concepts/kono_utils/object/cell/forms/containers/layout.rb +14 -10
- data/app/concepts/kono_utils/object/cell/forms/containers/modal_layout.rb +10 -4
- data/app/concepts/kono_utils/object/cell/forms/containers/search_layout.rb +10 -4
- data/app/concepts/kono_utils/object/cell/forms/containers/table_layout.rb +11 -5
- data/app/concepts/kono_utils/object/cell/forms/field_selector.rb +68 -64
- data/app/concepts/kono_utils/object/cell/forms/field_selectors/layout.rb +9 -4
- data/app/concepts/kono_utils/object/cell/forms/field_selectors/modal_layout.rb +10 -4
- data/app/concepts/kono_utils/object/cell/forms/field_selectors/table_layout.rb +11 -5
- data/app/concepts/kono_utils/object/cell/forms/fields/association.rb +11 -4
- data/app/concepts/kono_utils/object/cell/forms/fields/base.rb +21 -16
- data/app/concepts/kono_utils/object/cell/forms/fields/bases/layout.rb +24 -17
- data/app/concepts/kono_utils/object/cell/forms/fields/bases/modal_layout.rb +14 -4
- data/app/concepts/kono_utils/object/cell/forms/fields/bases/table_layout.rb +17 -7
- data/app/concepts/kono_utils/object/cell/forms/fields/check_box.rb +14 -6
- data/app/concepts/kono_utils/object/cell/forms/fields/collection.rb +20 -12
- data/app/concepts/kono_utils/object/cell/forms/fields/date_field.rb +18 -10
- data/app/concepts/kono_utils/object/cell/forms/fields/date_time_field.rb +34 -30
- data/app/concepts/kono_utils/object/cell/forms/fields/enum.rb +23 -15
- data/app/concepts/kono_utils/object/cell/forms/fields/file_field.rb +29 -21
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_modal_wrapper.rb +10 -3
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_modal_wrappers/forms_container.rb +13 -5
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_modal_wrappers/show.rb +19 -10
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrapper.rb +54 -49
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/form.rb +41 -35
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms/layout.rb +17 -8
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms/modal_layout.rb +14 -4
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms/table_layout.rb +14 -4
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms_container.rb +44 -36
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms_containers/layout.rb +17 -10
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms_containers/modal_layout.rb +17 -6
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms_containers/table_layout.rb +20 -11
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/header.rb +31 -23
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/remove_button.rb +46 -40
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/remove_buttons/layout.rb +14 -7
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/remove_buttons/modal_layout.rb +14 -4
- data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/remove_buttons/table_layout.rb +14 -4
- data/app/concepts/kono_utils/object/cell/forms/fields/read_only.rb +16 -9
- data/app/concepts/kono_utils/object/cell/forms/fields/time_field.rb +14 -7
- data/app/concepts/kono_utils/object/cell/forms/layout.rb +8 -4
- data/app/concepts/kono_utils/object/cell/forms/submit.rb +21 -16
- data/app/concepts/kono_utils/object/cell/index/base.rb +9 -7
- data/app/concepts/kono_utils/object/cell/index/page_title.rb +11 -6
- data/app/concepts/kono_utils/object/cell/index/row.rb +38 -36
- data/app/concepts/kono_utils/object/cell/index/row_buttons.rb +8 -4
- data/app/concepts/kono_utils/object/cell/index/row_footer.rb +8 -3
- data/app/concepts/kono_utils/object/cell/index/row_header.rb +13 -7
- data/app/concepts/kono_utils/object/cell/index/side_title.rb +8 -2
- data/app/concepts/kono_utils/object/cell/index/table.rb +12 -9
- data/app/concepts/kono_utils/object/cell/inject.rb +103 -102
- data/app/concepts/kono_utils/object/cell/modals/base.rb +7 -3
- data/app/concepts/kono_utils/object/cell/modals/bodies/layout.rb +9 -4
- data/app/concepts/kono_utils/object/cell/modals/body.rb +7 -3
- data/app/concepts/kono_utils/object/cell/modals/container.rb +5 -1
- data/app/concepts/kono_utils/object/cell/modals/containers/layout.rb +12 -6
- data/app/concepts/kono_utils/object/cell/modals/footer.rb +5 -2
- data/app/concepts/kono_utils/object/cell/modals/footers/layout.rb +9 -4
- data/app/concepts/kono_utils/object/cell/modals/header.rb +6 -3
- data/app/concepts/kono_utils/object/cell/modals/headers/layout.rb +9 -4
- data/app/concepts/kono_utils/object/cell/search.rb +22 -19
- data/app/concepts/kono_utils/object/cell/searches/form.rb +12 -9
- data/app/concepts/kono_utils/object/cell/show.rb +25 -20
- data/app/concepts/kono_utils/object/cell/shows/base.rb +6 -5
- data/app/concepts/kono_utils/object/cell/shows/page_title.rb +11 -6
- data/app/concepts/kono_utils/object/cell/shows/side_title.rb +8 -2
- data/app/views/kono_utils/base_editing/edit.html.erb +3 -3
- data/app/views/kono_utils/base_editing/edit.inject.erb +1 -1
- data/app/views/kono_utils/base_editing/index.html.erb +4 -4
- data/app/views/kono_utils/base_editing/new.html.erb +3 -3
- data/app/views/kono_utils/base_editing/new.inject.erb +1 -1
- data/app/views/kono_utils/base_editing/show.html.erb +3 -3
- data/app/views/kono_utils/base_editing/success_create_show.inject.erb +1 -1
- data/app/views/kono_utils/base_editing/success_update_show.inject.erb +1 -1
- data/lib/kono_utils_bootstrap_view4.rb +14 -8
- data/lib/kono_utils_bootstrap_view4/engine.rb +0 -3
- data/lib/kono_utils_bootstrap_view4/version.rb +1 -1
- metadata +10 -18
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7e54f4cbc61c0d98ae9d1b58fbf27d17a96b739d3f63d481281aadee542936be
|
|
4
|
+
data.tar.gz: df5d2ffcefd20dc75bd3a6dba4b148cb79c872c2ace672057f7f917fdfd670b2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a8095d99d28f25bb6fdcf700ae217f922c066498b6f4b96bed7da48d17dcf5be23b85baf799357978aadd5cd30016c7aea5458f6d339ccb7b1e8e7c1bbe92cba
|
|
7
|
+
data.tar.gz: 41c9f248d01a5313b7739aaec6f2d6ad7f34a3c42c86911dd60e41a392aed0702e99a53acf06cda674265edbdff0c2edb5709c16416b18ab3b0066226f5a5d4a
|
|
@@ -1,125 +1,131 @@
|
|
|
1
1
|
require 'kaminari/helpers/helper_methods'
|
|
2
2
|
|
|
3
|
-
module KonoUtils
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
module KonoUtils
|
|
4
|
+
module Object
|
|
5
|
+
module Cell
|
|
6
|
+
class Base < Trailblazer::Cell # class
|
|
7
|
+
view_paths << "#{KonoUtilsBootstrapView4::Engine.root}/app/concepts"
|
|
8
|
+
|
|
9
|
+
include Pundit
|
|
10
|
+
include Kaminari::Helpers::HelperMethods
|
|
11
|
+
include KonoUtilsBootstrapView4::ApplicationIconHelper
|
|
12
|
+
include Kaminari::Cells
|
|
13
|
+
|
|
14
|
+
##
|
|
15
|
+
# Helpers di controller
|
|
16
|
+
def base_class
|
|
17
|
+
context[:base_class] || (@_base_class ||= parent_controller.send(:base_class))
|
|
18
|
+
end
|
|
12
19
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
context[:base_class] || (@_base_class ||= parent_controller.send(:base_class))
|
|
17
|
-
end
|
|
20
|
+
def new_custom_polymorphic_path(*base_class)
|
|
21
|
+
parent_controller.send(:new_custom_polymorphic_path, *base_class)
|
|
22
|
+
end
|
|
18
23
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
def edit_custom_polymorphic_path(*rec)
|
|
25
|
+
parent_controller.send(:edit_custom_polymorphic_path, *rec)
|
|
26
|
+
end
|
|
22
27
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
def index_custom_polymorphic_path(*rec)
|
|
29
|
+
parent_controller.send(:index_custom_polymorphic_path, *rec)
|
|
30
|
+
end
|
|
26
31
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
def destroy_custom_polymorphic_path(*rec)
|
|
33
|
+
parent_controller.send(:destroy_custom_polymorphic_path, *rec)
|
|
34
|
+
end
|
|
30
35
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
##
|
|
37
|
+
# Registra il contenuto con una chiave, e lo renderizza poi dove è più necessario
|
|
38
|
+
# @param [String] name
|
|
39
|
+
# @param [String] content
|
|
40
|
+
# @param [Hash{null->null}] options
|
|
41
|
+
# @param [Proc] block
|
|
42
|
+
# @return [String]
|
|
43
|
+
def content_for_layout(name, content = nil, options = {}, &block)
|
|
44
|
+
context[:_view_layout_flow] ||= ActionView::OutputFlow.new
|
|
45
|
+
if content || block_given?
|
|
46
|
+
if block_given?
|
|
47
|
+
options = content if content
|
|
48
|
+
content = capture(&block)
|
|
49
|
+
end
|
|
50
|
+
if content
|
|
51
|
+
content = content.to_s.html_safe
|
|
52
|
+
options[:flush] ? context[:_view_layout_flow].set(name, content) : context[:_view_layout_flow].append(name, content)
|
|
53
|
+
end
|
|
54
|
+
nil
|
|
55
|
+
else
|
|
56
|
+
context[:_view_layout_flow].get(name).presence
|
|
57
|
+
end
|
|
58
|
+
end
|
|
34
59
|
|
|
60
|
+
def content_for_layout?(name)
|
|
61
|
+
context[:_view_layout_flow].get(name).present? rescue false
|
|
62
|
+
end
|
|
35
63
|
|
|
36
|
-
|
|
37
|
-
# Registra il contenuto con una chiave, e lo renderizza poi dove è più necessario
|
|
38
|
-
# @param [String] name
|
|
39
|
-
# @param [String] content
|
|
40
|
-
# @param [Hash{null->null}] options
|
|
41
|
-
# @param [Proc] block
|
|
42
|
-
# @return [String]
|
|
43
|
-
def content_for_layout(name, content = nil, options = {}, &block)
|
|
44
|
-
context[:_view_layout_flow] ||= ActionView::OutputFlow.new
|
|
45
|
-
if content || block_given?
|
|
46
|
-
if block_given?
|
|
47
|
-
options = content if content
|
|
48
|
-
content = capture(&block)
|
|
49
|
-
end
|
|
50
|
-
if content
|
|
51
|
-
content = content.to_s.html_safe
|
|
52
|
-
options[:flush] ? context[:_view_layout_flow].set(name, content) : context[:_view_layout_flow].append(name, content)
|
|
53
|
-
end
|
|
54
|
-
nil
|
|
55
|
-
else
|
|
56
|
-
context[:_view_layout_flow].get(name).presence
|
|
57
|
-
end
|
|
58
|
-
end
|
|
64
|
+
alias_method :legacy_concept, :concept
|
|
59
65
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
# def concept(name, model = nil, options = {}, &block)
|
|
67
|
+
def concept(name, *args, &block)
|
|
68
|
+
legacy_concept(base_class.concept_ns(name), *args, &block)
|
|
69
|
+
end
|
|
63
70
|
|
|
64
|
-
|
|
71
|
+
delegates :base_class, :layout_ns
|
|
65
72
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
73
|
+
# @return [Logger]
|
|
74
|
+
def self.logger
|
|
75
|
+
KonoUtilsBootstrapView4.configuration.logger
|
|
76
|
+
end
|
|
70
77
|
|
|
71
|
-
|
|
78
|
+
delegate :logger, to: :class
|
|
72
79
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
end
|
|
80
|
+
def _prefixes
|
|
81
|
+
base_class.concept_prefix + super + parent_controller.lookup_context.view_paths.collect(&:to_path)
|
|
82
|
+
end
|
|
77
83
|
|
|
78
|
-
|
|
84
|
+
def kono_user
|
|
85
|
+
context[:kono_user]
|
|
86
|
+
end
|
|
79
87
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
88
|
+
##
|
|
89
|
+
# In questo modo se non viene modificato l'utente di pundit, il pundit interno a kono utilizza quello di kono_utils
|
|
90
|
+
alias_method :current_user, :kono_user
|
|
83
91
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
92
|
+
def title_mod
|
|
93
|
+
"#{t(:edit)} #{model.mn}"
|
|
94
|
+
end
|
|
87
95
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
96
|
+
def title_new
|
|
97
|
+
"#{t(:new)} #{model.mn}"
|
|
98
|
+
end
|
|
91
99
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
100
|
+
def title_newa
|
|
101
|
+
"#{t(:newa)} #{model.mn}"
|
|
102
|
+
end
|
|
95
103
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
104
|
+
def title_del
|
|
105
|
+
"#{t(:del)} #{model.mn}"
|
|
106
|
+
end
|
|
99
107
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
108
|
+
def title_edit_g
|
|
109
|
+
"#{t("edit_title_#{model_gender}", default: 'Modifica')} #{model.mn}"
|
|
110
|
+
end
|
|
103
111
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
112
|
+
def title_new_g
|
|
113
|
+
"#{t("new_title_#{model_gender}", default: 'Nuovo')} #{model.mn}"
|
|
114
|
+
end
|
|
107
115
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
116
|
+
def title_del_g
|
|
117
|
+
"#{t("del_title_#{model_gender}", default: 'Cancella')} #{model.mn}"
|
|
118
|
+
end
|
|
111
119
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
120
|
+
def title_show_g
|
|
121
|
+
"#{t("show_title_#{model_gender}", default: 'Visualizza')} #{model.mn}"
|
|
122
|
+
end
|
|
115
123
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
124
|
+
def model_gender
|
|
125
|
+
t("activerecord.modelgender.#{model.class.name.underscore.to_sym}", :default => :m).to_sym
|
|
126
|
+
end
|
|
119
127
|
|
|
120
|
-
|
|
121
|
-
t("activerecord.modelgender.#{model.class.name.underscore.to_sym}", :default => :m).to_sym
|
|
128
|
+
end
|
|
122
129
|
end
|
|
123
|
-
|
|
124
130
|
end
|
|
125
131
|
end
|
|
@@ -1,57 +1,58 @@
|
|
|
1
|
-
module KonoUtils
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
module KonoUtils
|
|
2
|
+
module Object
|
|
3
|
+
module Cell
|
|
4
|
+
##
|
|
5
|
+
# Options:
|
|
6
|
+
# - url_to -> Url verso dove mandare il bottone
|
|
7
|
+
# - content -> Contenuto del link del bottone
|
|
8
|
+
# - button_options -> possibili opzioni per il bottone fra cui:
|
|
9
|
+
# - class -> per la classe
|
|
10
|
+
class Buttons::Base < Base
|
|
11
|
+
|
|
12
|
+
# @return [String]
|
|
13
|
+
def url_to
|
|
14
|
+
options.fetch(:url_to, "#to_override_or_options-url_to")
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def specific_button_class
|
|
18
|
+
nil
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def button_title
|
|
22
|
+
nil
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def button_size
|
|
26
|
+
"btn-sm"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def btn_opts(opts = {})
|
|
30
|
+
custom_options = options.dig(:button_options) || opts
|
|
31
|
+
opts = {
|
|
32
|
+
class: "btn #{specific_button_class} #{button_size} #{custom_options.delete(:class)}".split(' ').uniq.join(' '),
|
|
33
|
+
id: unique_dom_id
|
|
34
|
+
}
|
|
35
|
+
opts.merge!(custom_options)
|
|
36
|
+
opts[:title] = button_title unless base_class.nil?
|
|
37
|
+
opts
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def show(&block)
|
|
41
|
+
link_to button_content, url_to, btn_opts
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# @return [String] - contenuto del bottone/link
|
|
45
|
+
def button_content
|
|
46
|
+
options.fetch(:content, model.try(:to_s) || "options[:content]")
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
private
|
|
50
|
+
|
|
51
|
+
def unique_dom_id
|
|
52
|
+
@_unique_dom_id ||= SecureRandom.uuid
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
end
|
|
14
56
|
end
|
|
15
|
-
|
|
16
|
-
def specific_button_class
|
|
17
|
-
nil
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def button_title
|
|
21
|
-
nil
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def button_size
|
|
25
|
-
"btn-sm"
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def btn_opts(opts = {})
|
|
30
|
-
custom_options = options.dig(:button_options) || opts
|
|
31
|
-
opts = {
|
|
32
|
-
class: "btn #{specific_button_class} #{button_size} #{custom_options.delete(:class)}".split(' ').uniq.join(' '),
|
|
33
|
-
id: unique_dom_id
|
|
34
|
-
}
|
|
35
|
-
opts.merge!(custom_options)
|
|
36
|
-
opts[:title] = button_title unless base_class.nil?
|
|
37
|
-
opts
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
def show(&block)
|
|
41
|
-
link_to button_content, url_to, btn_opts
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
# @return [String] - contenuto del bottone/link
|
|
45
|
-
def button_content
|
|
46
|
-
options.fetch(:content, model.try(:to_s) || "options[:content]")
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
private
|
|
50
|
-
|
|
51
|
-
def unique_dom_id
|
|
52
|
-
@_unique_dom_id ||= SecureRandom.uuid
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
|
|
56
57
|
end
|
|
57
58
|
end
|
|
@@ -1,31 +1,37 @@
|
|
|
1
|
-
module KonoUtils
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
module KonoUtils
|
|
2
|
+
module Object
|
|
3
|
+
module Cell
|
|
4
|
+
module Buttons # namespace
|
|
5
|
+
##
|
|
6
|
+
# Bottone per la struttura del collapse search
|
|
7
|
+
# *Options*
|
|
8
|
+
# - collapsed_target -> identificativo del contenitore che devo espandere
|
|
9
|
+
class CollapseSearch < Base
|
|
7
10
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
def url_to
|
|
12
|
+
options.fetch(:collapsed_target, '#')
|
|
13
|
+
end
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
def specific_button_class
|
|
16
|
+
'btn-light'
|
|
17
|
+
end
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
def btn_opts(opts = {})
|
|
20
|
+
{
|
|
21
|
+
data: { toggle: "collapse" }
|
|
22
|
+
}.merge(super)
|
|
23
|
+
end
|
|
21
24
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
def button_title
|
|
26
|
+
I18n.t('kono_utils.bootstrap4.buttons.collapse_search.alt')
|
|
27
|
+
end
|
|
25
28
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
def button_content
|
|
30
|
+
options.fetch(:content, fa_icon("search"))
|
|
31
|
+
end
|
|
29
32
|
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
30
36
|
end
|
|
31
37
|
end
|
|
@@ -1,22 +1,27 @@
|
|
|
1
|
-
module KonoUtils
|
|
2
|
-
|
|
1
|
+
module KonoUtils
|
|
2
|
+
module Object
|
|
3
|
+
module Cell
|
|
4
|
+
module Buttons # namespace
|
|
5
|
+
class Create < Base
|
|
3
6
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def specific_button_class
|
|
9
|
-
"btn-success"
|
|
10
|
-
end
|
|
7
|
+
def url_to
|
|
8
|
+
options[:url_to] || new_custom_polymorphic_path(model)
|
|
9
|
+
end
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
def specific_button_class
|
|
12
|
+
"btn-success"
|
|
13
|
+
end
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
def button_title
|
|
16
|
+
title_new
|
|
17
|
+
end
|
|
19
18
|
|
|
19
|
+
def button_content
|
|
20
|
+
options.fetch(:content, fa_icon("plus"))
|
|
21
|
+
end
|
|
20
22
|
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
21
26
|
end
|
|
22
27
|
end
|