upmin-admin 0.0.35 → 0.0.36
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/upmin/models_controller.rb +7 -1
- data/app/views/upmin/models/search.html.haml +4 -1
- data/lib/upmin.rb +0 -16
- data/lib/upmin/admin.rb +22 -0
- data/lib/upmin/version.rb +1 -1
- metadata +16 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 624f8d82fe35b9b2beaf577a9115af31380775e1
|
4
|
+
data.tar.gz: 8959a5ad247ef6f45269f39c47d05c86f0568160
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8de8d264827f29492fa267912af3433f6293f87baecb8ab80245e7d7eef4411b7ebed3a0ff25ac5dc77c446fc2ec3a69e47bdc7bfb7232655ec718ad8b048dcc
|
7
|
+
data.tar.gz: 045b24b856b4ba093bfeaba8794e4e2b77861ad6c4686f46c8fe3d0634cb461de023c5a8b711245a69a719a1593e585be023833d8662ded73a2aa283bf66e759
|
@@ -5,6 +5,8 @@ module Upmin
|
|
5
5
|
before_filter :set_klass, only: [:show, :update, :search, :action]
|
6
6
|
before_filter :set_model, only: [:show, :update, :action]
|
7
7
|
|
8
|
+
before_filter :set_page, only: [:search]
|
9
|
+
|
8
10
|
before_filter :set_method, only: [:action]
|
9
11
|
before_filter :set_arguments, only: [:action]
|
10
12
|
|
@@ -43,7 +45,7 @@ module Upmin
|
|
43
45
|
|
44
46
|
def search
|
45
47
|
@q = @klass.ransack(params[:q])
|
46
|
-
@results = @q.result(distinct: true)
|
48
|
+
@results = @q.result(distinct: true).page(@page).per(30)
|
47
49
|
end
|
48
50
|
|
49
51
|
def action
|
@@ -77,6 +79,10 @@ module Upmin
|
|
77
79
|
@arguments = arguments.select{|k, v| !v.empty? }
|
78
80
|
end
|
79
81
|
|
82
|
+
def set_page
|
83
|
+
@page = params[:page] || 0
|
84
|
+
end
|
85
|
+
|
80
86
|
# TODO(jon): Figure out a better way to do transforms that is easy to extend.
|
81
87
|
def transform(transforms, key, value)
|
82
88
|
split = transforms[key].split('#')
|
data/lib/upmin.rb
CHANGED
@@ -1,18 +1,2 @@
|
|
1
|
-
require "upmin/engine"
|
2
|
-
|
3
|
-
require "upmin/klass"
|
4
|
-
require "upmin/model"
|
5
|
-
|
6
|
-
# Monkey patch code into rails
|
7
|
-
require "upmin/railties/active_record"
|
8
|
-
require "upmin/railties/render"
|
9
|
-
require "upmin/railties/render_helpers"
|
10
|
-
require "upmin/railtie"
|
11
|
-
|
12
|
-
# gems and stuff we use
|
13
|
-
require "ransack"
|
14
|
-
require "haml"
|
15
|
-
require "sass-rails"
|
16
|
-
|
17
1
|
module Upmin
|
18
2
|
end
|
data/lib/upmin/admin.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require "upmin"
|
2
|
+
require "upmin/engine"
|
3
|
+
|
4
|
+
require "upmin/klass"
|
5
|
+
require "upmin/model"
|
6
|
+
|
7
|
+
# Monkey patch code into rails
|
8
|
+
require "upmin/railties/active_record"
|
9
|
+
require "upmin/railties/render"
|
10
|
+
require "upmin/railties/render_helpers"
|
11
|
+
require "upmin/railtie"
|
12
|
+
|
13
|
+
# gems and stuff we use
|
14
|
+
require "ransack"
|
15
|
+
require "haml"
|
16
|
+
require "sass-rails"
|
17
|
+
require "kaminari"
|
18
|
+
|
19
|
+
module Upmin
|
20
|
+
module Admin
|
21
|
+
end
|
22
|
+
end
|
data/lib/upmin/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: upmin-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.36
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Calhoun
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: kaminari
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: ransack
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -129,6 +143,7 @@ files:
|
|
129
143
|
- lib/tasks/accordive_rails_tasks.rake
|
130
144
|
- lib/tasks/upmin_tasks.rake
|
131
145
|
- lib/upmin.rb
|
146
|
+
- lib/upmin/admin.rb
|
132
147
|
- lib/upmin/engine.rb
|
133
148
|
- lib/upmin/klass.rb
|
134
149
|
- lib/upmin/model.rb
|