lato 0.1.19 → 0.1.22

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad4feff73a5b285980cad936d0fee7d95760fb60849a99bd0c3d0176142e3a21
4
- data.tar.gz: 3adc8605691d718271b8d166e6ed47117a8c18c608087b90cbec8695c1cbf2be
3
+ metadata.gz: ebadfc10ff6859504e6fe1c2b62134c7f082ecfb1ebbdb44b8e9b100d74b0e83
4
+ data.tar.gz: db6025f3b928e555f05ec3e34de73ad98ae588b4a8bb979a80a2ac089a445c0b
5
5
  SHA512:
6
- metadata.gz: 4eb0a4e4238e1785feaff6835fa58a23d5005ec42f3e089ad78b9ad4bb5acc1ec23d20a845a092857178fa25081ed9191880b248c4cfc0af24447af9032de3ec
7
- data.tar.gz: a679295a0941f082ebb1a51c836a22c23f9a75a43484797f05842f0f8bc871a417555d0cfcb3b27992656c3019fc5afb160a729a7af8d921ce89d1ad2552e80e
6
+ metadata.gz: ded2d5b2277f408fa562c99d426932f29575adeea27d8f80730db8eab7b50227147cae213c12b7bdea78c892e67e1e5c33d749458429414a7c33328cddf7fdeb
7
+ data.tar.gz: 8050c958de0bdf551f3f6210823acc8969e62a55405cccddccc32f75091a5396c8d6bd1967d6bc70387baf2d50441d70a1b67dce823a1337f4a22afab4a433d3
@@ -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
- <p>Work in progress</p>
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
- <% else %>
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>
@@ -0,0 +1,17 @@
1
+ en:
2
+ activerecord:
3
+ attributes:
4
+ lato/user:
5
+ first_name: First name
6
+ last_name: Last name
7
+ password_confirmation: Confirm password
8
+ email: Email
9
+ accepted_privacy_policy_version: Privacy policy
10
+ accepted_terms_and_conditions_version: Terms and conditions
11
+ models:
12
+ lato/user:
13
+ attributes:
14
+ accepted_privacy_policy_version:
15
+ inclusion: not accepted
16
+ accepted_terms_and_conditions_version:
17
+ inclusion: not accepted
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
@@ -1,3 +1,3 @@
1
1
  module Lato
2
- VERSION = "0.1.19"
2
+ VERSION = "0.1.22"
3
3
  end
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.19
4
+ version: 0.1.22
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-07 00:00:00.000000000 Z
11
+ date: 2022-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -176,6 +176,7 @@ files:
176
176
  - app/views/layouts/lato/application.html.erb
177
177
  - app/views/layouts/lato/mailer.html.erb
178
178
  - config/importmap.rb
179
+ - config/locales/en.yml
179
180
  - config/locales/it.yml
180
181
  - config/routes.rb
181
182
  - db/migrate/20221022205744_create_lato_users.rb