kono_utils_bootstrap_view4 0.1.0.pre.rc.7 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/concepts/kono_utils/object/cell/base.rb +10 -2
- data/app/concepts/kono_utils/object/cell/buttons/show.rb +23 -0
- data/app/concepts/kono_utils/object/cell/form.rb +7 -0
- data/app/concepts/kono_utils/object/cell/forms/base.rb +1 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/date_time_field.rb +1 -1
- data/app/concepts/kono_utils/object/cell/inject.rb +2 -2
- data/app/concepts/kono_utils/object/cell/searches/form.rb +6 -0
- data/app/concepts/kono_utils/object/view/form.erb +4 -2
- data/app/concepts/kono_utils/object/view/index/row_buttons.erb +2 -1
- data/app/concepts/kono_utils/object/view/searches/form.erb +3 -2
- data/app/inputs/tempus_dominus_input.rb +3 -3
- 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/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fcef8e13a1c9c4bff67ed8e88c00bf04fcbfbc8ffd4b1cbc48bd0916b65fd60
|
4
|
+
data.tar.gz: 9899170841054403a58adfc4c7e171c8702347dda0806d3b1867ab96dad3baac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9813a36ce88877e93019ff4c87e98efc3cbdeaa8180ba55dd9dcff6fd27124fafc556c8a61b4010cfdfa825b3710f19fde05f90913013ff6a5a03798f0bbb9bf
|
7
|
+
data.tar.gz: 39503751866ad57624a900937915d71e82fe254449b415519bbca6b27bbcd4c1d320c216f084b94da214577616bbbfd226d400ee02225d112bfcd06e937dea3f
|
@@ -33,6 +33,10 @@ module KonoUtils
|
|
33
33
|
parent_controller.send(:destroy_custom_polymorphic_path, *rec)
|
34
34
|
end
|
35
35
|
|
36
|
+
def show_custom_polymorphic_path(*rec)
|
37
|
+
parent_controller.send(:show_custom_polymorphic_path, *rec)
|
38
|
+
end
|
39
|
+
|
36
40
|
##
|
37
41
|
# Registra il contenuto con una chiave, e lo renderizza poi dove è più necessario
|
38
42
|
# @param [String] name
|
@@ -81,10 +85,14 @@ module KonoUtils
|
|
81
85
|
base_class.concept_prefix + super + parent_controller.lookup_context.view_paths.collect(&:to_path)
|
82
86
|
end
|
83
87
|
|
84
|
-
def
|
85
|
-
context[:
|
88
|
+
def kono_user
|
89
|
+
context[:kono_user]
|
86
90
|
end
|
87
91
|
|
92
|
+
##
|
93
|
+
# In questo modo se non viene modificato l'utente di pundit, il pundit interno a kono utilizza quello di kono_utils
|
94
|
+
alias_method :current_user, :kono_user
|
95
|
+
|
88
96
|
def title_mod
|
89
97
|
"#{t(:edit)} #{model.mn}"
|
90
98
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module KonoUtils
|
2
|
+
module Object
|
3
|
+
module Cell
|
4
|
+
module Buttons # namespace
|
5
|
+
class Show < Base
|
6
|
+
|
7
|
+
def url_to
|
8
|
+
options[:url_to] || show_custom_polymorphic_path(model)
|
9
|
+
end
|
10
|
+
|
11
|
+
def specific_button_class
|
12
|
+
'btn-info'
|
13
|
+
end
|
14
|
+
|
15
|
+
def button_content
|
16
|
+
options.fetch(:content, fa_icon("eye"))
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -24,6 +24,13 @@ module KonoUtils
|
|
24
24
|
[model, _form_options]
|
25
25
|
end
|
26
26
|
|
27
|
+
##
|
28
|
+
# Elenco di concept di bottoni da generare nella form per il submit
|
29
|
+
# @param [SimpleForm::FormBuilder] form_builder
|
30
|
+
def submit_buttons(form_builder:)
|
31
|
+
[concept("cell/forms/submit", nil, context: {form: form_builder})]
|
32
|
+
end
|
33
|
+
|
27
34
|
protected
|
28
35
|
|
29
36
|
def form_id
|
@@ -46,7 +46,7 @@ module KonoUtils
|
|
46
46
|
form: form,
|
47
47
|
base_class: base_class,
|
48
48
|
nested_layout: nested_layout,
|
49
|
-
|
49
|
+
kono_user: context[:kono_user]
|
50
50
|
}.merge(remote_context)
|
51
51
|
)
|
52
52
|
|
@@ -77,7 +77,7 @@ module KonoUtils
|
|
77
77
|
context: {
|
78
78
|
form: form,
|
79
79
|
base_class: base_class,
|
80
|
-
|
80
|
+
kono_user: context[:kono_user]
|
81
81
|
}.merge(remote_context)
|
82
82
|
)
|
83
83
|
|
@@ -11,6 +11,12 @@ module KonoUtils
|
|
11
11
|
:search_buttons_container
|
12
12
|
end
|
13
13
|
|
14
|
+
# @param [SimpleForm::FormBuilder] form_builder
|
15
|
+
# @return [Array<Concept>]
|
16
|
+
def submit_buttons(form_builder:)
|
17
|
+
super + [concept("cell/buttons/reset_search", model.search_form_builder.to_model)]
|
18
|
+
end
|
19
|
+
|
14
20
|
end
|
15
21
|
end
|
16
22
|
end
|
@@ -1,9 +1,11 @@
|
|
1
1
|
<%= simple_form_for(*forms_options) do |f| %>
|
2
2
|
|
3
|
-
<%= concept("cell/forms/container", model, context: {form: f}, layout: container_layout) %>
|
3
|
+
<%= concept("cell/forms/container", model, context: { form: f }, layout: container_layout) %>
|
4
4
|
|
5
5
|
<%= hidden_field_tag "kono_utils[form_id]", form_id %>
|
6
6
|
|
7
|
-
|
7
|
+
<% submit_buttons(form_builder:f).each do |btn| %>
|
8
|
+
<%= btn %>
|
9
|
+
<% end %>
|
8
10
|
|
9
11
|
<% end %>
|
@@ -1,2 +1,3 @@
|
|
1
|
+
<%= concept("cell/buttons/show", model) if policy(model).show? %>
|
1
2
|
<%= concept("cell/buttons/edit", model) if policy(model).edit? %>
|
2
|
-
<%= concept("cell/buttons/delete", model) if policy(model).destroy? %>
|
3
|
+
<%= concept("cell/buttons/delete", model) if policy(model).destroy? %>
|
@@ -7,8 +7,9 @@
|
|
7
7
|
<div class="row">
|
8
8
|
<div class="col-md">
|
9
9
|
<div class="float-right">
|
10
|
-
|
11
|
-
|
10
|
+
<% submit_buttons(form_builder:f).each do |btn| %>
|
11
|
+
<%= btn %>
|
12
|
+
<% end %>
|
12
13
|
</div>
|
13
14
|
</div>
|
14
15
|
</div>
|
@@ -1,11 +1,11 @@
|
|
1
1
|
class TempusDominusInput < SimpleForm::Inputs::Base
|
2
2
|
def input(wrapper_options)
|
3
3
|
|
4
|
-
template.content_tag(:div, class:
|
4
|
+
template.content_tag(:div, class: "input-group date #{ has_errors? ? 'is-invalid' : ''}", data: { target_input: 'nearest'}, id: options[:date_time_picker_identifier]) do
|
5
5
|
|
6
6
|
tmp = ActiveSupport::SafeBuffer.new
|
7
|
-
|
8
|
-
tmp << @builder.text_field(attribute_name,
|
7
|
+
merged_input_options = merge_wrapper_options(input_html_options, wrapper_options)
|
8
|
+
tmp << @builder.text_field(attribute_name, merged_input_options)
|
9
9
|
tmp << div_button
|
10
10
|
|
11
11
|
tmp
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<% content_for :page_title do %>
|
2
|
-
<%= concept(base_class.concept_ns("cell/edits/page_title"), @object, context: {
|
2
|
+
<%= concept(base_class.concept_ns("cell/edits/page_title"), @object, context: {kono_user: kono_user,base_class:base_class}) %>
|
3
3
|
<% end %>
|
4
4
|
<% content_for :side_title do %>
|
5
|
-
<%= concept(base_class.concept_ns("cell/edits/side_title"), @object, context: {
|
5
|
+
<%= concept(base_class.concept_ns("cell/edits/side_title"), @object, context: {kono_user: kono_user,base_class:base_class}) %>
|
6
6
|
<% end %>
|
7
7
|
|
8
|
-
<%= concept(base_class.concept_ns("cell/form"), @object, context: {
|
8
|
+
<%= concept(base_class.concept_ns("cell/form"), @object, context: {kono_user: kono_user,base_class:base_class}) %>
|
@@ -1,2 +1,2 @@
|
|
1
1
|
<%= concept(@object.class.concept_ns("cell/inject"), @object,
|
2
|
-
params: params, context: {
|
2
|
+
params: params, context: {kono_user: kono_user, base_class: @object.class}) -%>
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<% content_for(:page_title) do %>
|
2
|
-
<%= concept(base_class.concept_ns("cell/index/page_title"), @objects, context: {
|
2
|
+
<%= concept(base_class.concept_ns("cell/index/page_title"), @objects, context: {kono_user: kono_user,base_class:base_class}) %>
|
3
3
|
<% end %>
|
4
4
|
<% content_for(:side_title) do %>
|
5
|
-
<%= concept(base_class.concept_ns("cell/index/side_title"), @objects, context: {
|
5
|
+
<%= concept(base_class.concept_ns("cell/index/side_title"), @objects, context: {kono_user: kono_user,base_class:base_class}) %>
|
6
6
|
<% end %>
|
7
7
|
|
8
|
-
<%= concept(base_class.concept_ns("cell/search"), @search, context: {
|
8
|
+
<%= concept(base_class.concept_ns("cell/search"), @search, context: {kono_user: kono_user,base_class:base_class}) unless @search.nil? %>
|
9
9
|
|
10
|
-
<%= concept(base_class.concept_ns("cell/index/table"), @objects, context: {
|
10
|
+
<%= concept(base_class.concept_ns("cell/index/table"), @objects, context: {kono_user: kono_user,base_class:base_class}) %>
|
@@ -1,9 +1,9 @@
|
|
1
1
|
<% content_for(:page_title) do %>
|
2
|
-
<%= concept(base_class.concept_ns("cell/create/page_title"), @object, context: {
|
2
|
+
<%= concept(base_class.concept_ns("cell/create/page_title"), @object, context: {kono_user: kono_user,base_class:base_class}) %>
|
3
3
|
<% end %>
|
4
4
|
<% content_for(:side_title) do %>
|
5
|
-
<%= concept(base_class.concept_ns("cell/create/side_title"), @object, context: {
|
5
|
+
<%= concept(base_class.concept_ns("cell/create/side_title"), @object, context: {kono_user: kono_user,base_class:base_class}) %>
|
6
6
|
<% end %>
|
7
7
|
|
8
8
|
|
9
|
-
<%= concept(base_class.concept_ns("cell/form"), @object, context: {
|
9
|
+
<%= concept(base_class.concept_ns("cell/form"), @object, context: {kono_user: kono_user,base_class:base_class}) %>
|
@@ -1,2 +1,2 @@
|
|
1
1
|
<%= concept(@object.class.concept_ns("cell/inject"), @object,
|
2
|
-
params: params, context: {
|
2
|
+
params: params, context: {kono_user: kono_user, base_class: @object.class}) -%>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<% content_for :page_title do %>
|
2
|
-
<%= concept(base_class.concept_ns("cell/shows/page_title"), @object, context: {
|
2
|
+
<%= concept(base_class.concept_ns("cell/shows/page_title"), @object, context: {kono_user: kono_user,base_class:base_class}) %>
|
3
3
|
<% end %>
|
4
4
|
<% content_for :side_title do %>
|
5
|
-
<%= concept(base_class.concept_ns("cell/shows/side_title"), @object, context: {
|
5
|
+
<%= concept(base_class.concept_ns("cell/shows/side_title"), @object, context: {kono_user: kono_user,base_class:base_class}) %>
|
6
6
|
<% end %>
|
7
7
|
|
8
|
-
<%= concept(base_class.concept_ns("cell/show"), @object, context: {
|
8
|
+
<%= concept(base_class.concept_ns("cell/show"), @object, context: {kono_user: kono_user,base_class:base_class}) %>
|
@@ -3,4 +3,4 @@
|
|
3
3
|
# target: params[:kono_utils][:modal_upgraded_target_container],
|
4
4
|
html_manipulation_method: 'replaceWith',
|
5
5
|
inject_show_modal: true,
|
6
|
-
context: {
|
6
|
+
context: {kono_user: kono_user, base_class: @object.class}) -%>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kono_utils_bootstrap_view4
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marino Bonetti
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
version: '1.1'
|
40
40
|
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 1.1.
|
42
|
+
version: 1.1.4
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -49,7 +49,7 @@ dependencies:
|
|
49
49
|
version: '1.1'
|
50
50
|
- - ">="
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: 1.1.
|
52
|
+
version: 1.1.4
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: kaminari
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -185,6 +185,7 @@ files:
|
|
185
185
|
- app/concepts/kono_utils/object/cell/buttons/edit.rb
|
186
186
|
- app/concepts/kono_utils/object/cell/buttons/list.rb
|
187
187
|
- app/concepts/kono_utils/object/cell/buttons/reset_search.rb
|
188
|
+
- app/concepts/kono_utils/object/cell/buttons/show.rb
|
188
189
|
- app/concepts/kono_utils/object/cell/create/base.rb
|
189
190
|
- app/concepts/kono_utils/object/cell/create/page_title.rb
|
190
191
|
- app/concepts/kono_utils/object/cell/create/side_title.rb
|
@@ -372,9 +373,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
372
373
|
version: '0'
|
373
374
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
374
375
|
requirements:
|
375
|
-
- - "
|
376
|
+
- - ">="
|
376
377
|
- !ruby/object:Gem::Version
|
377
|
-
version:
|
378
|
+
version: '0'
|
378
379
|
requirements: []
|
379
380
|
rubygems_version: 3.0.8
|
380
381
|
signing_key:
|