zutils 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -0
- data/CODE_OF_CONDUCT.md +0 -0
- data/Gemfile +0 -0
- data/LICENSE.txt +0 -0
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/app/views/shared/_action_links.html.erb +0 -0
- data/app/views/shared/_form.html.erb +0 -0
- data/app/views/shared/_index.html.erb +0 -0
- data/app/views/shared/_list.html.erb +6 -3
- data/app/views/shared/_show.html.erb +11 -8
- data/bin/console +0 -0
- data/bin/setup +0 -0
- data/lib/zutils/engine.rb +0 -0
- data/lib/zutils/version.rb +1 -1
- data/lib/zutils.rb +0 -0
- data/zutils.gemspec +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0036a059b0a5365040cc5177473f248fdf162ac323adc606a88d71e76e864e62
|
4
|
+
data.tar.gz: bda990502625e46533c264516f6d0fef82821f3ddba0a919a1a314715f98bfab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3cd01ca929a8c7c1559fff179077ff9c099b0f757381327a1a151df2a35022c84e41fd7681362b05fcf2aeb52ff82d8a89ca59c8998f2463400bdff7db177a09
|
7
|
+
data.tar.gz: 80ec6c2a9a0b79cabaef9bc6e900282c5de9f2cef76e51e6b25c4b96b8a3e477edb78f1637c8e3e03deefbd8721f83994b25264308bfc5d54ed8f43a7afc071b
|
data/.gitignore
CHANGED
File without changes
|
data/CODE_OF_CONDUCT.md
CHANGED
File without changes
|
data/Gemfile
CHANGED
File without changes
|
data/LICENSE.txt
CHANGED
File without changes
|
data/README.md
CHANGED
File without changes
|
data/Rakefile
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -3,12 +3,15 @@
|
|
3
3
|
<% hide_actions ||= false %>
|
4
4
|
<% sort_fields ||= [] %>
|
5
5
|
|
6
|
+
<% form_fields ||= (list.first.class.respond_to?('form_fields') ? list.first.class.form_fields : {}) %>
|
7
|
+
<% form_ordered_fields ||= (form_fields.empty? ? list.first.class.column_names : form_fields.keys) %>
|
8
|
+
|
6
9
|
<table class="table table-striped datatables">
|
7
10
|
<thead>
|
8
11
|
<tr>
|
9
12
|
<% unless list.empty? %>
|
10
|
-
<% (
|
11
|
-
<% if sort_fields.include? column %>
|
13
|
+
<% (form_ordered_fields - exceptions - excluded_columns).each do |column| %>
|
14
|
+
<% if sort_fields.include?(column) || sort_fields.include?(column.to_s) || sort_fields.include?(column.to_sym) %>
|
12
15
|
<% if /_id$/ =~ column %>
|
13
16
|
<th><%= sort_link(@q, column, list.first.class.human_attribute_name(column.split("_id")[0])) %></th>
|
14
17
|
<% else %>
|
@@ -31,7 +34,7 @@
|
|
31
34
|
<tbody>
|
32
35
|
<% list.each do |object| %>
|
33
36
|
<tr>
|
34
|
-
<% (
|
37
|
+
<% (form_ordered_fields - exceptions - excluded_columns).each do |column| %>
|
35
38
|
<td>
|
36
39
|
<% if object.send(column).class == Date or
|
37
40
|
object.send(column).class == DateTime or
|
@@ -3,6 +3,7 @@
|
|
3
3
|
<% relationships ||= {} %>
|
4
4
|
<% box_class ||= 'primary' %>
|
5
5
|
<% display_mode ||= 'table' %>
|
6
|
+
<% show_buttons &&= true %>
|
6
7
|
|
7
8
|
<% form_fields ||= (object.class.respond_to?('form_fields') ? object.class.form_fields : {}) %>
|
8
9
|
<% form_ordered_fields ||= (form_fields.empty? ? object.class.column_names : form_fields.keys) %>
|
@@ -10,15 +11,17 @@
|
|
10
11
|
<div class="box box-<%= box_class %>">
|
11
12
|
<div class="box-header with-border">
|
12
13
|
<h3 class="box-title"><%=t object.class.model_name.human %></h3>
|
13
|
-
<% if
|
14
|
-
|
15
|
-
|
14
|
+
<% if show_buttons %>
|
15
|
+
<% if can? :edit, object %> <!--verificando se o usuario esta logado-->
|
16
|
+
<%= 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 %>
|
17
|
+
<i class="fa fa-pencil"></i> Editar
|
18
|
+
<% end %>
|
19
|
+
<% end %>
|
20
|
+
<% if nested_resource %>
|
21
|
+
<%= 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" %>
|
22
|
+
<% else %>
|
23
|
+
<%= link_to 'Listagem', eval_with_rescue("#{controller_name}_path"), class: "btn btn-default btn-xs" %>
|
16
24
|
<% end %>
|
17
|
-
<% end %>
|
18
|
-
<% if nested_resource %>
|
19
|
-
<%= 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" %>
|
20
|
-
<% else %>
|
21
|
-
<%= link_to 'Listagem', eval_with_rescue("#{controller_name}_path"), class: "btn btn-default btn-xs" %>
|
22
25
|
<% end %>
|
23
26
|
</div>
|
24
27
|
<div class="box-body <%= 'no-padding' if display_mode == 'table' %>">
|
data/bin/console
CHANGED
File without changes
|
data/bin/setup
CHANGED
File without changes
|
data/lib/zutils/engine.rb
CHANGED
File without changes
|
data/lib/zutils/version.rb
CHANGED
data/lib/zutils.rb
CHANGED
File without changes
|
data/zutils.gemspec
CHANGED
File without changes
|
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.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ricardo Viana
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|