easy_admin_ui 0.6.1 → 0.7.0

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 CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- OTY0OGYxOTcxMzU3YzNkZWU3MmQ0ODVhMzE0MzAxN2RlZGZlNjgzYg==
5
- data.tar.gz: !binary |-
6
- NzUzMzc3MTdhMTU3YzVlYzY3NWMzYWU2MDliZWY0YmNlZWZmODM5OA==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- OGY3MTYwYjc1YjFlYWNlNGFjNDIwMjI3OTUyMmY4ODQ1YTJiZmRjY2MzOGIz
10
- MTM5ZDRkOGJkZTczOGE3NTdkMTJlMGRlMGMyYTY4MTM0NmE3YjI2NjUyMjc1
11
- MDMwMWM2OWRiNmQ0NmNiOWYzODM5YWJmYjQ3Mzc3ZDE2MDc0MjE=
12
- data.tar.gz: !binary |-
13
- ODhlZWE1YmUxNWJjOWY2ZTgwMzFhZDU1MzY0YjY4ZGQwZDlmZDZkZmJhNjUw
14
- ODhhYWU0MjAwNWI5ZTk3MzNlMjY0ZmVhMzA2MzdkNzczNTViN2U4NjdhMDUz
15
- MDE5NTg1ZmZlN2Q5YzNmOTFkNzFhNTU4Y2UzMWM3NWUzZTNiZTM=
2
+ SHA1:
3
+ metadata.gz: 513d2dbb36980dd4af655db1099431b8350fe0cd
4
+ data.tar.gz: 159c898813aa7f1419f35519650d6e245d8270ee
5
+ SHA512:
6
+ metadata.gz: 8b279eb13d7789daa621311d82fe89dc926618976cc1aeb8293cb352ca5d4da0e7d334c2964bd3844911d608be3028813c03c516bd8aa3b9adbec618cf972287
7
+ data.tar.gz: aab2ba2305a650268e463da9bfd2d820657dddcab8e21ba66660296868e752a96f554608d02884c1fa18f36c2a82db0d7e8a67974a87518f85910330b7a0832d
data/Gemfile.lock CHANGED
@@ -1,72 +1,112 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- easy_admin_ui (0.6.1)
4
+ easy_admin_ui (0.7.0)
5
5
  formtastic (>= 2.2.1)
6
6
  kaminari (>= 0.12.4)
7
+ rails (>= 4.0.0)
7
8
 
8
9
  GEM
9
10
  remote: https://rubygems.org/
10
11
  specs:
11
- actionpack (3.2.13)
12
- activemodel (= 3.2.13)
13
- activesupport (= 3.2.13)
14
- builder (~> 3.0.0)
12
+ actionmailer (4.0.2)
13
+ actionpack (= 4.0.2)
14
+ mail (~> 2.5.4)
15
+ actionpack (4.0.2)
16
+ activesupport (= 4.0.2)
17
+ builder (~> 3.1.0)
15
18
  erubis (~> 2.7.0)
16
- journey (~> 1.0.4)
17
- rack (~> 1.4.5)
18
- rack-cache (~> 1.2)
19
- rack-test (~> 0.6.1)
20
- sprockets (~> 2.2.1)
21
- activemodel (3.2.13)
22
- activesupport (= 3.2.13)
23
- builder (~> 3.0.0)
24
- activesupport (3.2.13)
25
- i18n (= 0.6.1)
26
- multi_json (~> 1.0)
27
- builder (3.0.4)
28
- diff-lcs (1.2.1)
19
+ rack (~> 1.5.2)
20
+ rack-test (~> 0.6.2)
21
+ activemodel (4.0.2)
22
+ activesupport (= 4.0.2)
23
+ builder (~> 3.1.0)
24
+ activerecord (4.0.2)
25
+ activemodel (= 4.0.2)
26
+ activerecord-deprecated_finders (~> 1.0.2)
27
+ activesupport (= 4.0.2)
28
+ arel (~> 4.0.0)
29
+ activerecord-deprecated_finders (1.0.3)
30
+ activesupport (4.0.2)
31
+ i18n (~> 0.6, >= 0.6.4)
32
+ minitest (~> 4.2)
33
+ multi_json (~> 1.3)
34
+ thread_safe (~> 0.1)
35
+ tzinfo (~> 0.3.37)
36
+ arel (4.0.2)
37
+ atomic (1.1.14)
38
+ builder (3.1.4)
39
+ diff-lcs (1.2.5)
29
40
  erubis (2.7.0)
30
41
  formtastic (2.2.1)
31
42
  actionpack (>= 3.0)
32
- geminabox (0.10.1)
43
+ geminabox (0.12.2)
33
44
  builder
34
45
  httpclient (>= 2.2.7)
35
- sinatra
36
- hike (1.2.1)
37
- httpclient (2.3.3)
38
- i18n (0.6.1)
39
- journey (1.0.4)
40
- kaminari (0.14.1)
46
+ nesty
47
+ sinatra (>= 1.2.7)
48
+ hike (1.2.3)
49
+ httpclient (2.3.4.1)
50
+ i18n (0.6.9)
51
+ kaminari (0.15.1)
41
52
  actionpack (>= 3.0.0)
42
53
  activesupport (>= 3.0.0)
43
- multi_json (1.7.2)
44
- rack (1.4.5)
45
- rack-cache (1.2)
46
- rack (>= 0.4)
47
- rack-protection (1.5.0)
54
+ mail (2.5.4)
55
+ mime-types (~> 1.16)
56
+ treetop (~> 1.4.8)
57
+ mime-types (1.25.1)
58
+ minitest (4.7.5)
59
+ multi_json (1.8.4)
60
+ nesty (1.0.2)
61
+ polyglot (0.3.3)
62
+ rack (1.5.2)
63
+ rack-protection (1.5.2)
48
64
  rack
49
65
  rack-test (0.6.2)
50
66
  rack (>= 1.0)
51
- rake (10.0.4)
52
- rspec (2.13.0)
53
- rspec-core (~> 2.13.0)
54
- rspec-expectations (~> 2.13.0)
55
- rspec-mocks (~> 2.13.0)
56
- rspec-core (2.13.1)
57
- rspec-expectations (2.13.0)
67
+ rails (4.0.2)
68
+ actionmailer (= 4.0.2)
69
+ actionpack (= 4.0.2)
70
+ activerecord (= 4.0.2)
71
+ activesupport (= 4.0.2)
72
+ bundler (>= 1.3.0, < 2.0)
73
+ railties (= 4.0.2)
74
+ sprockets-rails (~> 2.0.0)
75
+ railties (4.0.2)
76
+ actionpack (= 4.0.2)
77
+ activesupport (= 4.0.2)
78
+ rake (>= 0.8.7)
79
+ thor (>= 0.18.1, < 2.0)
80
+ rake (10.1.1)
81
+ rspec (2.14.1)
82
+ rspec-core (~> 2.14.0)
83
+ rspec-expectations (~> 2.14.0)
84
+ rspec-mocks (~> 2.14.0)
85
+ rspec-core (2.14.7)
86
+ rspec-expectations (2.14.5)
58
87
  diff-lcs (>= 1.1.3, < 2.0)
59
- rspec-mocks (2.13.0)
60
- sinatra (1.3.6)
88
+ rspec-mocks (2.14.5)
89
+ sinatra (1.4.4)
61
90
  rack (~> 1.4)
62
- rack-protection (~> 1.3)
63
- tilt (~> 1.3, >= 1.3.3)
64
- sprockets (2.2.2)
91
+ rack-protection (~> 1.4)
92
+ tilt (~> 1.3, >= 1.3.4)
93
+ sprockets (2.10.1)
65
94
  hike (~> 1.2)
66
95
  multi_json (~> 1.0)
67
96
  rack (~> 1.0)
68
97
  tilt (~> 1.1, != 1.3.0)
69
- tilt (1.3.6)
98
+ sprockets-rails (2.0.1)
99
+ actionpack (>= 3.0)
100
+ activesupport (>= 3.0)
101
+ sprockets (~> 2.8)
102
+ thor (0.18.1)
103
+ thread_safe (0.1.3)
104
+ atomic
105
+ tilt (1.4.1)
106
+ treetop (1.4.15)
107
+ polyglot
108
+ polyglot (>= 0.3.1)
109
+ tzinfo (0.3.38)
70
110
 
71
111
  PLATFORMS
72
112
  ruby
data/README.md CHANGED
@@ -4,23 +4,21 @@ A very simple admin UI. If you need something more fancy look at ActiveScaffold.
4
4
 
5
5
  ## Requirements
6
6
 
7
- * Ruby >= 1.9
8
- * Rails 3.1 or later. (Not tested with Rails 4.x)
7
+ * Ruby >= 2.0
8
+ * Rails 4.0 or later. (0.6.x works with 3.2.x)
9
9
  * formtastic
10
10
  * kaminari
11
11
 
12
12
  Requires jQuery.
13
13
 
14
- ## To Do
14
+ ## Note
15
15
 
16
- Some things are currently hardwired. It assumes you have your controllers below
17
- admin/. I.e. admin_users_path.
16
+ Some things are currently hardwired as this is very much my own hacky admin thing. For instance
17
+ it assumes you have your controllers below admin/. I.e. admin_users_path.
18
18
 
19
19
  ## Installation
20
20
 
21
21
  $ gem install easy_admin_ui
22
-
23
- ## How to use
24
22
 
25
23
  In your controller:
26
24
 
@@ -63,7 +61,7 @@ You need to provide the _form.html.erb partials yourself.
63
61
 
64
62
  You can always override the default templates by providing templates yourself.
65
63
 
66
- ## Optional Partials
64
+ ### Optional Partials
67
65
 
68
66
  Sometimes you'll need extra stuff on your page such as a form filter for the
69
67
  records. You can use the following optional partials to add functionality.
@@ -23,4 +23,5 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.add_dependency "kaminari", ">= 0.12.4"
25
25
  spec.add_dependency "formtastic", ">= 2.2.1"
26
+ spec.add_dependency "rails", ">= 4.0.0"
26
27
  end
@@ -3,7 +3,7 @@ module EasyAdminUi
3
3
  def self.included(base)
4
4
  base.extend ClassMethods
5
5
  end
6
-
6
+
7
7
  module ClassMethods
8
8
  def easy_admin(admin_options = {})
9
9
  self.easy_options = admin_options
@@ -11,10 +11,11 @@ module EasyAdminUi
11
11
 
12
12
  make_resourceful do
13
13
  actions :all
14
-
14
+
15
15
  response_for :index do |format|
16
16
  format.html do
17
17
  @options = self.easy_options
18
+
18
19
  override = File.join('app/views', self.controller_path, 'index.html.erb')
19
20
  if @items.blank? && params[:page] && params[:page].to_i > 1
20
21
  redirect_to :action => :index
@@ -30,6 +31,8 @@ module EasyAdminUi
30
31
 
31
32
  response_for :show do |format|
32
33
  format.html do
34
+ @options = self.easy_options
35
+
33
36
  override = File.join(controller_full_path, 'show.html.erb')
34
37
  if File.exists?(override)
35
38
  render :template => override.gsub('app/views', '')
@@ -91,6 +94,15 @@ module EasyAdminUi
91
94
  end
92
95
 
93
96
  class_eval do
97
+ def object_parameters
98
+ current_object
99
+ if @item.new_record?
100
+ respond_to?(:allowed_params) ? allowed_params : create_params
101
+ else
102
+ respond_to?(:allowed_params) ? allowed_params : update_params
103
+ end
104
+ end
105
+
94
106
  def current_objects
95
107
  if defined?(Mongoid) && current_model.included_modules.include?(Mongoid::Document)
96
108
  @items = current_model.send(easy_options[:order_method] ? easy_options[:order_method] : :asc, easy_options[:order]).page(params[:page]).per(easy_options[:per_page])
@@ -101,7 +113,7 @@ module EasyAdminUi
101
113
 
102
114
  def current_object
103
115
  @item ||= current_model.find(params[:id]) if params[:id]
104
- @item ||= current_model.new(params[current_model_name.underscore.to_sym])
116
+ @item ||= current_model.new(create_params)
105
117
  end
106
118
 
107
119
  def instance_variable_name
@@ -1,3 +1,3 @@
1
1
  module EasyAdminUi
2
- VERSION = '0.6.1'
2
+ VERSION = '0.7.0'
3
3
  end
metadata CHANGED
@@ -1,85 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_admin_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Moen Wulffeld
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-29 00:00:00.000000000 Z
11
+ date: 2014-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.3.2
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.3.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: geminabox
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: kaminari
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: 0.12.4
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ! '>='
66
+ - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.12.4
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: formtastic
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: 2.2.1
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: 2.2.1
83
+ - !ruby/object:Gem::Dependency
84
+ name: rails
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: 4.0.0
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: 4.0.0
83
97
  description: Very simple DRY admin UI.
84
98
  email:
85
99
  - martin@wulffeld.org
@@ -133,17 +147,17 @@ require_paths:
133
147
  - lib
134
148
  required_ruby_version: !ruby/object:Gem::Requirement
135
149
  requirements:
136
- - - ! '>='
150
+ - - '>='
137
151
  - !ruby/object:Gem::Version
138
152
  version: '0'
139
153
  required_rubygems_version: !ruby/object:Gem::Requirement
140
154
  requirements:
141
- - - ! '>='
155
+ - - '>='
142
156
  - !ruby/object:Gem::Version
143
157
  version: '0'
144
158
  requirements: []
145
159
  rubyforge_project:
146
- rubygems_version: 2.0.2
160
+ rubygems_version: 2.1.11
147
161
  signing_key:
148
162
  specification_version: 4
149
163
  summary: Easy Admin UI.