radiant-reader-extension 3.0.0.rc4 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +105 -38
- data/Rakefile +4 -4
- data/app/controllers/accounts_controller.rb +24 -11
- data/app/controllers/admin/groups_controller.rb +15 -0
- data/app/controllers/admin/memberships_controller.rb +13 -7
- data/app/controllers/admin/messages_controller.rb +1 -0
- data/app/controllers/admin/permissions_controller.rb +15 -8
- data/app/controllers/groups_controller.rb +6 -4
- data/app/controllers/password_resets_controller.rb +1 -1
- data/app/controllers/reader_action_controller.rb +7 -51
- data/app/controllers/reader_sessions_controller.rb +9 -11
- data/app/helpers/reader_helper.rb +23 -3
- data/app/models/group.rb +45 -16
- data/app/models/message.rb +4 -11
- data/app/models/permission.rb +4 -0
- data/app/models/reader.rb +61 -26
- data/app/models/reader_notifier.rb +2 -2
- data/app/models/reader_page.rb +9 -5
- data/app/views/accounts/{_memberships.html.haml → _choose_memberships.html.haml} +0 -0
- data/app/views/accounts/_form.html.haml +9 -11
- data/app/views/accounts/_preamble.html.haml +14 -0
- data/app/views/accounts/_profile_form.html.haml +13 -29
- data/app/views/accounts/dashboard.html.haml +0 -1
- data/app/views/accounts/edit.html.haml +3 -3
- data/app/views/accounts/edit_profile.html.haml +10 -10
- data/app/views/admin/groups/_chooser.html.haml +8 -0
- data/app/views/admin/groups/_form.html.haml +7 -5
- data/app/views/admin/groups/_group.html.haml +29 -0
- data/app/views/admin/groups/index.html.haml +2 -28
- data/app/views/admin/groups/show.html.haml +3 -2
- data/app/views/admin/memberships/_reader.html.haml +2 -6
- data/app/views/admin/messages/_form.html.haml +10 -11
- data/app/views/admin/messages/_list_function.haml +2 -3
- data/app/views/admin/messages/{index.haml → index.html.haml} +21 -11
- data/app/views/admin/pages/_page_groups.html.haml +5 -11
- data/app/views/admin/permissions/_page.html.haml +6 -12
- data/app/views/admin/reader_configuration/edit.html.haml +2 -0
- data/app/views/admin/reader_configuration/show.html.haml +2 -0
- data/app/views/groups/_group.html.haml +12 -0
- data/app/views/groups/show.html.haml +10 -3
- data/app/views/readers/_description.html.haml +3 -0
- data/app/views/readers/_groups.html.haml +9 -0
- data/app/views/{accounts → readers}/_links.html.haml +2 -2
- data/app/views/readers/_list.html.haml +23 -0
- data/app/views/{accounts/_groups.html.haml → readers/_memberships.html.haml} +0 -1
- data/app/views/{accounts/_reader.html.haml → readers/_mugshot.html.haml} +1 -1
- data/app/views/readers/_people.html.haml +6 -0
- data/app/views/readers/_profile.html.haml +30 -0
- data/app/views/readers/_reader.html.haml +28 -0
- data/app/views/readers/index.html.haml +20 -0
- data/app/views/{accounts → readers}/show.html.haml +1 -2
- data/app/views/shared/_standard_reader_parts.html.haml +1 -1
- data/app/views/shared/not_allowed.html.haml +16 -0
- data/config/initializers/formats.rb +1 -2
- data/config/initializers/radiant_config.rb +5 -2
- data/config/locales/en.yml +181 -140
- data/config/routes.rb +25 -16
- data/db/migrate/001_create_readers.rb +0 -1
- data/db/migrate/20090921125653_reader_messages.rb +0 -1
- data/db/migrate/20090921125654_group_messages.rb +0 -1
- data/db/migrate/20110812111934_groups_nested_set.rb +19 -0
- data/db/migrate/20110814070858_message_has_many_groups.rb +14 -0
- data/db/migrate/20110905194602_group_ancestry.rb +23 -0
- data/lib/controller_extensions.rb +49 -0
- data/lib/grouped_model.rb +49 -8
- data/lib/grouped_page.rb +17 -5
- data/lib/message_tags.rb +21 -3
- data/lib/radiant-reader-extension.rb +1 -1
- data/lib/reader_admin_ui.rb +7 -8
- data/lib/reader_tags.rb +1 -1
- data/lib/site_controller_extensions.rb +7 -18
- data/public/images/furniture/csv.png +0 -0
- data/public/images/furniture/csv_tiny.png +0 -0
- data/public/images/furniture/vcard.png +0 -0
- data/public/images/furniture/vcard_tiny.png +0 -0
- data/public/javascripts/admin/reader.js +22 -1
- data/public/stylesheets/sass/admin/reader_group.sass +23 -22
- data/public/stylesheets/sass/reader.sass +81 -17
- data/radiant-reader-extension.gemspec +3 -1
- data/reader_extension.rb +7 -9
- data/spec/controllers/accounts_controller_spec.rb +8 -22
- data/spec/controllers/admin/messages_controller_spec.rb +0 -12
- data/spec/datasets/readers_dataset.rb +41 -38
- data/spec/lib/reader_tags_spec.rb +1 -1
- data/spec/models/group_spec.rb +89 -22
- data/spec/models/message_spec.rb +1 -1
- data/spec/models/reader_notifier_spec.rb +1 -1
- data/spec/models/reader_page_spec.rb +34 -18
- data/spec/models/reader_spec.rb +0 -1
- data/spec/spec.opts +4 -3
- metadata +51 -28
- data/app/views/accounts/_contributions.html.haml +0 -2
- data/app/views/accounts/_description.html.haml +0 -2
- data/app/views/accounts/_list.html.haml +0 -17
- data/app/views/accounts/_profile.html.haml +0 -29
- data/app/views/accounts/index.html.haml +0 -23
- data/app/views/groups/_all.html.haml +0 -10
- data/app/views/site/not_allowed.html.haml +0 -4
- data/db/migrate/20100922152338_lock_versions.rb +0 -9
- data/db/migrate/20101004074945_unlock_version.rb +0 -9
data/config/routes.rb
CHANGED
@@ -3,30 +3,39 @@ ActionController::Routing::Routes.draw do |map|
|
|
3
3
|
admin.resources :messages, :member => [:preview, :deliver]
|
4
4
|
admin.resources :groups, :has_many => [:memberships, :permissions, :group_invitations, :messages]
|
5
5
|
admin.resource :reader_configuration, :controller => 'reader_configuration'
|
6
|
+
admin.toggle_group_membership "memberships/toggle", :controller => 'memberships', :action => 'toggle'
|
7
|
+
admin.toggle_group_permission "permissions/toggle", :controller => 'permissions', :action => 'toggle'
|
6
8
|
end
|
7
9
|
|
8
10
|
map.namespace :admin do |admin|
|
9
11
|
admin.resources :readers, :except => [:show]
|
10
12
|
end
|
11
13
|
|
12
|
-
|
13
|
-
|
14
|
-
map.resources :
|
14
|
+
readers_prefix = Radiant.config['reader.profiles_path'] || "directory"
|
15
|
+
|
16
|
+
map.resources :readers, :controller => 'accounts', :path_prefix => readers_prefix
|
17
|
+
map.resources :messages, :only => [:index, :show], :member => [:preview], :path_prefix => readers_prefix
|
18
|
+
map.resources :groups, :path_prefix => readers_prefix do |group|
|
15
19
|
group.resources :messages, :only => [:index, :show], :member => [:preview]
|
16
20
|
end
|
17
21
|
|
18
|
-
|
19
|
-
|
20
|
-
map.resource :
|
22
|
+
accounts_prefix = Radiant.config['reader.preferences_path'] || "account"
|
23
|
+
|
24
|
+
map.resource :reader_session, :path_prefix => accounts_prefix
|
25
|
+
map.resource :reader_activation, :only => [:show, :new], :path_prefix => accounts_prefix
|
26
|
+
map.resource :password_reset, :path_prefix => accounts_prefix
|
27
|
+
|
28
|
+
map.activate_me "#{accounts_prefix}/activate/:id/:activation_code", :controller => 'reader_activations', :action => 'update'
|
29
|
+
map.repassword_me "#{accounts_prefix}/repassword/:id/:confirmation_code", :controller => 'password_resets', :action => 'edit'
|
30
|
+
map.reader_register "#{accounts_prefix}/register", :controller => 'accounts', :action => 'new'
|
31
|
+
map.reader_login "#{accounts_prefix}/login", :controller => 'reader_sessions', :action => 'new'
|
32
|
+
map.reader_logout "#{accounts_prefix}/logout", :controller => 'reader_sessions', :action => 'destroy'
|
33
|
+
map.reader_account "#{accounts_prefix}/preferences", :controller => 'accounts', :action => 'edit'
|
34
|
+
map.reader_profile "#{readers_prefix}/profile", :controller => 'accounts', :action => 'show'
|
35
|
+
map.reader_edit_profile "#{accounts_prefix}/edit_profile", :controller => 'accounts', :action => 'edit_profile'
|
36
|
+
map.reader_permission_denied "#{accounts_prefix}/permission_denied", :controller => 'accounts', :action => 'permission_denied'
|
21
37
|
|
22
|
-
map.
|
23
|
-
map.
|
24
|
-
|
25
|
-
map.reader_login '/login', :controller => 'reader_sessions', :action => 'new'
|
26
|
-
map.reader_logout '/logout', :controller => 'reader_sessions', :action => 'destroy'
|
27
|
-
map.reader_dashboard '/dashboard', :controller => 'accounts', :action => 'dashboard'
|
28
|
-
map.reader_account '/account', :controller => 'accounts', :action => 'edit'
|
29
|
-
map.reader_profile '/profile', :controller => 'accounts', :action => 'show'
|
30
|
-
map.reader_edit_profile '/edit_profile', :controller => 'accounts', :action => 'edit_profile'
|
31
|
-
map.reader_permission_denied '/permission_denied', :controller => 'accounts', :action => 'permission_denied'
|
38
|
+
map.reader_index readers_prefix, :controller => 'accounts', :action => 'index'
|
39
|
+
map.reader_dashboard accounts_prefix, :controller => 'accounts', :action => 'dashboard'
|
40
|
+
|
32
41
|
end
|
@@ -20,7 +20,6 @@ class CreateReaders < ActiveRecord::Migration
|
|
20
20
|
t.column :activation_code, :string
|
21
21
|
t.column :provisional_password, :string
|
22
22
|
t.column :activated_at, :datetime
|
23
|
-
# t.column :lock_version, :integer, :default => 0
|
24
23
|
end
|
25
24
|
add_index :readers, ["session_token"], :name => "session_token"
|
26
25
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class GroupsNestedSet < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_column :groups, :parent_id, :integer
|
4
|
+
add_column :groups, :root_group_id, :integer
|
5
|
+
add_column :groups, :lft, :integer
|
6
|
+
add_column :groups, :rgt, :integer
|
7
|
+
|
8
|
+
Group.reset_column_information
|
9
|
+
Group.rebuild!
|
10
|
+
Group.all.each {|g| g.save }
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
remove_column :groups, :parent_id
|
15
|
+
remove_column :groups, :root_group_id
|
16
|
+
remove_column :groups, :lft
|
17
|
+
remove_column :groups, :rgt
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class MessageHasManyGroups < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
Message.all.each do |m|
|
4
|
+
if g = Group.find_by_id(m.group_id)
|
5
|
+
m.permit(g)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
remove_column :messages, :group_id
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.down
|
12
|
+
add_column :messages, :group_id , :integer
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class GroupAncestry < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
remove_column :groups, :root_group_id
|
4
|
+
remove_column :groups, :lft
|
5
|
+
remove_column :groups, :rgt
|
6
|
+
add_column :groups, :ancestry, :string
|
7
|
+
add_index :groups, :ancestry
|
8
|
+
|
9
|
+
Group.reset_column_information
|
10
|
+
Group.build_ancestry_from_parent_ids!
|
11
|
+
|
12
|
+
remove_column :groups, :parent_id
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.down
|
16
|
+
remove_column :groups, :ancestry
|
17
|
+
remove_index :groups, :ancestry
|
18
|
+
add_column :groups, :parent_id
|
19
|
+
add_column :groups, :root_group_id, :integer
|
20
|
+
add_column :groups, :lft, :integer
|
21
|
+
add_column :groups, :rgt, :integer
|
22
|
+
end
|
23
|
+
end
|
@@ -3,6 +3,10 @@ module ControllerExtensions # for inclusion into ApplicationController
|
|
3
3
|
def self.included(base)
|
4
4
|
|
5
5
|
base.class_eval do
|
6
|
+
rescue_from ReaderError::AccessDenied, :with => :access_denied
|
7
|
+
rescue_from ReaderError::LoginRequired, :with => :login_required
|
8
|
+
rescue_from ReaderError::ActivationRequired, :with => :activation_required
|
9
|
+
|
6
10
|
before_filter :set_reader_for_user
|
7
11
|
before_filter :set_reader
|
8
12
|
helper_method :current_reader_session, :current_reader, :current_reader=
|
@@ -69,6 +73,51 @@ module ControllerExtensions # for inclusion into ApplicationController
|
|
69
73
|
redirect_to address + ".#{format}" # nasty! but necessary for inline login.
|
70
74
|
end
|
71
75
|
|
76
|
+
# reader-permission exception handling
|
77
|
+
|
78
|
+
def login_required(e)
|
79
|
+
@message = e.message
|
80
|
+
respond_to do |format|
|
81
|
+
format.html {
|
82
|
+
flash[:explanation] = t('reader_extension.reader_required')
|
83
|
+
flash[:notice] = e.message
|
84
|
+
redirect_to reader_login_url
|
85
|
+
}
|
86
|
+
format.js {
|
87
|
+
@inline = true
|
88
|
+
render :partial => 'reader_sessions/login_form'
|
89
|
+
}
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
def activation_required(e)
|
94
|
+
@message = e.message
|
95
|
+
respond_to do |format|
|
96
|
+
format.html {
|
97
|
+
flash[:explanation] = t('reader_extension.activation_required')
|
98
|
+
redirect_to reader_activation_url
|
99
|
+
}
|
100
|
+
format.js {
|
101
|
+
@inline = true
|
102
|
+
render :partial => 'reader_activations/activation_required'
|
103
|
+
}
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
def access_denied(e)
|
108
|
+
@message = e.message
|
109
|
+
respond_to do |format|
|
110
|
+
format.html {
|
111
|
+
flash[:explanation] = t('reader_extension.access_denied')
|
112
|
+
flash[:notice] = e.message
|
113
|
+
render :template => 'shared/not_allowed'
|
114
|
+
}
|
115
|
+
format.js {
|
116
|
+
render :text => @message, :status => 403
|
117
|
+
}
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
72
121
|
end
|
73
122
|
end
|
74
123
|
|
data/lib/grouped_model.rb
CHANGED
@@ -1,14 +1,36 @@
|
|
1
1
|
module GroupedModel
|
2
|
+
|
3
|
+
# Grouped Models are those that can be assigned to one or more groups, and so made invisible to any reader
|
4
|
+
# who is not a member of one of those groups. As standard this is applied to pages and messages.
|
5
|
+
# To group-limit another class:
|
6
|
+
#
|
7
|
+
# class Widget < ActiveRecord::Base
|
8
|
+
# has_groups
|
9
|
+
# ...
|
10
|
+
#
|
11
|
+
# This will define several class and instance methods and some scopes, most usefully:
|
12
|
+
#
|
13
|
+
# Widget#groups -> groups association can << and +/- in the usual ways
|
14
|
+
# Group#widgets -> a scope, not an association
|
15
|
+
# Widget#visible_to?(reader) -> boolean
|
16
|
+
# Widget.visible_to(reader) -> list of visible widgets (as scope)
|
17
|
+
# Widget.belonging_to(group) -> list of widgets
|
18
|
+
#
|
19
|
+
# The situation is more complex than it seems because of polymorphy and group-inheritance but that should all be taken care of for you.
|
20
|
+
#
|
2
21
|
def self.included(base)
|
3
22
|
base.extend ClassMethods
|
4
23
|
end
|
5
24
|
|
6
25
|
module ClassMethods
|
26
|
+
# Returns true if group relations have been established in this model.
|
7
27
|
def has_groups?
|
8
28
|
false
|
9
29
|
end
|
10
30
|
alias :has_group? :has_groups?
|
11
31
|
|
32
|
+
# Sets up group relations and scopes in this model. No extra columns are required in the model table.
|
33
|
+
#
|
12
34
|
def has_groups(options={})
|
13
35
|
return if has_groups?
|
14
36
|
|
@@ -25,13 +47,14 @@ module GroupedModel
|
|
25
47
|
}
|
26
48
|
|
27
49
|
has_many :permissions, :as => :permitted
|
50
|
+
accepts_nested_attributes_for :permissions
|
28
51
|
has_many :groups, :through => :permissions
|
29
52
|
Group.define_retrieval_methods(self.to_s)
|
30
53
|
|
31
54
|
named_scope :visible_to, lambda { |reader|
|
32
55
|
conditions = "pp.group_id IS NULL"
|
33
|
-
if reader && reader.
|
34
|
-
ids = reader.
|
56
|
+
if reader && reader.is_grouped?
|
57
|
+
ids = reader.all_group_ids
|
35
58
|
conditions = ["#{conditions} OR pp.group_id IS NULL OR pp.group_id IN(#{ids.map{"?"}.join(',')})", *ids]
|
36
59
|
end
|
37
60
|
{
|
@@ -70,14 +93,20 @@ module GroupedModel
|
|
70
93
|
end
|
71
94
|
end
|
72
95
|
|
73
|
-
named_scope :belonging_to, lambda { |group|
|
96
|
+
named_scope :belonging_to, lambda { |group|
|
97
|
+
group_ids = group.subtree_ids
|
74
98
|
{
|
75
99
|
:joins => "INNER JOIN permissions as pp on pp.permitted_id = #{self.table_name}.id AND pp.permitted_type = '#{self.to_s}'",
|
76
100
|
:group => column_names.map { |n| self.table_name + '.' + n }.join(','),
|
77
|
-
:conditions => ["pp.group_id
|
101
|
+
:conditions => ["pp.group_id IN (#{group_ids.map{"?"}.join(',')})", *group_ids],
|
78
102
|
:readonly => false
|
79
103
|
}
|
80
104
|
}
|
105
|
+
|
106
|
+
named_scope :find_these, lambda { |ids|
|
107
|
+
ids = ['NULL'] unless ids && ids.any?
|
108
|
+
{ :conditions => ["#{self.table_name}.id IN (#{ids.map{"?"}.join(',')})", *ids] }
|
109
|
+
}
|
81
110
|
|
82
111
|
end
|
83
112
|
alias :has_group :has_groups
|
@@ -85,13 +114,25 @@ module GroupedModel
|
|
85
114
|
|
86
115
|
module GroupedInstanceMethods
|
87
116
|
|
88
|
-
#
|
117
|
+
# The list of groups that is allowed to see this object. This will include the groups directly
|
118
|
+
# associated and their descendant subgroups.
|
119
|
+
#
|
89
120
|
def permitted_groups
|
90
|
-
|
121
|
+
if permitted_group_ids.any?
|
122
|
+
Group.find(permitted_group_ids)
|
123
|
+
else
|
124
|
+
[]
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
def permitted_group_ids
|
129
|
+
# in GroupedPage this is chained to include groups inherited from ancestor pages
|
130
|
+
# while here the subtrees provide inheritance from ancestor groups.
|
131
|
+
#
|
132
|
+
groups.map(&:subtree_ids).flatten.uniq
|
91
133
|
end
|
92
134
|
|
93
135
|
def visible_to?(reader)
|
94
|
-
Rails.logger.warn "grouped_model#visible_to?"
|
95
136
|
return true if self.permitted_groups.empty?
|
96
137
|
return false if reader.nil?
|
97
138
|
return true if reader.is_admin?
|
@@ -111,7 +152,7 @@ module GroupedModel
|
|
111
152
|
end
|
112
153
|
|
113
154
|
def permitted_readers
|
114
|
-
permitted_groups.any? ? Reader.in_groups(permitted_groups) : Reader.
|
155
|
+
permitted_groups.any? ? Reader.in_groups(permitted_groups) : Reader.scoped({})
|
115
156
|
end
|
116
157
|
|
117
158
|
def has_group?(group)
|
data/lib/grouped_page.rb
CHANGED
@@ -5,7 +5,7 @@ module GroupedPage
|
|
5
5
|
has_groups
|
6
6
|
has_one :homegroup, :foreign_key => 'homepage_id', :class_name => 'Group'
|
7
7
|
include InstanceMethods
|
8
|
-
alias_method_chain :
|
8
|
+
alias_method_chain :permitted_group_ids, :inheritance
|
9
9
|
}
|
10
10
|
end
|
11
11
|
|
@@ -15,14 +15,26 @@ module GroupedPage
|
|
15
15
|
def inherited_groups
|
16
16
|
@inherited_groups ||= self.parent ? Group.attached_to(self.ancestors) : []
|
17
17
|
end
|
18
|
+
|
19
|
+
# If a grandparent page is associated with a supergroup page
|
20
|
+
# then all of the descendant pages are bound to all of the descendant groups.
|
21
|
+
def inherited_group_ids
|
22
|
+
self.ancestors.map(&:group_ids).flatten.uniq
|
23
|
+
end
|
18
24
|
|
19
|
-
def
|
20
|
-
|
25
|
+
def permitted_group_ids_with_inheritance
|
26
|
+
(permitted_group_ids_without_inheritance + inherited_group_ids).flatten.uniq
|
21
27
|
end
|
22
28
|
|
23
|
-
|
29
|
+
def restricted?
|
30
|
+
self.permitted_groups.any?
|
31
|
+
end
|
32
|
+
|
33
|
+
# this is regrettably expensive and I plan to replace it with a
|
34
|
+
# private? method that would be cascaded on page update
|
35
|
+
#
|
24
36
|
def cache?
|
25
|
-
|
37
|
+
!restricted?
|
26
38
|
end
|
27
39
|
|
28
40
|
def has_inherited_group?(group)
|
data/lib/message_tags.rb
CHANGED
@@ -77,10 +77,28 @@ module MessageTags
|
|
77
77
|
|
78
78
|
desc %{
|
79
79
|
Only for use in email messages. Displays the preferences url of the reader currently being emailed.
|
80
|
-
<pre><code><r:recipient:
|
80
|
+
<pre><code><r:recipient:edit_preferences_url /></code></pre>
|
81
|
+
}
|
82
|
+
tag "recipient:edit_preferences_url" do |tag|
|
83
|
+
|
84
|
+
Rails.logger.warn "and the :host argument will be #{@mailer_vars[:@host]}"
|
85
|
+
Rails.logger.warn "giving us #{reader_account_url(:host => @mailer_vars[:@host])}"
|
86
|
+
|
87
|
+
reader_account_url(:host => @mailer_vars[:@host])
|
88
|
+
end
|
89
|
+
|
90
|
+
desc %{
|
91
|
+
Please replace your old r:recipient:edit_url tags with either `r:recipient:edit_profile_url` or `r:recipient:edit_preferences_url`.
|
92
|
+
<pre><code><r:recipient:edit_url /></code></pre>
|
93
|
+
}
|
94
|
+
deprecated_tag "recipient:edit_url", :substitute => 'recipient:edit_preferences_url'
|
95
|
+
|
96
|
+
desc %{
|
97
|
+
Only for use in email messages. Displays the edit-my-profile url of the reader currently being emailed.
|
98
|
+
<pre><code><r:recipient:edit_profile_url /></code></pre>
|
81
99
|
}
|
82
|
-
tag "recipient:
|
83
|
-
|
100
|
+
tag "recipient:edit_profile_url" do |tag|
|
101
|
+
reader_edit_profile_url(:host => @mailer_vars[:@host])
|
84
102
|
end
|
85
103
|
|
86
104
|
desc %{
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module RadiantReaderExtension
|
2
|
-
VERSION = '3.0.0
|
2
|
+
VERSION = '3.0.0'
|
3
3
|
SUMMARY = %q{Reader/viewer/visitor registration, login and access-control for Radiant CMS}
|
4
4
|
DESCRIPTION = %q{Provides reader/member/user registration and management functions including password-reminder, group-based page access control and administrative email.}
|
5
5
|
URL = "http://radiant.spanner.org/reader"
|
data/lib/reader_admin_ui.rb
CHANGED
@@ -64,8 +64,8 @@ module ReaderAdminUI
|
|
64
64
|
edit.form_bottom.concat %w{edit_timestamp edit_buttons}
|
65
65
|
end
|
66
66
|
message.index = Radiant::AdminUI::RegionSet.new do |index|
|
67
|
-
index.thead.concat %w{subject_header sent_header modify_header}
|
68
|
-
index.tbody.concat %w{subject_cell sent_cell modify_cell}
|
67
|
+
index.thead.concat %w{subject_header function_header groups_header sent_header modify_header}
|
68
|
+
index.tbody.concat %w{subject_cell function_cell groups_cell sent_cell modify_cell}
|
69
69
|
index.bottom.concat %w{buttons}
|
70
70
|
end
|
71
71
|
message.show = Radiant::AdminUI::RegionSet.new do |show|
|
@@ -107,12 +107,11 @@ module ReaderAdminUI
|
|
107
107
|
dashboard.sidebar.concat %w{dashboard/profile dashboard/messages dashboard/directory}
|
108
108
|
end
|
109
109
|
account.index = Radiant::AdminUI::RegionSet.new do |index|
|
110
|
-
index.main.concat %w{
|
111
|
-
index.sidebar.concat %w{groups/all}
|
110
|
+
index.main.concat %w{readers/groups readers/people}
|
112
111
|
end
|
113
112
|
account.show = Radiant::AdminUI::RegionSet.new do |show|
|
114
|
-
show.main.concat %w{
|
115
|
-
show.sidebar.concat %w{profile}
|
113
|
+
show.main.concat %w{readers/memberships readers/description}
|
114
|
+
show.sidebar.concat %w{readers/profile}
|
116
115
|
end
|
117
116
|
account.edit = Radiant::AdminUI::RegionSet.new do |edit|
|
118
117
|
edit.main.concat %w{preamble form gravatar}
|
@@ -120,8 +119,8 @@ module ReaderAdminUI
|
|
120
119
|
edit.form_bottom.concat %w{edit_buttons}
|
121
120
|
end
|
122
121
|
account.edit_profile = Radiant::AdminUI::RegionSet.new do |edit_profile|
|
123
|
-
edit_profile.main.concat %w{
|
124
|
-
edit_profile.
|
122
|
+
edit_profile.main.concat %w{preamble profile_form gravatar}
|
123
|
+
edit_profile.profile_form.concat %w{edit_honorific edit_name edit_email edit_phone edit_mobile edit_address edit_shareability}
|
125
124
|
edit_profile.form_bottom.concat %w{edit_buttons}
|
126
125
|
end
|
127
126
|
account.new = account.edit
|
data/lib/reader_tags.rb
CHANGED
@@ -26,7 +26,7 @@ module ReaderTags
|
|
26
26
|
|
27
27
|
Please note that if you use this tag on a normal radiant page, all registered readers
|
28
28
|
will be displayed, regardless of group-based or other access limitations. You really
|
29
|
-
want to keep this tag for ReaderPages and GroupPages.
|
29
|
+
want to keep this tag for ReaderPages and (soon) GroupPages.
|
30
30
|
|
31
31
|
*Usage:*
|
32
32
|
<pre><code><r:readers:each [limit=0] [offset=0] [order="asc|desc"] [by="position|title|..."] [extensions="png|pdf|doc"]>...</r:readers:each></code></pre>
|