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 +4 -4
- data/app/views/shared/_btn_action_links.html.erb +7 -4
- data/app/views/shared/_show.html.erb +6 -2
- data/lib/zutils/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d29ba1edd74e7b4f566ca7c5ba836fdfa9379935f40f840c1dd0aed39acc52ca
|
4
|
+
data.tar.gz: c96adbedbc6a8cbe1507b0b48e8d2c8aa6b63e66b388b7259b72c02f62ffedbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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
|
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
|
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 %>
|
data/lib/zutils/version.rb
CHANGED