kono_utils 0.15.7 → 0.15.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/kono_utils/_kono_styles.css.scss +39 -0
- data/app/assets/stylesheets/kono_utils/utils.css.scss +1 -40
- data/app/views/kono_utils/application/_search_panel.html.erb +36 -0
- data/lib/kono_utils/application_helper.rb +15 -55
- data/lib/kono_utils/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1d4a2bf7e2dbae323d6eb43811a4e00e89bcb3b
|
4
|
+
data.tar.gz: 5887a7c0415db3d9ff06f990033c3ec52f9a714b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 087d7ad951c8ff2eaacea027fe810a2c6ea5f8a7c0ae7b538542220b5df6e4428b9eec8977dc027cb8c700cb7c2941a80b8858be4f757363ab8d578f6ca7fae2
|
7
|
+
data.tar.gz: 70720a403e85e2cf18bdb994a6b0f2c1aa36e9f57b6cd3bf0048dcc2a84187b0150f55ae14b75646d385402bf5be74711e245290101c2bc4fbdbbfc850add86a
|
@@ -0,0 +1,39 @@
|
|
1
|
+
.kono_delete_button, .kono_edit_button {
|
2
|
+
margin: 1px;
|
3
|
+
&.align-right {
|
4
|
+
float: right;
|
5
|
+
}
|
6
|
+
&.align-left {
|
7
|
+
float: left;
|
8
|
+
}
|
9
|
+
}
|
10
|
+
|
11
|
+
.search_panel {
|
12
|
+
.panel-title {
|
13
|
+
.icon-search {
|
14
|
+
cursor: pointer;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
.bs_file_download {
|
20
|
+
.form-wrapper {
|
21
|
+
display: block;
|
22
|
+
.input-group{
|
23
|
+
width:100%;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
//classi per una spaziatura verticale , utilizzare
|
29
|
+
// passando la classe generale v-space e poi il valore scelto: space-x1
|
30
|
+
// ogni valore dello spacer rappresente 0.2em
|
31
|
+
//ES:
|
32
|
+
// <div class="kono-v-spacer space-x2"></div> => 0.4em
|
33
|
+
.kono-v-spacer {
|
34
|
+
@for $i from 1 through 20 {
|
35
|
+
&.space-x#{$i} {
|
36
|
+
height: 0.2em * $i;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
}
|
@@ -1,43 +1,4 @@
|
|
1
1
|
@import 'bootstrap-sprockets';
|
2
2
|
@import 'bootstrap';
|
3
3
|
@import 'bootstrap-datetimepicker';
|
4
|
-
|
5
|
-
.kono_delete_button, .kono_edit_button {
|
6
|
-
margin: 1px;
|
7
|
-
&.align-right {
|
8
|
-
float: right;
|
9
|
-
}
|
10
|
-
&.align-left {
|
11
|
-
float: left;
|
12
|
-
}
|
13
|
-
}
|
14
|
-
|
15
|
-
.search_panel {
|
16
|
-
.panel-title {
|
17
|
-
.icon-search {
|
18
|
-
cursor: pointer;
|
19
|
-
}
|
20
|
-
}
|
21
|
-
}
|
22
|
-
|
23
|
-
.bs_file_download {
|
24
|
-
.form-wrapper {
|
25
|
-
display: block;
|
26
|
-
.input-group{
|
27
|
-
width:100%;
|
28
|
-
}
|
29
|
-
}
|
30
|
-
}
|
31
|
-
|
32
|
-
//classi per una spaziatura verticale , utilizzare
|
33
|
-
// passando la classe generale v-space e poi il valore scelto: space-x1
|
34
|
-
// ogni valore dello spacer rappresente 0.2em
|
35
|
-
//ES:
|
36
|
-
// <div class="kono-v-spacer space-x2"></div> => 0.4em
|
37
|
-
.kono-v-spacer {
|
38
|
-
@for $i from 1 through 20 {
|
39
|
-
&.space-x#{$i} {
|
40
|
-
height: 0.2em * $i;
|
41
|
-
}
|
42
|
-
}
|
43
|
-
}
|
4
|
+
@import 'kono_styles';
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<div class="panel panel-default search_panel">
|
2
|
+
<div class="panel-heading">
|
3
|
+
<h3 class="panel-title collapse_search">
|
4
|
+
<span><%= t(:search) %></span>
|
5
|
+
<div class="pull-right icon-search">
|
6
|
+
<%= fa_icon("search") %>
|
7
|
+
<span class="caret"></span>
|
8
|
+
</div>
|
9
|
+
</h3>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
|
13
|
+
<div class="collapsible_panel <%= search_model.data_loaded? ? 'uncollapsed' : '' %>">
|
14
|
+
<div class="panel-body">
|
15
|
+
<%= form.fields_builder(:field_options => field_option) %>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<div class="panel-footer text-right">
|
19
|
+
|
20
|
+
<%= button_tag(t(:search), type: "submit", class: "btn btn-primary") %>
|
21
|
+
|
22
|
+
<% if search_model.data_loaded? and !reset_path.nil? %>
|
23
|
+
<%= link_to(content_tag(:span, nil, class: 'glyphicon glyphicon-remove'), reset_path, class: 'btn btn-info') %>
|
24
|
+
<% end %>
|
25
|
+
|
26
|
+
|
27
|
+
<% bf = ActiveSupport::SafeBuffer.new
|
28
|
+
buttons_editor.call(form, bf)
|
29
|
+
%>
|
30
|
+
<%= bf %>
|
31
|
+
|
32
|
+
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
|
36
|
+
</div>
|
@@ -82,58 +82,18 @@ module KonoUtils
|
|
82
82
|
:reset_path => nil,
|
83
83
|
:form_opts => {},
|
84
84
|
:field_option => {:wrapper_html => {:class => "col-xs-12 col-sm-6 col-md-4 col-lg-3"}},
|
85
|
-
:buttons_editor => Proc.new {
|
85
|
+
:buttons_editor => Proc.new {|form_obj, sb| sb}
|
86
86
|
}.merge(args)
|
87
87
|
|
88
|
-
reset_path = args[:reset_path]
|
89
|
-
|
90
|
-
field_option = args[:field_option]
|
91
|
-
|
92
88
|
base_search_form_wrapper(search_model, {:attributes => args[:attributes], :form_opts => args[:form_opts]}) do |f|
|
93
|
-
content_tag :div, class: "panel panel-default search_panel" do
|
94
|
-
|
95
|
-
buffer = ActiveSupport::SafeBuffer.new
|
96
|
-
|
97
|
-
buffer<< content_tag(:div, class: 'panel-heading') do
|
98
|
-
content_tag :h3, class: "panel-title collapse_search" do
|
99
|
-
header = ActiveSupport::SafeBuffer.new
|
100
|
-
|
101
|
-
header<< content_tag(:span, t(:search))
|
102
|
-
|
103
|
-
header<<content_tag(:div, fa_icon("search") + content_tag(:span, nil, class: 'caret'), class: 'pull-right icon-search')
|
104
|
-
|
105
|
-
header
|
106
|
-
end
|
107
|
-
end
|
108
|
-
|
109
|
-
buffer<< content_tag(:div, class: "collapsible_panel #{(search_model.data_loaded? ? 'uncollapsed' : '')}") do
|
110
|
-
fb_collapse = ActiveSupport::SafeBuffer.new
|
111
|
-
|
112
|
-
fb_collapse << content_tag(:div, class: "panel-body") do
|
113
|
-
f.fields_builder(:field_options => field_option)
|
114
|
-
end
|
115
|
-
|
116
|
-
|
117
|
-
fb_collapse << content_tag(:div, class: 'panel-footer text-right') do
|
118
|
-
form_buffer = ActiveSupport::SafeBuffer.new
|
119
89
|
|
120
|
-
|
90
|
+
render :partial => '/application/search_panel.html', locals: {
|
91
|
+
form: f,
|
92
|
+
search_model: search_model
|
93
|
+
}.merge(args)
|
121
94
|
|
122
|
-
if search_model.data_loaded? and !reset_path.nil?
|
123
|
-
form_buffer<< link_to(content_tag(:span, nil, class: 'glyphicon glyphicon-remove'), reset_path, class: 'btn btn-info')
|
124
|
-
end
|
125
|
-
|
126
|
-
args[:buttons_editor].call(f, form_buffer)
|
127
|
-
end
|
128
|
-
|
129
|
-
fb_collapse
|
130
|
-
end
|
131
|
-
|
132
|
-
buffer
|
133
|
-
end
|
134
95
|
end
|
135
96
|
|
136
|
-
|
137
97
|
end
|
138
98
|
|
139
99
|
class BaseSearchFormWrapper < Struct.new(:formtastic_form, :attributes, :current_user)
|
@@ -204,7 +164,7 @@ module KonoUtils
|
|
204
164
|
#
|
205
165
|
def enum_collection(model, attribute, variant=nil)
|
206
166
|
|
207
|
-
model.send(attribute.to_s.pluralize(2).to_sym).collect {
|
167
|
+
model.send(attribute.to_s.pluralize(2).to_sym).collect {|key, val|
|
208
168
|
[enum_translation(model, attribute, key, variant), key]
|
209
169
|
}.to_h
|
210
170
|
end
|
@@ -337,7 +297,7 @@ module KonoUtils
|
|
337
297
|
content_tag :div, class: "kono_edit_button align-#{options[:align]} #{options[:class]}", :data => {updatable_content: options[:updatable_content]} do
|
338
298
|
buffer = ActiveSupport::SafeBuffer.new
|
339
299
|
|
340
|
-
buffer << button_tag(data: {toggle: 'modal', target: "##{id}"}, class: "btn btn-default btn-xs #{options[:btn_class]}") {
|
300
|
+
buffer << button_tag(data: {toggle: 'modal', target: "##{id}"}, class: "btn btn-default btn-xs #{options[:btn_class]}") {fa_icon(options[:bnt_icon])}
|
341
301
|
|
342
302
|
buffer << capture do
|
343
303
|
block.call(id)
|
@@ -373,7 +333,7 @@ module KonoUtils
|
|
373
333
|
|
374
334
|
buffer = ActiveSupport::SafeBuffer.new
|
375
335
|
|
376
|
-
buffer<<button_tag(data: {toggle: 'modal', target: "##{id}"}, class: 'btn btn-danger btn-xs') {
|
336
|
+
buffer<<button_tag(data: {toggle: 'modal', target: "##{id}"}, class: 'btn btn-danger btn-xs') {fa_icon(options[:bnt_icon])}
|
377
337
|
|
378
338
|
buffer<< content_tag(:div,
|
379
339
|
class: 'modal fade',
|
@@ -417,7 +377,7 @@ module KonoUtils
|
|
417
377
|
##
|
418
378
|
# Colleziona i mesi per la select box
|
419
379
|
def month_collection
|
420
|
-
(1..12).collect {
|
380
|
+
(1..12).collect {|m| [t('date.month_names')[m].capitalize, m]}
|
421
381
|
end
|
422
382
|
|
423
383
|
|
@@ -531,10 +491,10 @@ module KonoUtils
|
|
531
491
|
c = ActiveSupport::SafeBuffer.new
|
532
492
|
|
533
493
|
fields.each do |f|
|
534
|
-
::Rails.logger.debug {
|
535
|
-
::Rails.logger.debug {
|
536
|
-
::Rails.logger.debug {
|
537
|
-
c<<content_tag(:th, form.object.class.human_attribute_name("#{field}.#{f}"),class:"multi_tab_#{f}")
|
494
|
+
::Rails.logger.debug {form.object.class.inspect}
|
495
|
+
::Rails.logger.debug {field}
|
496
|
+
::Rails.logger.debug {f.inspect}
|
497
|
+
c<<content_tag(:th, form.object.class.human_attribute_name("#{field}.#{f}"), class: "multi_tab_#{f}")
|
538
498
|
end
|
539
499
|
unless options[:disable_duplication]
|
540
500
|
c<<content_tag(:td, nil)
|
@@ -547,14 +507,14 @@ module KonoUtils
|
|
547
507
|
b<<content_tag(:tbody) do
|
548
508
|
form.semantic_fields_for(*semantic_form_nested) do |measure|
|
549
509
|
|
550
|
-
default_execution = Proc.new {
|
510
|
+
default_execution = Proc.new {|field| measure.input field, :label => false}
|
551
511
|
|
552
512
|
content_tag :tr, class: "form-inline list riga_misura" do
|
553
513
|
|
554
514
|
d = ActiveSupport::SafeBuffer.new
|
555
515
|
|
556
516
|
fields.each do |f|
|
557
|
-
d<<content_tag(:td,class:"multi_tab_#{f}") do
|
517
|
+
d<<content_tag(:td, class: "multi_tab_#{f}") do
|
558
518
|
|
559
519
|
if block_given?
|
560
520
|
yield(f, measure, default_execution)
|
data/lib/kono_utils/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kono_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marino
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|
@@ -247,6 +247,7 @@ files:
|
|
247
247
|
- README.rdoc
|
248
248
|
- Rakefile
|
249
249
|
- app/assets/javascripts/kono_utils/utilities.coffee
|
250
|
+
- app/assets/stylesheets/kono_utils/_kono_styles.css.scss
|
250
251
|
- app/assets/stylesheets/kono_utils/utils.css.scss
|
251
252
|
- app/controllers/kono_utils/change_log_controller.rb
|
252
253
|
- app/input/bs_aceeditor_input.rb
|
@@ -260,6 +261,7 @@ files:
|
|
260
261
|
- app/input/bs_readonly_input.rb
|
261
262
|
- app/input/bs_timepicker_input.rb
|
262
263
|
- app/policies/kono_utils/base_editing_policy_concern.rb
|
264
|
+
- app/views/kono_utils/application/_search_panel.html.erb
|
263
265
|
- app/views/kono_utils/base_editing/_edit.html.erb
|
264
266
|
- app/views/kono_utils/base_editing/_edit_page_side_title_header.html.erb
|
265
267
|
- app/views/kono_utils/base_editing/_edit_page_title_header.html.erb
|