lato 0.1.19 → 0.1.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/lato/components_helper.rb +18 -0
- data/app/views/lato/components/_index.html.erb +25 -30
- data/lib/lato/btstrap.rb +1 -1
- data/lib/lato/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e341af1abdc45fd1bd1676413dda8067d5d4e304162595688d39238a1ac0f76b
|
4
|
+
data.tar.gz: 260f04739041cbbabf4228ea860acca5be4a1a8c66c82832267b4f468eded4aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 511960e3a047e5d80547ac0b83ddf4ca4270bf3248ba608c62c72da1ecf5cf330eb7f79a06e3e9ea47e99e9364d5da643da114f36836419bb99349d30554245c
|
7
|
+
data.tar.gz: 9e5e79926336ec3a85c1304214cfad71b41d93aedd2623a128a0f9735b24f2a8dfcdf94aa2c33166a8e91f51a4ea309965fc979bf4dcd0fed522b5460370c8b7
|
@@ -171,6 +171,24 @@ module Lato
|
|
171
171
|
form.file_field key, options
|
172
172
|
end
|
173
173
|
|
174
|
+
def lato_form_item_input_textarea(form, key, options = {})
|
175
|
+
_lato_form_input_options(form, key, options, :keyup, 'form-control')
|
176
|
+
|
177
|
+
form.text_area key, options
|
178
|
+
end
|
179
|
+
|
180
|
+
def lato_form_item_input_date(form, key, options = {})
|
181
|
+
_lato_form_input_options(form, key, options, :change, 'form-control')
|
182
|
+
|
183
|
+
form.date_field key, options
|
184
|
+
end
|
185
|
+
|
186
|
+
def lato_form_item_input_datetime(form, key, options = {})
|
187
|
+
_lato_form_input_options(form, key, options, :change, 'form-control')
|
188
|
+
|
189
|
+
form.datetime_field key, options
|
190
|
+
end
|
191
|
+
|
174
192
|
def lato_form_submit(form, label, options = {})
|
175
193
|
options[:class] ||= []
|
176
194
|
options[:class].push('btn')
|
@@ -7,43 +7,38 @@
|
|
7
7
|
<% end %>
|
8
8
|
|
9
9
|
<% if false && browser.device.mobile? %>
|
10
|
+
<!-- Free for custom mobile version -->
|
11
|
+
<% else %>
|
10
12
|
|
11
|
-
|
13
|
+
<% if custom_actions.any? || searchable_columns.any? %>
|
14
|
+
<div class="d-flex justify-content-between mb-3">
|
15
|
+
<% if searchable_columns.any? %>
|
16
|
+
<div class="input-group">
|
17
|
+
<input type="text" name="search" class="form-control" placeholder="Ricerca per: <%= searchable_columns.map { |c| collection.model.human_attribute_name(c) }.to_sentence %>" value="<%= params[:search] %>">
|
18
|
+
<button class="btn btn-outline-primary" type="submit"><i class="bi bi-search"></i></button>
|
19
|
+
</div>
|
20
|
+
<% else %>
|
21
|
+
<div></div>
|
22
|
+
<% end %>
|
12
23
|
|
13
|
-
|
24
|
+
<div class="btn-group ms-2">
|
25
|
+
<% if custom_actions.any? %>
|
26
|
+
<% custom_actions.each do |action_key, action_params| %>
|
27
|
+
<%= link_to action_params[:path], { class: 'btn btn-primary' }.merge(action_params) do %>
|
28
|
+
<i class="<%= action_params[:icon] %>"></i>
|
29
|
+
<% end %>
|
30
|
+
<% end %>
|
31
|
+
<% end %>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
<% end %>
|
14
35
|
|
15
36
|
<div class="table-responsive">
|
16
37
|
<table class="table table-striped table-bordered">
|
17
38
|
<thead>
|
18
|
-
<% if custom_actions.any? || searchable_columns.any? %>
|
19
|
-
<tr>
|
20
|
-
<td colspan="<%= columns.length %>">
|
21
|
-
<div class="d-flex justify-content-between">
|
22
|
-
<% if searchable_columns.any? %>
|
23
|
-
<div class="input-group">
|
24
|
-
<input type="text" name="search" class="form-control" placeholder="Ricerca per: <%= searchable_columns.map { |c| collection.model.human_attribute_name(c) }.to_sentence %>" value="<%= params[:search] %>">
|
25
|
-
<button class="btn btn-outline-primary" type="submit"><i class="bi bi-search"></i></button>
|
26
|
-
</div>
|
27
|
-
<% else %>
|
28
|
-
<div></div>
|
29
|
-
<% end %>
|
30
|
-
|
31
|
-
<div class="btn-group ms-2">
|
32
|
-
<% if custom_actions.any? %>
|
33
|
-
<% custom_actions.each do |action_key, action_params| %>
|
34
|
-
<%= link_to action_params[:path], { class: 'btn btn-primary' }.merge(action_params) do %>
|
35
|
-
<i class="<%= action_params[:icon] %>"></i>
|
36
|
-
<% end %>
|
37
|
-
<% end %>
|
38
|
-
<% end %>
|
39
|
-
</div>
|
40
|
-
</div>
|
41
|
-
</td>
|
42
|
-
</tr>
|
43
|
-
<% end %>
|
44
39
|
<tr class="align-middle">
|
45
40
|
<% columns.each do |column| %>
|
46
|
-
<th scope="col">
|
41
|
+
<th scope="col" class="lato-index-col-<%= column %>">
|
47
42
|
<div class="d-flex align-items-center">
|
48
43
|
<span><%= collection.model.human_attribute_name column %></span>
|
49
44
|
<% if sortable_columns.include?(column) %>
|
@@ -68,7 +63,7 @@
|
|
68
63
|
<% collection.each do |member| %>
|
69
64
|
<tr>
|
70
65
|
<% columns.each do |column| %>
|
71
|
-
<td>
|
66
|
+
<td class="lato-index-col-<%= column %>">
|
72
67
|
<% viewer_function_name = "#{model_name_underscore}_#{column}" %>
|
73
68
|
<%= respond_to?(viewer_function_name) ? send(viewer_function_name, member) : member.send(column) %>
|
74
69
|
</td>
|
data/lib/lato/btstrap.rb
CHANGED
@@ -29,7 +29,7 @@ module Lato
|
|
29
29
|
@content_container = 'container-fluid'
|
30
30
|
|
31
31
|
# Footer defaults
|
32
|
-
@footer = 'bg-light px-md-3 py-2'
|
32
|
+
@footer = 'bg-light px-md-3 py-2 border-top'
|
33
33
|
@footer_container = 'container-fluid text-center text-muted d-md-flex justify-content-between p-3'
|
34
34
|
end
|
35
35
|
end
|
data/lib/lato/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lato
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregorio Galante
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|