zutils 3.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d324c51d55fbc3c4b4b504b566b4cfcec75add45d14ed79995c1613f010fdc1
4
- data.tar.gz: 7c582d7a7ea2a95368fb69ed3c4c7db3758abe1ef3b07aacb30919c19d01ed7a
3
+ metadata.gz: 176587a0bde4bded17898e5355e7c28ac5583f4b4f72856cd7a0d1759d2a4500
4
+ data.tar.gz: 5b4f7b6bc3a89b519182ef1614b9bb4ad14e3cb4c2ba7686af9e4dda16bcc8dc
5
5
  SHA512:
6
- metadata.gz: 1931449bd2e9cfaad73a415c1cded45c8fd30c0d9ba0cede4008cddc6ee4866bd33380765e74aef22003c54ef3baa75611ed06c2b2a48441ee22a18672cda24b
7
- data.tar.gz: d8d96656c6bc5713ca863b717f040814538ed8f84c96e0ef5e6b3915dfe71f4d52ae69c5a282147330114496e4d3863b0baf986e9773a0ebf7066cfc203c7044
6
+ metadata.gz: c9c6e9cdd5e020bd8bfba4eabbbe7e96b5880152bd5a0382e61d0e918efe348e1806727f73a171d9bc11a4e37d03501caa26c07d5cf52ccf02661979042ffc9e
7
+ data.tar.gz: 6818e5dc37b81b7c4b68be9fbb91c59766de41c4cffb6160c88cdf2e341537874e6bf9ac2bd6844dfa365963ff7e308dfd2f8de95cdf38ebdac60cc59a02bc40
@@ -0,0 +1,46 @@
1
+ <% card_color ||= 'danger' %>
2
+ <% default_field = {name: :id_eq, attrs: {label: false, required: false, placeholder: 'ID', wrapper: false}} %>
3
+ <% received_field = defined?(main_field) ? main_field : {} %>
4
+ <% main_field = default_field.deep_merge(received_field) %>
5
+ <%= search_form_for @q, url: url do |f| %>
6
+ <div class="card card-outline card-<%= card_color %>" data-controller='filtering'>
7
+ <div class="card-header with-bormainder">
8
+ <div class="input-group">
9
+ <div class="input-group-prepend">
10
+ <button type="button" class="btn btn-<%= card_color %>" data-action="click->filtering#toggle">
11
+ <i class="fa fa-angle-right" data-filtering-target='icon'></i>
12
+ <span class="d-none d-sm-inline-block">
13
+ Filtrar
14
+ </span>
15
+ </button>
16
+ </div>
17
+ <%= f.input (main_field&.dig(:name) || :id_eq), main_field&.dig(:attrs) %>
18
+ <div class="input-group-append">
19
+ <%= button_tag type: "submit", class: "btn btn-#{card_color}" do %>
20
+ <i class="fa fa-search"></i>
21
+ <span class="d-none d-sm-inline-block">
22
+ Buscar
23
+ </span>
24
+ <% end %>
25
+ </div>
26
+ </div>
27
+ <div class="row">
28
+ <div class="col-md-12 active-filters" data-filtering-target='filters'></div>
29
+ </div>
30
+ </div>
31
+ <div class="card-body" style='display: none;' data-filtering-target='body'>
32
+ <div class="row">
33
+ <% search_fields ||= [] %>
34
+ <% search_fields.each do |sf| %>
35
+ <% default_attrs = {required: false, wrapper_html: {class: "col-md-3"}} %>
36
+ <% received_attrs = sf.dig(:attrs) || {} %>
37
+ <% attrs = default_attrs.deep_merge(received_attrs) %>
38
+ <%= f.input sf.dig(:name), attrs %>
39
+ <% end %>
40
+ </div>
41
+ <%= button_tag type: "submit", class: "btn btn-#{card_color}" do %>
42
+ <i class="fa fa-search"></i> Buscar
43
+ <% end %>
44
+ </div>
45
+ </div>
46
+ <% end %>
@@ -1,3 +1,3 @@
1
1
  module Zutils
2
- VERSION = "3.0.0"
2
+ VERSION = "3.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zutils
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Viana
@@ -76,6 +76,7 @@ files:
76
76
  - app/views/shared/_index.html.erb
77
77
  - app/views/shared/_list.html.erb
78
78
  - app/views/shared/_modal.html.erb
79
+ - app/views/shared/_search_form.html.erb
79
80
  - app/views/shared/_show.html.erb
80
81
  - bin/console
81
82
  - bin/setup