zutils 0.2.6 → 0.2.7

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: ba4c33f9ee3a6cb1d3fe38ae66444b74316565e35077166c1637356ec6a0af12
4
- data.tar.gz: 07d346dfbcfbf646ba7734615910106ab1b1c3ffafc8b18261ab839971a24e94
3
+ metadata.gz: 0e2d69c2da15caf145355c2c8c65eaa556ad46dc8e8d9e2bf7bd9b3830d3d95f
4
+ data.tar.gz: 3db052d159a7be184cb124a890d53ce9a23492fa64ac73f8bce6ec51ab0794c0
5
5
  SHA512:
6
- metadata.gz: 0f501a7638548dbe39f9ffb37eecc4067491da65a18dacb633b5d1cafcd9b534bdeed749abcee1327ce83f27ff6fda90f454fa44989934381baab55a1a794145
7
- data.tar.gz: a14a48a120b6dfc03d48acb32c34bc86d09f818d21a59c7ccfe33da92beb6d9dbd51cf10539faa46e69ec2780fd4f2dfc6a6756528063f5c1461cd061ae64434
6
+ metadata.gz: ced26faf4d38770bd0a40b6ebb677ce7de8795f50099680446d527a6e277d41786a521bd7c255bedb0e3ccba7326f2ed1c4b86b51836fa62893898c8e1c56e0a
7
+ data.tar.gz: ada509e3eb65c4321f3fa82f541b4df864fde2401bcfeedce8fe666113f8a848110eab179df361a1679a9e74e579d471a38e7c8ecef82e64ab52196eed1fb106
@@ -10,7 +10,7 @@
10
10
  <div class='box box-<%= box_class %>'>
11
11
  <div class="box-header with-border">
12
12
  <h3 class="box-title">
13
- <%=t Kernel.const_get(controller_name.singularize.camelize).model_name.human.pluralize %>
13
+ <%= list.proxy_association.klass.model_name.human.pluralize %>
14
14
  </h3>
15
15
  </div>
16
16
  <div class="box-body">
@@ -56,13 +56,13 @@
56
56
  <% if can? :new, controller_name.singularize %>
57
57
  <% if nested_resource == true %>
58
58
  <% if parent_resource %>
59
- <%= link_to eval("new_#{parent_resource}_#{controller_name.singularize}_path"), class: "btn btn-#{box_class}" do %>
60
- <%= t('.new', default: t("helpers.links.new")) %> <%= Kernel.const_get(controller_name.singularize.camelize).model_name.human %> <i class='fa fa-plus'></i>
59
+ <%= link_to eval("new_#{parent_resource.class.model_name.singular}_#{list.proxy_association.klass.model_name.singular}_path(#{parent_resource.id})"), class: "btn btn-#{box_class}" do %>
60
+ <%= t('.new', default: t("helpers.links.new")) %> <%= list.proxy_association.klass.model_name.human %> <i class='fa fa-plus'></i>
61
61
  <% end %>
62
62
  <% end %>
63
63
  <% else %>
64
- <%= link_to eval("new_#{controller_name.singularize}_path"), class: "btn btn-#{box_class}" do %>
65
- <%= t('.new', default: t("helpers.links.new")) %> <%= Kernel.const_get(controller_name.singularize.camelize).model_name.human %> <i class='fa fa-plus'></i>
64
+ <%= link_to eval("new_#{list.proxy_association.klass.model_name.singular}_path"), class: "btn btn-#{box_class}" do %>
65
+ <%= t('.new', default: t("helpers.links.new")) %> <%= list.proxy_association.klass.model_name.human %> <i class='fa fa-plus'></i>
66
66
  <% end %>
67
67
  <% end %>
68
68
  <% end %>
@@ -1,6 +1,7 @@
1
1
  <% exceptions ||= ['created_at', 'updated_at', 'deleted_at'] %>
2
2
  <% excluded_columns ||= [] %>
3
3
  <% additional_columns ||= [] %>
4
+ <% additional_actions ||= [] %>
4
5
  <% hide_actions ||= false %>
5
6
  <% sort_fields ||= [] %>
6
7
  <% sort_all ||= false %>
@@ -60,7 +61,7 @@
60
61
  <% end %>
61
62
  <% unless hide_actions %>
62
63
  <td>
63
- <%= render 'shared/action_links', object: object %>
64
+ <%= render 'shared/action_links', object: object, additional_actions: additional_actions %>
64
65
  </td>
65
66
  <% end %>
66
67
  </tr>
@@ -11,19 +11,25 @@
11
11
  <div class="box-header with-border">
12
12
  <h3 class="box-title"><%= object.class.model_name.human %></h3>
13
13
  <% if can? :edit, object %> <!--verificando se o usuario esta logado-->
14
- <%= link_to eval_with_rescue("new_#{controller_name.singularize}_path"), class: "btn btn-#{box_class} btn-xs", data: { toggle: 'tooltip', placement: 'top', title: 'Cadastrar' } do %>
15
- <i class="fa fa-plus"></i> Cadastrar
14
+ <% if nested_resource %>
15
+ <%= link_to eval_with_rescue("new_#{parent_resource.class.model_name.singular}_#{object.class.model_name.singular}_path(#{parent_resource.id})"), class: "btn btn-#{box_class} btn-xs", data: { toggle: 'tooltip', placement: 'top', title: 'Cadastrar' } do %>
16
+ <i class="fa fa-plus"></i> Cadastrar
17
+ <% end %>
18
+ <% else %>
19
+ <%= link_to eval_with_rescue("new_#{object.class.model_name.plural}_path"), class: "btn btn-#{box_class} btn-xs", data: { toggle: 'tooltip', placement: 'top', title: 'Cadastrar' } do %>
20
+ <i class="fa fa-plus"></i> Cadastrar
21
+ <% end %>
16
22
  <% end %>
17
23
  <% end %>
18
24
  <% if can? :edit, object %> <!--verificando se o usuario esta logado-->
19
- <%= link_to eval_with_rescue("edit_#{controller_name.singularize}_path(#{object.id})"), class: "btn btn-warning btn-xs", data: { toggle: 'tooltip', placement: 'top', title: 'Editar' } do %>
25
+ <%= link_to eval_with_rescue("edit_#{object.class.model_name.singular}_path(#{object.id})"), class: "btn btn-warning btn-xs", data: { toggle: 'tooltip', placement: 'top', title: 'Editar' } do %>
20
26
  <i class="fa fa-pencil"></i> Editar
21
27
  <% end %>
22
28
  <% end %>
23
29
  <% if nested_resource %>
24
- <%= link_to 'Listagem', eval_with_rescue("#{parent_resource.class.model_name.to_s.downcase}_#{controller_name}_path(#{parent_resource.id})"), class: "btn btn-default btn-xs" %>
30
+ <%= link_to 'Listagem', eval_with_rescue("#{parent_resource.class.model_name.singular}_#{object.class.model_name.plural}_path(#{parent_resource.id})"), class: "btn btn-default btn-xs" %>
25
31
  <% else %>
26
- <%= link_to 'Listagem', eval_with_rescue("#{controller_name}_path"), class: "btn btn-default btn-xs" %>
32
+ <%= link_to 'Listagem', eval_with_rescue("#{object.class.model_name.plural}_path"), class: "btn btn-default btn-xs" %>
27
33
  <% end %>
28
34
  </div>
29
35
  <div class="box-body <%= 'no-padding' if display_mode == 'table' %>">
@@ -1,3 +1,3 @@
1
1
  module Zutils
2
- VERSION = "0.2.6"
2
+ VERSION = "0.2.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zutils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Viana
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-11 00:00:00.000000000 Z
11
+ date: 2019-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails