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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f0c8d68abb451f5831fbe063e4f9ade6e8d8a72d
4
- data.tar.gz: f7f0fff524caa40d2fa487512bf9a705d695a608
3
+ metadata.gz: 624f8d82fe35b9b2beaf577a9115af31380775e1
4
+ data.tar.gz: 8959a5ad247ef6f45269f39c47d05c86f0568160
5
5
  SHA512:
6
- metadata.gz: adebbe8d04337d1612dab1c9cc5ab287130a6313ebda77dad45f8da4e8f6ec68f149ce9223a18fdbb8ffeea2149c6eb455e5665c67e7f697da5fba632c1b29a1
7
- data.tar.gz: 00c81d5332a73c15fc52eaa1e4a3b7f4b0278c3bcc06f97e03e97c986a9da81ddb7bee9660dee1cfc8c590fff3b5809243898ea2702f6b0b5319d09f4d43da75
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('#')
@@ -3,7 +3,10 @@
3
3
  .col-md-8
4
4
  -# TODO(jon): Add pagination w/ search results
5
5
  = up_search_results(@q, @results)
6
-
6
+ %br
7
+ = paginate @results
8
+ %br
9
+ %br
7
10
  .col-md-4
8
11
  -# TODO(jon): Implement up_search_box
9
12
  = up_search_box(@klass)
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Upmin
2
- VERSION = "0.0.35"
2
+ VERSION = "0.0.36"
3
3
  end
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.35
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