my_admin 0.1.3 → 0.1.4
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 +4 -4
- data/app/controllers/my_admin/models_controller.rb +6 -6
- data/app/views/layouts/my_admin.html.erb +1 -1
- data/app/views/my_admin/models/_stats.html.erb +0 -0
- data/app/views/my_admin/models/index.html.erb +4 -0
- data/lib/my_admin/active_record.rb +1 -1
- data/lib/my_admin/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcd68a7e9716e15df35d850eaebfc2a12bdb9436
|
4
|
+
data.tar.gz: 3c919a4febd16e6fefc8775518e88b34767514da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 466081411ceb304451bb2c3148049a79780b29b913474f6c1cf6833cf21539d9470b61a3947f54bafc65a77564d0256d26105c1c2c3c68ef7b9005add044f47d
|
7
|
+
data.tar.gz: 05095bc9dd6926e559395ac8efd298e9af10a1ce9021c7630084073f332f0536cd9f28e93141e830360f748426f1053386a4c5d3bfdbee55d47ae40fbab1d9ae
|
@@ -39,25 +39,25 @@ class MyAdmin::ModelsController < MyAdmin::MyAdminController
|
|
39
39
|
|
40
40
|
unless params[:order_by].blank?
|
41
41
|
if @model.respond_to? "my_admin_order_#{params[:order_by]}"
|
42
|
-
@
|
42
|
+
@objects_all = @model.send("my_admin_order_#{params[:order_by]}", params)
|
43
43
|
else
|
44
|
-
@
|
44
|
+
@objects_all = @model.my_admin_order(params)
|
45
45
|
end
|
46
46
|
else
|
47
|
-
@
|
47
|
+
@objects_all = @model.order("#{@model.table_name}.#{@model.primary_key} desc")
|
48
48
|
end
|
49
49
|
|
50
50
|
if not @model.my_admin.filters.blank? and not params[@model.underscore].blank?
|
51
51
|
@model.my_admin.filters.each do |field|
|
52
|
-
@
|
52
|
+
@objects_all = filter_filter(@application, @model, field, @objects_all)
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
56
|
per_page = params[:per_page] || @model.my_admin.per_page
|
57
57
|
per_page = @model.my_admin.per_page if params[:per_page].to_i <= 0 rescue @model.my_admin.per_page
|
58
58
|
|
59
|
-
@
|
60
|
-
@objects = @
|
59
|
+
@objects_all = @objects_all.my_admin_default_scope if @objects_all.respond_to? :my_admin_default_scope
|
60
|
+
@objects = @objects_all.paginate(:per_page => per_page, :page => params[:page])
|
61
61
|
|
62
62
|
cache_my_admin_params
|
63
63
|
render_model_template
|
File without changes
|
@@ -1,5 +1,9 @@
|
|
1
1
|
<% content_for :title do %>Lista de <%= @model.title_plural %><% end %>
|
2
2
|
|
3
|
+
<% content_for :stats do %>
|
4
|
+
<%= render model_template(@application, @model, 'stats') %>
|
5
|
+
<% end %>
|
6
|
+
|
3
7
|
<%= render model_template(@application, @model, 'filters'), { :url => model_link(@application, @model) } %>
|
4
8
|
|
5
9
|
<div class="row-fluid">
|
@@ -73,7 +73,7 @@ module MyAdmin
|
|
73
73
|
condition += "#{model.table_name}.#{field} <= :date_to"
|
74
74
|
end
|
75
75
|
|
76
|
-
where(condition, { :date_from => ( params[field_name_from].
|
76
|
+
where(condition, { :date_from => ( params[field_name_from].to_time.beginning_of_day rescue nil ), :date_to => ( params[field_name_to].to_time.end_of_day rescue nil ) })
|
77
77
|
end
|
78
78
|
|
79
79
|
|
data/lib/my_admin/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: my_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcos Vinicius von Gal dos Santos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -909,6 +909,7 @@ files:
|
|
909
909
|
- app/views/my_admin/models/_form.html.erb
|
910
910
|
- app/views/my_admin/models/_paginate.html.erb
|
911
911
|
- app/views/my_admin/models/_popup_hint.html.erb
|
912
|
+
- app/views/my_admin/models/_stats.html.erb
|
912
913
|
- app/views/my_admin/models/edit.html.erb
|
913
914
|
- app/views/my_admin/models/index.html.erb
|
914
915
|
- app/views/my_admin/models/new.html.erb
|