templus_models 1.5.8 → 1.5.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/raro_crud/raro_crud.rb +10 -0
- data/app/views/crud/_records.html.erb +48 -33
- data/app/views/layouts/_template_raro_crud.html.erb +5 -3
- data/lib/templus_models/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fb54f4b3deece041e1614e2136b933c936c49d4
|
4
|
+
data.tar.gz: 9bf0405e8ea70299a48621b4ef3c58fbbb436aad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a945072819fe0bc646ec5290c25c073ef7b562f536e9a8b46bdeef79a3e785ac13b54972d625543f9863dbb81ccdb4af6634739787034c18c41dfbfe7ad8d625
|
7
|
+
data.tar.gz: c82fd0165f246ac2168b75d2742d3b42cb519054d91523a5c6adb9d1d005569e3b1853aee85ad4f2f403565b6acc25d760bb04761284de7c85cc079d978b914a
|
data/app/raro_crud/raro_crud.rb
CHANGED
@@ -23,6 +23,7 @@ class RaroCrud
|
|
23
23
|
@@options_link = {}
|
24
24
|
@@scopes = {}
|
25
25
|
@@menus = []
|
26
|
+
@@layout = {}
|
26
27
|
@@index_path = nil
|
27
28
|
|
28
29
|
def self.edit_action
|
@@ -33,6 +34,15 @@ class RaroCrud
|
|
33
34
|
end
|
34
35
|
end
|
35
36
|
|
37
|
+
def self.layout
|
38
|
+
(@@layout[self.to_s.to_sym]) ? @@layout[self.to_s.to_sym] : []
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.set_layout(desc,proc = nil)
|
42
|
+
@@layout[self.to_s.to_sym] = [] unless @@layout[self.to_s.to_sym]
|
43
|
+
@@layout[self.to_s.to_sym] = [desc,proc]
|
44
|
+
end
|
45
|
+
|
36
46
|
def self.condition_edit_action
|
37
47
|
(@@condition_edit_action[self.to_s.to_sym]) ? @@condition_edit_action[self.to_s.to_sym] : nil
|
38
48
|
end
|
@@ -1,36 +1,51 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
1
|
+
<% if @crud_helper.layout[1].present? and @crud_helper.layout[1].call() and @crud_helper.layout[0] == "escopo_lateral" %>
|
2
|
+
<% if @crud_helper.scopes.present? %>
|
3
|
+
<div class="col-lg-3" style="padding-right:0;">
|
4
|
+
<div class="ibox float-e-margins" style="padding-top:40px">
|
5
|
+
<div class="ibox-content">
|
6
|
+
<div class="file-manager">
|
7
|
+
<%= render '/crud/scopes' %>
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
</div>
|
12
|
+
<% end %>
|
13
|
+
<% end %>
|
14
|
+
<div class="col-lg-<%= @crud_helper.layout[1].present? and @crud_helper.layout[1].call() and @crud_helper.layout[0] == "escopo_lateral" and @crud_helper.scopes.present? ? 9 : 12 %>" style="padding-left:0;">
|
15
|
+
<%= render_crud do %>
|
16
|
+
<div>
|
17
|
+
<%= render "/crud/links" %>
|
18
|
+
</div>
|
19
|
+
<div class="dataTables_wrapper form-inline">
|
20
|
+
<table class="table table-striped table-bordered table-hover dataTables-example dataTable">
|
21
|
+
<thead>
|
22
|
+
<tr>
|
23
|
+
<%@crud_helper.index_fields.each do |att| %>
|
24
|
+
<% if !att[:visible_if].nil?%>
|
25
|
+
<% if ((att[:visible_if].class == Proc && !att[:visible_if].call(att)) || (att[:visible_if].class != Proc && !att[:visible_if])) %>
|
26
|
+
<% next %>
|
27
|
+
<% end %>
|
13
28
|
<% end %>
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
29
|
+
<th>
|
30
|
+
<% if att[:sort_field].present? %>
|
31
|
+
<%= sort_link @q, att[:sort_field], att[:label], {},data: {push: 'partial', target: "#form"}%>
|
32
|
+
<% else %>
|
33
|
+
<%= sort_link @q, att[:attribute], att[:label], {},data: {push: 'partial', target: "#form"}%>
|
34
|
+
<% end %>
|
35
|
+
</th>
|
36
|
+
<%end%>
|
37
|
+
<%if @crud_helper.view_action || @crud_helper.edit_action || @crud_helper.destroy_action || @crud_helper.actions.present?%>
|
38
|
+
<td>Opções</td>
|
20
39
|
<% end %>
|
21
|
-
</
|
22
|
-
|
23
|
-
|
24
|
-
|
40
|
+
</tr>
|
41
|
+
</thead>
|
42
|
+
<tbody id="records-body">
|
43
|
+
<% @records.each do |record| %>
|
44
|
+
<%= render '/crud/record', record: record %>
|
25
45
|
<% end %>
|
26
|
-
</
|
27
|
-
</
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
</tbody>
|
33
|
-
</table>
|
34
|
-
<%= paginate @records, target: '#form', theme: 'templus'%>
|
35
|
-
</div>
|
36
|
-
<% end %>
|
46
|
+
</tbody>
|
47
|
+
</table>
|
48
|
+
<%= paginate @records, target: '#form', theme: 'templus'%>
|
49
|
+
</div>
|
50
|
+
<% end %>
|
51
|
+
</div>
|
@@ -17,8 +17,10 @@
|
|
17
17
|
</div>
|
18
18
|
<div class="col-lg-9">
|
19
19
|
<div class="pull-right">
|
20
|
-
<%
|
21
|
-
|
20
|
+
<% unless @crud_helper.layout[1].present? and @crud_helper.layout[1].call() and @crud_helper.layout[0] == "escopo_lateral" %>
|
21
|
+
<% if content_for? :scopes %>
|
22
|
+
<%= yield :scopes %>
|
23
|
+
<% end %>
|
22
24
|
<% end %>
|
23
25
|
</div>
|
24
26
|
</div>
|
@@ -29,4 +31,4 @@
|
|
29
31
|
<% end %>
|
30
32
|
<% if content_for? :modal %>
|
31
33
|
<%= yield :modal %>
|
32
|
-
<% end %>
|
34
|
+
<% end %>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: templus_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Sol
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-12-
|
12
|
+
date: 2015-12-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|