zutils 3.0.1 → 3.0.3

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: 176587a0bde4bded17898e5355e7c28ac5583f4b4f72856cd7a0d1759d2a4500
4
- data.tar.gz: 5b4f7b6bc3a89b519182ef1614b9bb4ad14e3cb4c2ba7686af9e4dda16bcc8dc
3
+ metadata.gz: d29ba1edd74e7b4f566ca7c5ba836fdfa9379935f40f840c1dd0aed39acc52ca
4
+ data.tar.gz: c96adbedbc6a8cbe1507b0b48e8d2c8aa6b63e66b388b7259b72c02f62ffedbe
5
5
  SHA512:
6
- metadata.gz: c9c6e9cdd5e020bd8bfba4eabbbe7e96b5880152bd5a0382e61d0e918efe348e1806727f73a171d9bc11a4e37d03501caa26c07d5cf52ccf02661979042ffc9e
7
- data.tar.gz: 6818e5dc37b81b7c4b68be9fbb91c59766de41c4cffb6160c88cdf2e341537874e6bf9ac2bd6844dfa365963ff7e308dfd2f8de95cdf38ebdac60cc59a02bc40
6
+ metadata.gz: fa7f753fb7b3d683c418e8e7ba4df0ada9d84e45be12ac63958645c38c86a584ff46f96b367355c97b0f2b0616252e3241e0b27883f1a67bb6eb1170035c00a7
7
+ data.tar.gz: 7ee69113e41d4c5b0ad80b2963e792fa05352a6366c4d563932bb0ffaad763aa2ff4cfc7c5409ef9d195941417a9d5b6ac34ee6d157eb29f9c18665f1ec1fb43
@@ -1,6 +1,9 @@
1
1
  <% size ||= "md" %>
2
2
  <% labels ||= false %>
3
3
  <% hide ||= [] %>
4
+ <% new_color ||= 'primary' %>
5
+ <% edit_color ||= 'warning' %>
6
+ <% delete_color ||= 'danger' %>
4
7
  <div class="row">
5
8
  <div class="col text-nowrap">
6
9
  <% unless hide.include? "show" %>
@@ -16,7 +19,7 @@
16
19
  <% end %>
17
20
  <% unless hide.include? "new" %>
18
21
  <%= link_to eval_with_rescue("new_#{[object].flatten.map{|x| x.class.to_s.underscore}.join("_")}_path"),
19
- class: "mb-1 btn btn-#{size} btn-danger", data: { "bs-toggle": "tooltip", "bs-placement": "top", "bs-title": "Cadastrar" } do %>
22
+ class: "mb-1 btn btn-#{size} btn-#{new_color}", data: { "bs-toggle": "tooltip", "bs-placement": "top", "bs-title": "Cadastrar" } do %>
20
23
  <% if labels %>
21
24
  <div class="d-none d-sm-inline-block">
22
25
  Cadastrar
@@ -27,7 +30,7 @@
27
30
  <% end %>
28
31
  <% unless hide.include? "edit" %>
29
32
  <%= link_to eval_with_rescue("edit_#{[object].flatten.map{|x| x.class.to_s.underscore}.join("_")}_path(#{object.id})"),
30
- class: "mb-1 btn btn-#{size} btn-warning", data: { "bs-toggle": "tooltip", "bs-placement": "top", "bs-title": "Editar" } do %>
33
+ class: "mb-1 btn btn-#{size} btn-#{edit_color}", data: { "bs-toggle": "tooltip", "bs-placement": "top", "bs-title": "Editar" } do %>
31
34
  <% if labels %>
32
35
  <div class="d-none d-sm-inline-block">
33
36
  Editar
@@ -50,7 +53,7 @@
50
53
  <% unless hide.include? "delete" %>
51
54
  <%= button_to object, method: :delete, form: { data: { turbo_confirm: 'Tem certeza?' }, class: 'd-inline'},
52
55
  data: { "bs-toggle": "tooltip", "bs-placement": "top", "bs-title": "Apagar" },
53
- class: "mb-1 btn btn-#{size} btn-dark" do %>
56
+ class: "mb-1 btn btn-#{size} btn-#{delete_color}" do %>
54
57
  <% if labels %>
55
58
  <div class="d-none d-sm-inline-block">
56
59
  Apagar
@@ -64,7 +67,7 @@
64
67
  <div class="col col-auto text-right">
65
68
  <%= button_to object, method: :delete, form: { data: { turbo_confirm: 'Tem certeza?' }, class: 'd-inline'},
66
69
  data: { "bs-toggle": "tooltip", "bs-placement": "top", "bs-title": "Apagar" },
67
- class: "mb-1 btn btn-#{size} btn-dark" do %>
70
+ class: "mb-1 btn btn-#{size} btn-#{delete_color}" do %>
68
71
  <% if labels %>
69
72
  <div class="d-none d-sm-inline-block">
70
73
  Apagar
@@ -9,6 +9,10 @@
9
9
  <% hide ||= %w[show delete] %>
10
10
  <% size ||= "xs" %>
11
11
 
12
+ <% new_color ||= 'primary' %>
13
+ <% edit_color ||= 'warning' %>
14
+ <% delete_color ||= 'danger' %>
15
+
12
16
  <% if show_columns.empty? %>
13
17
  <% form_fields ||= (object.class.respond_to?('form_fields') ? object.class.form_fields : {}) %>
14
18
  <% form_ordered_fields ||= (form_fields.empty? ? object.class.column_names : form_fields.keys) %>
@@ -28,7 +32,7 @@
28
32
  </div>
29
33
  <div class="col-12 col-md mr-auto">
30
34
  <% if can? :manage, object %>
31
- <%= render "shared/btn_action_links", size: "xs", object: object, labels: true, hide: hide %>
35
+ <%= render "shared/btn_action_links", size: "xs", object: object, labels: true, hide: hide, new_color: new_color, edit_color: edit_color, delete_color: delete_color %>
32
36
  <% end %>
33
37
  </div>
34
38
  </div>
@@ -206,4 +210,4 @@
206
210
  <% end %>
207
211
  <% end %>
208
212
  <% end %>
209
- <%= render "shared/btn_action_links", object: object, labels: true, hide: hide %>
213
+ <%= render "shared/btn_action_links", object: object, labels: true, hide: hide, new_color: new_color, edit_color: edit_color, delete_color: delete_color %>
@@ -1,3 +1,3 @@
1
1
  module Zutils
2
- VERSION = "3.0.1"
2
+ VERSION = "3.0.3"
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.1
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Viana