padrino-admin 0.10.1 → 0.10.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/lib/padrino-admin/access_control.rb +7 -5
- data/lib/padrino-admin/generators/templates/account/activerecord.rb.tt +1 -1
- data/lib/padrino-admin/generators/templates/account/couchrest.rb.tt +1 -1
- data/lib/padrino-admin/generators/templates/account/datamapper.rb.tt +1 -1
- data/lib/padrino-admin/generators/templates/account/mongoid.rb.tt +1 -1
- data/lib/padrino-admin/generators/templates/account/mongomapper.rb.tt +1 -1
- data/lib/padrino-admin/generators/templates/account/seeds.rb.tt +1 -1
- data/lib/padrino-admin/generators/templates/account/sequel.rb.tt +1 -1
- data/lib/padrino-admin/generators/templates/app/controllers/base.rb +1 -1
- data/lib/padrino-admin/generators/templates/app/controllers/sessions.rb +2 -1
- data/lib/padrino-admin/generators/templates/assets/stylesheets/base.css +1 -1
- data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/amro/style.css +1 -1
- data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/blue/style.css +1 -1
- data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/djime-cerulean/style.css +1 -1
- data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/olive/style.css +1 -1
- data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/orange/style.css +1 -1
- data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/reidb-greenish/style.css +1 -1
- data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/ruby/style.css +1 -1
- data/lib/padrino-admin/generators/templates/erb/app/base/_sidebar.erb.tt +1 -1
- data/lib/padrino-admin/generators/templates/erb/app/base/index.erb.tt +1 -1
- data/lib/padrino-admin/generators/templates/erb/app/layouts/application.erb.tt +1 -1
- data/lib/padrino-admin/generators/templates/erb/app/sessions/new.erb.tt +1 -1
- data/lib/padrino-admin/generators/templates/erb/page/_form.erb.tt +1 -1
- data/lib/padrino-admin/generators/templates/erb/page/edit.erb.tt +1 -1
- data/lib/padrino-admin/generators/templates/erb/page/index.erb.tt +1 -1
- data/lib/padrino-admin/generators/templates/erb/page/new.erb.tt +1 -1
- data/lib/padrino-admin/generators/templates/haml/app/base/_sidebar.haml.tt +1 -1
- data/lib/padrino-admin/generators/templates/haml/app/base/index.haml.tt +1 -1
- data/lib/padrino-admin/generators/templates/haml/app/layouts/application.haml.tt +1 -1
- data/lib/padrino-admin/generators/templates/haml/app/sessions/new.haml.tt +1 -1
- data/lib/padrino-admin/generators/templates/haml/page/_form.haml.tt +1 -1
- data/lib/padrino-admin/generators/templates/haml/page/edit.haml.tt +1 -1
- data/lib/padrino-admin/generators/templates/haml/page/index.haml.tt +1 -1
- data/lib/padrino-admin/generators/templates/haml/page/new.haml.tt +1 -1
- data/lib/padrino-admin/generators/templates/page/controller.rb.tt +1 -1
- data/lib/padrino-admin/helpers/authentication_helpers.rb +1 -1
- data/lib/padrino-admin/helpers/view_helpers.rb +1 -1
- data/lib/padrino-admin/locale/admin/da.yml +1 -1
- data/lib/padrino-admin/locale/admin/de.yml +1 -1
- data/lib/padrino-admin/locale/admin/en.yml +1 -1
- data/lib/padrino-admin/locale/admin/es.yml +1 -1
- data/lib/padrino-admin/locale/admin/fr.yml +1 -1
- data/lib/padrino-admin/locale/admin/hu.yml +1 -1
- data/lib/padrino-admin/locale/admin/it.yml +1 -1
- data/lib/padrino-admin/locale/admin/nl.yml +1 -1
- data/lib/padrino-admin/locale/admin/no.yml +1 -1
- data/lib/padrino-admin/locale/admin/pl.yml +1 -1
- data/lib/padrino-admin/locale/admin/pt_br.yml +1 -1
- data/lib/padrino-admin/locale/admin/ru.yml +1 -1
- data/lib/padrino-admin/locale/admin/tr.yml +1 -1
- data/lib/padrino-admin/locale/admin/uk.yml +1 -1
- data/lib/padrino-admin/locale/orm/da.yml +1 -1
- data/lib/padrino-admin/locale/orm/de.yml +1 -1
- data/lib/padrino-admin/locale/orm/en.yml +1 -1
- data/lib/padrino-admin/locale/orm/es.yml +1 -1
- data/lib/padrino-admin/locale/orm/fr.yml +1 -1
- data/lib/padrino-admin/locale/orm/hu.yml +1 -1
- data/lib/padrino-admin/locale/orm/it.yml +1 -1
- data/lib/padrino-admin/locale/orm/nl.yml +1 -1
- data/lib/padrino-admin/locale/orm/no.yml +1 -1
- data/lib/padrino-admin/locale/orm/pl.yml +1 -1
- data/lib/padrino-admin/locale/orm/pt_br.yml +1 -1
- data/lib/padrino-admin/locale/orm/ru.yml +1 -1
- data/lib/padrino-admin/locale/orm/tr.yml +1 -1
- data/lib/padrino-admin/locale/orm/uk.yml +1 -1
- data/lib/padrino-admin/utils/crypt.rb +2 -2
- data/padrino-admin.gemspec +1 -1
- data/test/fixtures/data_mapper.rb +1 -1
- data/test/generators/test_admin_page_generator.rb +1 -1
- data/test/helper.rb +1 -1
- metadata +27 -4
data/README.rdoc
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
+
require 'active_support/core_ext/class/attribute_accessors'
|
2
|
+
|
1
3
|
module Padrino
|
2
4
|
module Admin
|
3
|
-
class AccessControlError < StandardError
|
5
|
+
class AccessControlError < StandardError # @private
|
4
6
|
end
|
5
7
|
##
|
6
8
|
# This module give to a padrino application an access control functionality
|
@@ -22,7 +24,7 @@ module Padrino
|
|
22
24
|
end
|
23
25
|
|
24
26
|
class Base
|
25
|
-
def initialize
|
27
|
+
def initialize # @private
|
26
28
|
@roles, @authorizations, @project_modules = [], [], []
|
27
29
|
end
|
28
30
|
|
@@ -80,7 +82,7 @@ module Padrino
|
|
80
82
|
class Authorization
|
81
83
|
attr_reader :allowed, :denied, :project_modules, :roles
|
82
84
|
|
83
|
-
def initialize(*roles, &block)
|
85
|
+
def initialize(*roles, &block) # @private
|
84
86
|
@roles = roles
|
85
87
|
@allowed = []
|
86
88
|
@denied = []
|
@@ -117,7 +119,7 @@ module Padrino
|
|
117
119
|
class ProjectModule
|
118
120
|
attr_reader :name
|
119
121
|
|
120
|
-
def initialize(name, path)
|
122
|
+
def initialize(name, path) # @private
|
121
123
|
@name, @path = name, path
|
122
124
|
end
|
123
125
|
|
@@ -146,4 +148,4 @@ module Padrino
|
|
146
148
|
end # ProjectModule
|
147
149
|
end # AccessControl
|
148
150
|
end # Admin
|
149
|
-
end # Padrino
|
151
|
+
end # Padrino
|
@@ -13,6 +13,7 @@ Admin.controllers :sessions do
|
|
13
13
|
set_current_account(account)
|
14
14
|
redirect url(:base, :index)
|
15
15
|
else
|
16
|
+
params[:email], params[:password] = h(params[:email]), h(params[:password])
|
16
17
|
flash[:warning] = "Login or password wrong."
|
17
18
|
redirect url(:sessions, :new)
|
18
19
|
end
|
@@ -22,4 +23,4 @@ Admin.controllers :sessions do
|
|
22
23
|
set_current_account(nil)
|
23
24
|
redirect url(:sessions, :new)
|
24
25
|
end
|
25
|
-
end
|
26
|
+
end
|
@@ -92,4 +92,4 @@ ul.list li .item .avatar{float:left;margin:0 5px 5px 0;width:30px;height:30px;}
|
|
92
92
|
#box .block h2{padding:10px 15px;margin:0;}
|
93
93
|
#box .block .content{padding:10px 20px;}
|
94
94
|
/* custom */
|
95
|
-
.code{font-family: Courier, 'Courier New', monospace;color:#36393D;}
|
95
|
+
.code{font-family: Courier, 'Courier New', monospace;color:#36393D;}
|
@@ -9,4 +9,4 @@
|
|
9
9
|
|
10
10
|
.group.navform.wat-cf
|
11
11
|
=f.submit pat(:save), :class => :button
|
12
|
-
=f.submit pat(:cancel), :onclick => "window.location='#{url(:<%= @orm.name_plural %>, :index)}';return false", :class => :button
|
12
|
+
=f.submit pat(:cancel), :onclick => "window.location='#{url(:<%= @orm.name_plural %>, :index)}';return false", :class => :button
|
@@ -12,4 +12,4 @@
|
|
12
12
|
-form_for :<%= @orm.name_singular %>, url(:<%= @orm.name_plural %>, :update, :id => @<%= @orm.name_singular %>.id), :method => :put, :class => :form do |f|
|
13
13
|
=partial "<%= @orm.name_plural %>/form", :locals => { :f => f }
|
14
14
|
|
15
|
-
-content_for :sidebar, partial("base/sidebar")
|
15
|
+
-content_for :sidebar, partial("base/sidebar")
|
@@ -11,4 +11,4 @@
|
|
11
11
|
-form_for :<%= @orm.name_singular %>, url(:<%= @orm.name_plural %>, :create), :class => :form do |f|
|
12
12
|
=partial "<%= @orm.name_plural %>/form", :locals => { :f => f }
|
13
13
|
|
14
|
-
-content_for :sidebar, partial("base/sidebar")
|
14
|
+
-content_for :sidebar, partial("base/sidebar")
|
@@ -26,7 +26,7 @@ module Padrino
|
|
26
26
|
end
|
27
27
|
|
28
28
|
private
|
29
|
-
def build_cipher(type, password)
|
29
|
+
def build_cipher(type, password) # @private
|
30
30
|
cipher = OpenSSL::Cipher::Cipher.new("DES-EDE3-CBC").send(type)
|
31
31
|
cipher.pkcs5_keyivgen(password)
|
32
32
|
cipher
|
@@ -34,4 +34,4 @@ module Padrino
|
|
34
34
|
end # Crypt
|
35
35
|
end # Utils
|
36
36
|
end # Admin
|
37
|
-
end # Padrino
|
37
|
+
end # Padrino
|
data/padrino-admin.gemspec
CHANGED
data/test/helper.rb
CHANGED
metadata
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: padrino-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 51
|
4
5
|
prerelease:
|
5
|
-
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 10
|
9
|
+
- 2
|
10
|
+
version: 0.10.2
|
6
11
|
platform: ruby
|
7
12
|
authors:
|
8
13
|
- Padrino Team
|
@@ -13,7 +18,7 @@ autorequire:
|
|
13
18
|
bindir: bin
|
14
19
|
cert_chain: []
|
15
20
|
|
16
|
-
date: 2011-08-
|
21
|
+
date: 2011-08-31 00:00:00 -07:00
|
17
22
|
default_executable:
|
18
23
|
dependencies:
|
19
24
|
- !ruby/object:Gem::Dependency
|
@@ -24,7 +29,12 @@ dependencies:
|
|
24
29
|
requirements:
|
25
30
|
- - "="
|
26
31
|
- !ruby/object:Gem::Version
|
27
|
-
|
32
|
+
hash: 51
|
33
|
+
segments:
|
34
|
+
- 0
|
35
|
+
- 10
|
36
|
+
- 2
|
37
|
+
version: 0.10.2
|
28
38
|
type: :runtime
|
29
39
|
version_requirements: *id001
|
30
40
|
- !ruby/object:Gem::Dependency
|
@@ -35,7 +45,12 @@ dependencies:
|
|
35
45
|
requirements:
|
36
46
|
- - "="
|
37
47
|
- !ruby/object:Gem::Version
|
38
|
-
|
48
|
+
hash: 51
|
49
|
+
segments:
|
50
|
+
- 0
|
51
|
+
- 10
|
52
|
+
- 2
|
53
|
+
version: 0.10.2
|
39
54
|
type: :runtime
|
40
55
|
version_requirements: *id002
|
41
56
|
description: Admin View for Padrino applications
|
@@ -167,12 +182,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
167
182
|
requirements:
|
168
183
|
- - ">="
|
169
184
|
- !ruby/object:Gem::Version
|
185
|
+
hash: 3
|
186
|
+
segments:
|
187
|
+
- 0
|
170
188
|
version: "0"
|
171
189
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
172
190
|
none: false
|
173
191
|
requirements:
|
174
192
|
- - ">="
|
175
193
|
- !ruby/object:Gem::Version
|
194
|
+
hash: 23
|
195
|
+
segments:
|
196
|
+
- 1
|
197
|
+
- 3
|
198
|
+
- 6
|
176
199
|
version: 1.3.6
|
177
200
|
requirements: []
|
178
201
|
|