Skip to content

Commit

Permalink
fix to detreed group-chooser
Browse files Browse the repository at this point in the history
  • Loading branch information
will-r committed Nov 22, 2011
1 parent 5da9c97 commit ac01900
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
2 changes: 1 addition & 1 deletion app/controllers/admin/groups_controller.rb
Expand Up @@ -9,7 +9,7 @@ def show
end end


def load_models def load_models
self.models = paginated? ? model_class.roots.paginate(pagination_parameters) : model_class.roots.all self.models = paginated? ? model_class.paginate(pagination_parameters) : model_class.all
end end


def load_model def load_model
Expand Down
9 changes: 0 additions & 9 deletions app/controllers/admin/readers_controller.rb
@@ -1,7 +1,6 @@
class Admin::ReadersController < Admin::ResourceController class Admin::ReadersController < Admin::ResourceController
helper :reader helper :reader
paginate_models paginate_models
before_filter :redirect_to_user, :only => :edit


only_allow_access_to :new, :create, :edit, :update, :remove, :destroy, :settings, only_allow_access_to :new, :create, :edit, :update, :remove, :destroy, :settings,
:when => :admin, :when => :admin,
Expand All @@ -18,12 +17,4 @@ def create


private private


def redirect_to_user
if model.is_user?
redirect_to edit_admin_user_url(model.user)
return false
end
true
end

end end
9 changes: 3 additions & 6 deletions app/views/admin/groups/_chooser.html.haml
@@ -1,14 +1,11 @@
- chooser ||= @page - chooser ||= @page
- if chooser - if chooser
- root ||= nil
- disabled ||= false - disabled ||= false
- branches = root ? root.children : Group.roots


%ul{:class => root ? '' : 'tree'} %ul
- branches.each do |group| - Group.all.each do |group|
%li %li
- checked = chooser.has_group?(group) - checked = chooser.has_group?(group)
= check_box_tag 'group_ids', group.id, checked, :id => "group_ids_#{group.id}", :class => "treebox", :disabled => disabled = check_box_tag 'group_ids', group.id, checked, :id => "group_ids_#{group.id}", :disabled => disabled
%label{:for => "group_ids_#{group.id}", :class => 'checkbox'} %label{:for => "group_ids_#{group.id}", :class => 'checkbox'}
= group.name = group.name
= render :partial => 'admin/groups/chooser', :object => chooser, :locals => {:root => group, :disabled => checked}
2 changes: 1 addition & 1 deletion lib/radiant-reader-extension.rb
@@ -1,5 +1,5 @@
module RadiantReaderExtension module RadiantReaderExtension
VERSION = '3.0.35' VERSION = '3.0.36'
SUMMARY = %q{Reader/viewer/visitor registration, login and access-control for Radiant CMS} SUMMARY = %q{Reader/viewer/visitor registration, login and access-control for Radiant CMS}
DESCRIPTION = %q{Provides reader/member/user registration and management functions including password-reminder, group-based page access control and administrative email.} DESCRIPTION = %q{Provides reader/member/user registration and management functions including password-reminder, group-based page access control and administrative email.}
URL = "http://radiant.spanner.org/reader" URL = "http://radiant.spanner.org/reader"
Expand Down

0 comments on commit ac01900

Please sign in to comment.