easy_admin_ui 0.5.7 → 0.5.8
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.
- data/VERSION +1 -1
- data/easy_admin_ui.gemspec +3 -3
- data/lib/easy_admin_ui/core_ext.rb +7 -13
- data/lib/easy_admin_ui/rails/engine.rb +4 -1
- metadata +7 -7
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.8
|
data/easy_admin_ui.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "easy_admin_ui"
|
8
|
-
s.version = "0.5.
|
8
|
+
s.version = "0.5.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Martin Moen Wulffeld"]
|
12
|
-
s.date = "
|
12
|
+
s.date = "2012-01-03"
|
13
13
|
s.description = "Very simple DRY admin UI."
|
14
14
|
s.email = "martin@wulffeld.org"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -98,7 +98,7 @@ Gem::Specification.new do |s|
|
|
98
98
|
]
|
99
99
|
s.homepage = "http://github.com/wulffeld/easy_admin_ui"
|
100
100
|
s.require_paths = ["lib"]
|
101
|
-
s.rubygems_version = "1.8.
|
101
|
+
s.rubygems_version = "1.8.13"
|
102
102
|
s.summary = "Easy Admin UI."
|
103
103
|
|
104
104
|
if s.respond_to? :specification_version then
|
@@ -5,18 +5,16 @@ module EasyAdminUi
|
|
5
5
|
end
|
6
6
|
|
7
7
|
module ClassMethods
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
@options = options
|
12
|
-
@options[:include] ||= ''
|
8
|
+
def easy_admin(admin_options = {})
|
9
|
+
self.easy_options = admin_options
|
10
|
+
self.easy_options[:include] ||= ''
|
13
11
|
|
14
12
|
make_resourceful do
|
15
13
|
actions :all
|
16
14
|
|
17
15
|
response_for :index do |format|
|
18
16
|
format.html do
|
19
|
-
@options =
|
17
|
+
@options = self.easy_options
|
20
18
|
override = File.join('app/views', self.controller_path, 'index.html.erb')
|
21
19
|
if @items.blank? && params[:page] && params[:page].to_i > 1
|
22
20
|
redirect_to :action => :index
|
@@ -73,19 +71,15 @@ module EasyAdminUi
|
|
73
71
|
end
|
74
72
|
end
|
75
73
|
|
76
|
-
eval(
|
74
|
+
eval(admin_options[:include])
|
77
75
|
end
|
78
76
|
|
79
77
|
class_eval do
|
80
|
-
def options
|
81
|
-
self.class.options
|
82
|
-
end
|
83
|
-
|
84
78
|
def current_objects
|
85
79
|
if defined?(Mongoid) && current_model.included_modules.include?(Mongoid::Document)
|
86
|
-
@items = current_model.send(
|
80
|
+
@items = current_model.send(easy_options[:order_method] ? easy_options[:order_method] : :asc, easy_options[:order]).page(params[:page]).per(easy_options[:per_page])
|
87
81
|
else
|
88
|
-
@items = current_model.order(
|
82
|
+
@items = current_model.order(easy_options[:order]).page(params[:page]).per(easy_options[:per_page])
|
89
83
|
end
|
90
84
|
end
|
91
85
|
|
@@ -1,7 +1,10 @@
|
|
1
1
|
module EasyAdminUi
|
2
2
|
module Rails
|
3
|
-
class
|
3
|
+
class EasyAdminUiEngine < ::Rails::Engine
|
4
4
|
initializer "easy_admin_ui.engine" do |app|
|
5
|
+
ActionController::Base.class_eval do
|
6
|
+
self.class_inheritable_accessor :easy_options
|
7
|
+
end
|
5
8
|
ActionController::Base.send(:include, EasyAdminUi::CoreExt)
|
6
9
|
end
|
7
10
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy_admin_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-01-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: kaminari
|
16
|
-
requirement: &
|
16
|
+
requirement: &2168622400 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.12.4
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2168622400
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: formtastic
|
27
|
-
requirement: &
|
27
|
+
requirement: &2168638300 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: 1.2.3
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2168638300
|
36
36
|
description: Very simple DRY admin UI.
|
37
37
|
email: martin@wulffeld.org
|
38
38
|
executables: []
|
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
139
|
version: '0'
|
140
140
|
requirements: []
|
141
141
|
rubyforge_project:
|
142
|
-
rubygems_version: 1.8.
|
142
|
+
rubygems_version: 1.8.13
|
143
143
|
signing_key:
|
144
144
|
specification_version: 3
|
145
145
|
summary: Easy Admin UI.
|