admin_interface 1.2.2 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -15,6 +15,14 @@ You should be using v1.2.0+.
15
15
 
16
16
  gem "admin_interface"
17
17
 
18
+ AdminInterface uses several gems. So put these in your Gemfile
19
+
20
+ gem 'ransack' # new version of meta_search
21
+ gem 'kaminari' # pagination
22
+ gem 'dynamic_form' # for error_messages_for
23
+ # Optional
24
+ gem 'simple_form' # you should use this, much easier forms
25
+
18
26
  === Earlier Rails Versions
19
27
 
20
28
  If you're using Rails 3.0 or earlier use
@@ -23,12 +31,6 @@ Add following to your Gemfile
23
31
 
24
32
  gem "admin_interface", "~> 1.0.0"
25
33
 
26
- AdminInterface uses several gems. So put these in your Gemfile
27
-
28
- gem 'inherited_resources'
29
- gem 'meta_search'
30
- gem 'kaminari'
31
-
32
34
  Or install as plugin from Github.
33
35
 
34
36
  rails plugin install git://github.com/joost/admin_interface.git
@@ -50,7 +52,7 @@ Next, add following routes to config/routes.rb.
50
52
  namespace :admin do
51
53
  root :to => 'base#index'
52
54
  # Add the following after you've used the admin_scaffold generator
53
- resources :model do
55
+ resources :model, :another_model do
54
56
  delete 'destroy_all', :on => :collection
55
57
  end
56
58
  end
@@ -108,4 +110,4 @@ welcome!
108
110
  Kudos, credits or whatever you like more go to:
109
111
  * Jean-Philippe Lang (creator of {Redmine}[http://www.redmine.org/]).
110
112
 
111
- Copyright (c) 2010 Joost Hietbrink, released under the MIT license
113
+ Copyright (c) 2011 Joost Hietbrink, released under the MIT license
@@ -1,10 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
- require "devise/version"
4
3
 
5
4
  Gem::Specification.new do |spec|
6
5
  spec.name = "admin_interface"
7
- spec.version = '1.2.2'
6
+ spec.version = '1.3.0'
8
7
  spec.platform = Gem::Platform::RUBY
9
8
  spec.summary = "A Rails admin interface generator. Theme stolen from Redmine."
10
9
  spec.email = "joost@joopp.com"
@@ -12,9 +11,9 @@ Gem::Specification.new do |spec|
12
11
  spec.description = "A Rails admin interface generator. Theme stolen from Redmine. Similar to web-app-theme but better ;)."
13
12
  spec.authors = ['Joost Hietbrink']
14
13
 
15
- # kaminari (pagination), meta_search (search), inherited_resources (coolness)
14
+ # kaminari (pagination), ransack (search), inherited_resources (coolness)
16
15
  spec.add_dependency('kaminari', '>= 0.12.4')
17
- spec.add_dependency('meta_search', '>= 1.1.0.pre2')
16
+ spec.add_dependency('ransack')
18
17
  spec.add_dependency('inherited_resources', '>= 1.2.2')
19
18
 
20
19
  spec.files = `git ls-files`.split("\n")
@@ -32,12 +32,14 @@ class AdminInterfaceGenerator < Rails::Generators::Base
32
32
  end
33
33
 
34
34
  def add_admin_route
35
- route "namespace :admin do"
36
- route " root :to => 'base#index"
37
- route " # resources :some_model do"
38
- route " # delete 'delete_all', :on => :collection"
39
- route " # end"
40
- route "end"
35
+ route <<ROUTE
36
+ namespace :admin do
37
+ root :to => 'base#index'
38
+ # resources :some_model do
39
+ # delete 'destroy_all', :on => :collection
40
+ # end
41
+ end
42
+ ROUTE
41
43
  end
42
44
 
43
45
  def show_readme
@@ -17,9 +17,9 @@ protected
17
17
  # Overwrites inherited_resources gem version.
18
18
  # Use meta_search and kaminari gem to load collection
19
19
  def collection
20
- @search ||= end_of_association_chain.search(params[:search])
20
+ @search ||= end_of_association_chain.search(params[:q])
21
21
  get_collection_ivar || begin
22
- c = @search.page(params[:page]).per(params[:per])
22
+ c = @search.result.page(params[:page]).per(params[:per])
23
23
  set_collection_ivar(c.respond_to?(:scoped) ? c.scoped : c)
24
24
  end
25
25
  end
@@ -3,7 +3,7 @@
3
3
  <div class="splitcontentleft">
4
4
  <p>
5
5
  Welcome to the admin area!
6
- This file is in <%= link_to('/app/views/admin/index.html.erb', "file://#{File.join(RAILS_ROOT, '/app/views/admin/index.html.erb')}", :class => 'external') %>.<br />You should change it.
6
+ This file is in <%= link_to('/app/views/admin/index.html.erb', "file://#{File.join(Rails.root, '/app/views/admin/base/index.html.erb')}", :class => 'external') %>.<br />You should change it.
7
7
  </p>
8
8
  Styling is pretty simpel but useful. It all comes from Redmine :).
9
9
  <ul>
@@ -44,7 +44,7 @@
44
44
  <div id="ajax-indicator" style="display:none;"><span>Loading...</span></div>
45
45
 
46
46
  <div id="footer">
47
- Powered by <a href="mailto:team@truvolabs.com">TruvoLabs</a> &copy; 2009
47
+ Powered by <a href="mailto:your@email.com">Your Name</a> &copy; 2011
48
48
  </div>
49
49
  </div>
50
50
  </body>
@@ -5,7 +5,7 @@
5
5
  # Check https://github.com/ernie/meta_search for options.
6
6
  # Simply change :id_equals into :name_contains, etc.
7
7
  %>
8
- <%%= f.text_field :id_equals, :placeholder => 'Search by ID' %>
8
+ <%%= f.text_field :id_eq, :placeholder => 'Search by ID' %>
9
9
  <%% end %>
10
10
  </div>
11
11
 
metadata CHANGED
@@ -1,59 +1,56 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: admin_interface
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.3.0
4
5
  prerelease:
5
- version: 1.2.2
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Joost Hietbrink
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-08-24 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2011-10-03 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
16
15
  name: kaminari
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70276621640140 !ruby/object:Gem::Requirement
19
17
  none: false
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
23
21
  version: 0.12.4
24
22
  type: :runtime
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
27
- name: meta_search
28
23
  prerelease: false
29
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70276621640140
25
+ - !ruby/object:Gem::Dependency
26
+ name: ransack
27
+ requirement: &70276621639180 !ruby/object:Gem::Requirement
30
28
  none: false
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: 1.1.0.pre2
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
35
33
  type: :runtime
36
- version_requirements: *id002
37
- - !ruby/object:Gem::Dependency
38
- name: inherited_resources
39
34
  prerelease: false
40
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *70276621639180
36
+ - !ruby/object:Gem::Dependency
37
+ name: inherited_resources
38
+ requirement: &70276621637980 !ruby/object:Gem::Requirement
41
39
  none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
45
43
  version: 1.2.2
46
44
  type: :runtime
47
- version_requirements: *id003
48
- description: A Rails admin interface generator. Theme stolen from Redmine. Similar to web-app-theme but better ;).
45
+ prerelease: false
46
+ version_requirements: *70276621637980
47
+ description: A Rails admin interface generator. Theme stolen from Redmine. Similar
48
+ to web-app-theme but better ;).
49
49
  email: joost@joopp.com
50
50
  executables: []
51
-
52
51
  extensions: []
53
-
54
52
  extra_rdoc_files: []
55
-
56
- files:
53
+ files:
57
54
  - .gitignore
58
55
  - README.rdoc
59
56
  - admin_interface.gemspec
@@ -255,30 +252,26 @@ files:
255
252
  - vendor/assets/stylesheets/admin_interface.css.scss
256
253
  homepage: http://github.com/joost/admin_interface
257
254
  licenses: []
258
-
259
255
  post_install_message:
260
256
  rdoc_options: []
261
-
262
- require_paths:
257
+ require_paths:
263
258
  - lib
264
- required_ruby_version: !ruby/object:Gem::Requirement
259
+ required_ruby_version: !ruby/object:Gem::Requirement
265
260
  none: false
266
- requirements:
267
- - - ">="
268
- - !ruby/object:Gem::Version
269
- version: "0"
270
- required_rubygems_version: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - ! '>='
263
+ - !ruby/object:Gem::Version
264
+ version: '0'
265
+ required_rubygems_version: !ruby/object:Gem::Requirement
271
266
  none: false
272
- requirements:
273
- - - ">="
274
- - !ruby/object:Gem::Version
275
- version: "0"
267
+ requirements:
268
+ - - ! '>='
269
+ - !ruby/object:Gem::Version
270
+ version: '0'
276
271
  requirements: []
277
-
278
272
  rubyforge_project:
279
- rubygems_version: 1.8.5
273
+ rubygems_version: 1.8.10
280
274
  signing_key:
281
275
  specification_version: 3
282
276
  summary: A Rails admin interface generator. Theme stolen from Redmine.
283
277
  test_files: []
284
-