zutils 3.0.1 → 3.0.2

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: e7d2ca7875c5cbac73748c37b83b6585c114033acb1d53ebffe8ac023b6667c9
4
+ data.tar.gz: c44982f7748a5ce410e3a1a25d32d559ae39ef8038c6ffee24141c27d8a50e43
5
5
  SHA512:
6
- metadata.gz: c9c6e9cdd5e020bd8bfba4eabbbe7e96b5880152bd5a0382e61d0e918efe348e1806727f73a171d9bc11a4e37d03501caa26c07d5cf52ccf02661979042ffc9e
7
- data.tar.gz: 6818e5dc37b81b7c4b68be9fbb91c59766de41c4cffb6160c88cdf2e341537874e6bf9ac2bd6844dfa365963ff7e308dfd2f8de95cdf38ebdac60cc59a02bc40
6
+ metadata.gz: 78e0a5f117208de343e28c7870b9de07f84747ef28e0d3f1717d1113993ff67cda831f5bec0c4e6b79eef9b01b45e914448c9a056b9700e8c35e02ccc5f6b84f
7
+ data.tar.gz: b474063b7effcbcd514cd12131d0b6bffa31565b14886d727b449ff50f56ccc1b987562e649869016dc8be65427240e969a76f59c1074230b7f3b1077398d2d2
@@ -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) %>
@@ -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.2"
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.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Viana