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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 827e1f869b761d3248893eb269219d70f9c6c904
4
- data.tar.gz: c43eb8fe1edaa236a99c9dfe1df95d805c0bb363
3
+ metadata.gz: 1fb54f4b3deece041e1614e2136b933c936c49d4
4
+ data.tar.gz: 9bf0405e8ea70299a48621b4ef3c58fbbb436aad
5
5
  SHA512:
6
- metadata.gz: 2e9b8f343472610b8c69e67dd4889c9b732a81ae42aa88fa2209e7e8d554312b85a2fca425197465adf2d04aa284823fe76ca423d57058fc3a75754053561661
7
- data.tar.gz: 44dddfe6c112f5ced2271e807a2e5fb9f85bcfb633d36658256c3516a7073e0cb0c947fc5e5b0f352b1997e81a8d874645995056f288f3b02a694b9e7301c438
6
+ metadata.gz: a945072819fe0bc646ec5290c25c073ef7b562f536e9a8b46bdeef79a3e785ac13b54972d625543f9863dbb81ccdb4af6634739787034c18c41dfbfe7ad8d625
7
+ data.tar.gz: c82fd0165f246ac2168b75d2742d3b42cb519054d91523a5c6adb9d1d005569e3b1853aee85ad4f2f403565b6acc25d760bb04761284de7c85cc079d978b914a
@@ -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
- <%= render_crud do %>
2
- <div>
3
- <%= render "/crud/links" %>
4
- </div>
5
- <div class="dataTables_wrapper form-inline">
6
- <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
7
- <thead>
8
- <tr>
9
- <%@crud_helper.index_fields.each do |att| %>
10
- <% if !att[:visible_if].nil?%>
11
- <% if ((att[:visible_if].class == Proc && !att[:visible_if].call(att)) || (att[:visible_if].class != Proc && !att[:visible_if])) %>
12
- <% next %>
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
- <% end %>
15
- <th>
16
- <% if att[:sort_field].present? %>
17
- <%= sort_link @q, att[:sort_field], att[:label], {},data: {push: 'partial', target: "#form"}%>
18
- <% else %>
19
- <%= sort_link @q, att[:attribute], att[:label], {},data: {push: 'partial', target: "#form"}%>
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
- </th>
22
- <%end%>
23
- <%if @crud_helper.view_action || @crud_helper.edit_action || @crud_helper.destroy_action || @crud_helper.actions.present?%>
24
- <td>Opções</td>
40
+ </tr>
41
+ </thead>
42
+ <tbody id="records-body">
43
+ <% @records.each do |record| %>
44
+ <%= render '/crud/record', record: record %>
25
45
  <% end %>
26
- </tr>
27
- </thead>
28
- <tbody id="records-body">
29
- <% @records.each do |record| %>
30
- <%= render '/crud/record', record: record %>
31
- <% end %>
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
- <% if content_for? :scopes %>
21
- <%= yield :scopes %>
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 %>
@@ -1,3 +1,3 @@
1
1
  module TemplusModels
2
- VERSION = "1.5.8"
2
+ VERSION = "1.5.9"
3
3
  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.8
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-01 00:00:00.000000000 Z
12
+ date: 2015-12-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails