lyb_devise_admin 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,6 @@
1
+ module DeviseHelper
2
+ # Prepare roles to show in select inputs etc.
3
+ def roles_for_collection
4
+ Role.all.map{|role| [role.to_s, role.name.to_s]}
5
+ end
6
+ end
@@ -5,7 +5,7 @@
5
5
  = f.input :password, :hint => !f.object.new_record?, :input_html => {:autocomplete => "off"}
6
6
  = f.input :password_confirmation
7
7
  -# f.input :current_password, :required => true unless can?(:manage, User)
8
- = f.input :role_texts, :as => :select, :collection => Ability.roles_for_collection, :include_blank => false, :input_html => {:multiple => 'multiple'}, :required => true if can?(:manage, Role)
8
+ = f.input :role_texts, :as => :select, :collection => roles_for_collection, :include_blank => false, :input_html => {:multiple => 'multiple'}, :required => true if can?(:manage, Role)
9
9
 
10
10
  = f.buttons do
11
11
  = f.commit_button
@@ -0,0 +1,11 @@
1
+ = semantic_form_for @user do |f|
2
+ = f.semantic_errors
3
+ = f.inputs do
4
+ = f.input :email
5
+ = f.input :password, :hint => !f.object.new_record?, :input_html => {:autocomplete => "off"}
6
+ = f.input :password_confirmation
7
+ -# f.input :current_password, :required => true unless can?(:manage, User)
8
+ = f.input :role_texts, :as => :select, :collection => Ability.roles_for_collection, :include_blank => false, :input_html => {:multiple => 'multiple'}, :required => true if can?(:manage, Role)
9
+
10
+ = f.buttons do
11
+ = f.commit_button
@@ -0,0 +1,5 @@
1
+ = contextual_links
2
+
3
+ %h2= t_title
4
+
5
+ = render 'form'
@@ -0,0 +1,5 @@
1
+ = contextual_links
2
+
3
+ %h2= t_title
4
+
5
+ = render 'form'
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lyb_devise_admin
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 25
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 1
8
- - 0
9
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - "Simon H\xC3\xBCrlimann (CyT)"
@@ -14,7 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2011-02-22 00:00:00 +01:00
18
+ date: 2011-08-09 00:00:00 +02:00
18
19
  default_executable:
19
20
  dependencies: []
20
21
 
@@ -28,22 +29,21 @@ extensions: []
28
29
  extra_rdoc_files: []
29
30
 
30
31
  files:
32
+ - app/helpers/devise_helper.rb
33
+ - app/controllers/users_controller.rb
34
+ - app/controllers/authorized_controller.rb
35
+ - app/views/users/edit.html.haml
36
+ - app/views/users/_form.html.haml~
31
37
  - app/views/users/index.html.haml
38
+ - app/views/users/new.html.haml
39
+ - app/views/users/_resource_detail.html.haml
40
+ - app/views/users/show.html.haml
32
41
  - app/views/users/_collection_table.html.haml
33
- - app/views/users/_collection_table.html.haml~
34
42
  - app/views/users/_form.html.haml
35
- - app/views/users/show.html.haml
36
- - app/views/users/_resource_detail.html.haml
37
- - app/controllers/authorized_controller.rb
38
- - app/controllers/users_controller.rb~
39
- - app/controllers/users_controller.rb
40
- - lib/lyb_devise_admin.rb~
41
- - lib/lyb_devise_admin/railtie.rb~
42
- - lib/lyb_devise_admin/railtie.rb
43
43
  - lib/lyb_devise_admin.rb
44
- - config/routes.rb
45
- - config/routes.rb~
44
+ - lib/lyb_devise_admin/railtie.rb
46
45
  - config/locales/lyb_devise_admin.yml
46
+ - config/routes.rb
47
47
  - MIT-LICENSE
48
48
  - Rakefile
49
49
  - Gemfile
@@ -58,23 +58,27 @@ rdoc_options: []
58
58
  require_paths:
59
59
  - lib
60
60
  required_ruby_version: !ruby/object:Gem::Requirement
61
+ none: false
61
62
  requirements:
62
63
  - - ">="
63
64
  - !ruby/object:Gem::Version
65
+ hash: 3
64
66
  segments:
65
67
  - 0
66
68
  version: "0"
67
69
  required_rubygems_version: !ruby/object:Gem::Requirement
70
+ none: false
68
71
  requirements:
69
72
  - - ">="
70
73
  - !ruby/object:Gem::Version
74
+ hash: 3
71
75
  segments:
72
76
  - 0
73
77
  version: "0"
74
78
  requirements: []
75
79
 
76
80
  rubyforge_project:
77
- rubygems_version: 1.3.6
81
+ rubygems_version: 1.3.7
78
82
  signing_key:
79
83
  specification_version: 3
80
84
  summary: LybDeviseAdmin provides a ready-to-use admin interface for device.
@@ -1,33 +0,0 @@
1
- # Users Controller
2
- #
3
- # Provides a user/account management interface.
4
- class UsersController < AuthorizedController
5
- # Scopes
6
- has_scope :tagged_with
7
-
8
- # Actions
9
- def update
10
- # Preset role_texts to ensure it clears roles.
11
- params[:user][:role_texts] ||= []
12
-
13
- @user = User.find(params[:id])
14
-
15
- # Don't try to update password if not provided
16
- if params[:user][:password].blank?
17
- [:password, :password_confirmation, :current_password].collect{|p| params[:user].delete(p) }
18
- end
19
-
20
- update!
21
- end
22
-
23
- def unlock
24
- @user = resource
25
- @user.unlock_access!
26
-
27
- redirect_to users_path, :notice => t('crud.flash.unlocked', :user => @user.to_s)
28
- end
29
-
30
- def current
31
- redirect_to current_user
32
- end
33
- end
@@ -1,16 +0,0 @@
1
- %table.list{:class => "#{collection.first.class.to_s.downcase.pluralize} collection"}
2
- %thead
3
- %tr
4
- - ['name', 'email', 'roles', 'created_at', 'locked'].each do |field|
5
- %th= t_attr field, collection.first.class
6
- %th.action-links
7
- %tbody
8
- - collection.each do |r|
9
- %tr
10
- - r.attributes.each_pair do |field, value|
11
- - next if ['id', 'created_at', 'updated_at'].include?(field)
12
- %td= value
13
- %td.action-links
14
- =link_to "Show", resource_url(r), 'data-href-container' => 'tr'
15
- =link_to "Edit", edit_resource_url(r)
16
- =link_to "Destroy", resource_url(r), :confirm => 'Are you sure?', :method => :delete
data/config/routes.rb~ DELETED
@@ -1,10 +0,0 @@
1
- LybDeviseAdmin::Engine.routes.draw do
2
- resources :users do
3
- member do
4
- post :unlock
5
- end
6
- collection do
7
- get :current
8
- end
9
- end
10
- end
@@ -1,7 +0,0 @@
1
- require 'lyb_devise_admin'
2
- require 'rails'
3
-
4
- module LybSidebar
5
- class Railtie < Rails::Engine
6
- end
7
- end
@@ -1,2 +0,0 @@
1
- module LybDeviseAdmin
2
- end