templus_models 1.6.0 → 1.6.2

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: b887141343645d9ac164c5fec736112a4f68a3fe
4
- data.tar.gz: 91c089d619d572a2998de38c8781a3bd8ebbe16f
3
+ metadata.gz: 68829b481692aa4b79cb40342fbb97f844a7d7a8
4
+ data.tar.gz: 8a9a70e922e0a182b4d13a5d2db2b660cfb256b3
5
5
  SHA512:
6
- metadata.gz: dd0503928ce0f12f1a16ad7a66d01267576a1ac69e0aabacd5ac97fbf82d0c27fd5fbf61355ab09bb365b01dcefe199f926aabcefe035557bcfbf921b568d8af
7
- data.tar.gz: a58b677b0f78b05ae83b6b87fd5a955d9897011910963d2243967d7fa682fe5118f917b99f1ec735a6df401f9f76f7a26159e0dd1bb494289138453cdf3d9dc3
6
+ metadata.gz: 4638992d8ac9a0b4465b3e4667095b4e754fefed9f5303a33320a8f2207f34a017b1cbf36a3027af03a560daf3b5326a3deede2a111706ff289bfcc8930c9b05
7
+ data.tar.gz: 766241bb177be600d1c10ba0909429017e3350e7fa9ff090ad096dbd24929a2be0a86fa86f3454906f4ec6de8c0b0ea28d0dbf10257e7063375123bc3cfa980c
@@ -9,7 +9,7 @@ class CrudController < ApplicationController
9
9
  c_helper = Module.const_get(params[:model].camelize).reflect_on_association(params[:associacao]).class_name
10
10
  @crud_helper = Module.const_get("#{c_helper}Crud") unless params[:render] == "modal" and params[:action] == "new"
11
11
  @url = crud_associacao_models_path(model: params[:model], id: params[:id], associacao: params[:associacao], page: params[:page], q: params[:q])
12
- @url_str = "/crud/#{params[:model]}/#{params[:id]}/#{params[:associacao]}/"
12
+ @url_str = "/crud/#{params[:model]}/#{params[:id]}/#{params[:associacao]}"
13
13
  @model_permission = c_helper.constantize
14
14
  @id = params[:associacao_id] if params[:associacao_id]
15
15
  else
@@ -17,7 +17,7 @@ class CrudController < ApplicationController
17
17
  @model_permission = @model
18
18
  @crud_helper = Module.const_get("#{params[:model]}_crud".camelize) unless params[:render] == "modal" and params[:action] == "new"
19
19
  @url = crud_models_path(model: params[:model], page: params[:page], q: params[:q])
20
- @url_str = "/crud/#{params[:model]}/"
20
+ @url_str = "/crud/#{params[:model]}"
21
21
  @id = params[:id] if params[:id]
22
22
  end
23
23
  end
@@ -1,51 +1,36 @@
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? && @crud_helper.layout[1].call() && @crud_helper.layout[0] == 'escopo_lateral' && @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 %>
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 %>
28
13
  <% end %>
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>
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"}%>
39
20
  <% end %>
40
- </tr>
41
- </thead>
42
- <tbody id="records-body">
43
- <% @records.each do |record| %>
44
- <%= render '/crud/record', record: record %>
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>
45
25
  <% end %>
46
- </tbody>
47
- </table>
48
- <%= paginate @records, target: '#form', theme: 'templus'%>
49
- </div>
50
- <% end %>
51
- </div>
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 %>
@@ -1,8 +1,19 @@
1
1
  <% content_for :corpo do %>
2
2
  <div id="form" >
3
- <% if @crud_helper.layout[1].present? and @crud_helper.layout[1].call() and @crud_helper.layout[0] == "escopo_lateral" %>
3
+ <% if @crud_helper.layout[1].present? and @crud_helper.layout[1].call() and @crud_helper.layout[0] == "escopo_lateral" and @crud_helper.scopes.present? %>
4
4
  <div class="row">
5
- <%= render '/crud/records' %>
5
+ <div class="col-lg-3" style="padding-right:0;">
6
+ <div class="ibox float-e-margins" style="padding-top:40px">
7
+ <div class="ibox-content">
8
+ <div class="file-manager">
9
+ <%= render '/crud/scopes' %>
10
+ </div>
11
+ </div>
12
+ </div>
13
+ </div>
14
+ <div class="col-lg-9" style="padding-left:0;">
15
+ <%= render '/crud/records' %>
16
+ </div>
6
17
  </div>
7
18
  <% else %>
8
19
  <%= render '/crud/records' %>
@@ -10,4 +21,4 @@
10
21
  </div>
11
22
  <% end %>
12
23
 
13
- <%= render "/crud/crud_template" %>
24
+ <%= render "/crud/crud_template" %>
@@ -32,20 +32,5 @@
32
32
  </ul>
33
33
  </div>
34
34
  </div>
35
- <div class="col-xs-12">
36
- <div class="pagination pull-left">
37
- <% if @options[:current_page].number < 2 %>
38
- <% inicio = 1 %>
39
- <% else %>
40
- <% inicio = ((@options[:current_page].number - 1) * @options[:per_page]) + 1 %>
41
- <% end %>
42
- <% if @options[:current_page].last? %>
43
- <% fim = @options[:total_count] %>
44
- <% else %>
45
- <% fim = @options[:current_page].number * @options[:per_page] %>
46
- <% end %>
47
- Exibindo <%= inicio %> - <%= fim %> de um total de <%= @options[:total_count] %>
48
- </div>
49
- </div>
50
35
  </div>
51
36
  <% end -%>
@@ -1,3 +1,3 @@
1
1
  module TemplusModels
2
- VERSION = "1.6.0"
2
+ VERSION = "1.6.2"
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.6.0
4
+ version: 1.6.2
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: 2016-05-31 00:00:00.000000000 Z
12
+ date: 2016-06-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails