radiant-reader-extension 1.3.13 → 2.0.0.rc4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -2
- data/Rakefile +0 -19
- data/app/controllers/admin/group_invitations_controller.rb +78 -0
- data/app/controllers/admin/groups_controller.rb +8 -0
- data/app/controllers/admin/memberships_controller.rb +42 -0
- data/app/controllers/admin/messages_controller.rb +8 -3
- data/app/controllers/admin/permissions_controller.rb +42 -0
- data/app/controllers/admin/reader_configuration_controller.rb +0 -1
- data/app/controllers/admin/readers_controller.rb +1 -1
- data/app/controllers/password_resets_controller.rb +5 -5
- data/app/controllers/reader_action_controller.rb +13 -33
- data/app/controllers/reader_activations_controller.rb +4 -8
- data/app/controllers/reader_sessions_controller.rb +15 -26
- data/app/controllers/readers_controller.rb +26 -9
- data/app/helpers/reader_helper.rb +45 -17
- data/app/models/group.rb +80 -0
- data/app/models/membership.rb +13 -0
- data/app/models/message.rb +10 -7
- data/app/models/permission.rb +11 -0
- data/app/models/reader.rb +79 -35
- data/app/models/reader_notifier.rb +1 -0
- data/app/views/admin/group_invitations/new.html.haml +31 -0
- data/app/views/admin/group_invitations/preview.html.haml +58 -0
- data/app/views/admin/groups/_add_readers.html.haml +0 -0
- data/app/views/admin/groups/_form.html.haml +26 -0
- data/app/views/admin/groups/_list_head.html.haml +12 -0
- data/app/views/admin/groups/edit.html.haml +9 -0
- data/app/views/admin/groups/index.html.haml +44 -0
- data/app/views/admin/groups/new.html.haml +7 -0
- data/app/views/admin/groups/remove.html.haml +31 -0
- data/app/views/admin/groups/show.html.haml +74 -0
- data/app/views/admin/memberships/_reader.html.haml +9 -0
- data/app/views/admin/messages/_function.haml +31 -0
- data/app/views/admin/messages/_list_function.haml +7 -3
- data/app/views/admin/messages/_list_notes.html.haml +9 -0
- data/app/views/admin/messages/_message_description.html.haml +5 -1
- data/app/views/admin/messages/_message_group.html.haml +5 -0
- data/app/views/admin/messages/index.haml +4 -4
- data/app/views/admin/messages/show.html.haml +15 -15
- data/app/views/admin/pages/_listed.html.haml +16 -0
- data/app/views/admin/pages/_page_groups.html.haml +13 -0
- data/app/views/admin/permissions/_page.html.haml +24 -0
- data/app/views/admin/reader_configuration/edit.html.haml +3 -1
- data/app/views/admin/reader_configuration/show.html.haml +4 -2
- data/app/views/admin/readers/_form.html.haml +7 -7
- data/app/views/admin/readers/_password_fields.html.haml +6 -6
- data/app/views/admin/readers/_reader_groups.html.haml +7 -0
- data/app/views/admin/readers/edit.html.haml +2 -1
- data/app/views/admin/readers/index.html.haml +5 -2
- data/app/views/password_resets/create.html.haml +13 -8
- data/app/views/password_resets/edit.html.haml +26 -26
- data/app/views/password_resets/new.html.haml +28 -25
- data/app/views/reader_activations/_activation_required.haml +2 -2
- data/app/views/reader_activations/show.html.haml +11 -13
- data/app/views/reader_sessions/_login_form.html.haml +13 -12
- data/app/views/reader_sessions/new.html.haml +6 -8
- data/app/views/readers/_controls.html.haml +11 -9
- data/app/views/readers/_form.html.haml +32 -33
- data/app/views/readers/_memberships.html.haml +11 -0
- data/app/views/readers/edit.html.haml +11 -11
- data/app/views/readers/index.html.haml +9 -10
- data/app/views/readers/login.html.haml +10 -12
- data/app/views/readers/new.html.haml +11 -13
- data/app/views/readers/permission_denied.html.haml +7 -7
- data/app/views/readers/show.html.haml +7 -8
- data/app/views/shared/_standard_reader_parts.html.haml +14 -0
- data/app/views/site/not_allowed.html.haml +4 -0
- data/config/initializers/authlogic_connect_config.rb +12 -0
- data/config/initializers/radiant_config.rb +1 -0
- data/config/locales/en.yml +217 -177
- data/config/routes.rb +5 -0
- data/db/migrate/20090921125654_group_messages.rb +35 -0
- data/db/migrate/20091120083119_groups_public.rb +11 -0
- data/db/migrate/20110214101339_multiple_ownership.rb +13 -0
- data/lib/controller_extensions.rb +1 -1
- data/lib/group_tags.rb +65 -0
- data/lib/grouped_model.rb +125 -0
- data/lib/grouped_page.rb +39 -0
- data/lib/message_tags.rb +183 -0
- data/lib/radiant-reader-extension.rb +8 -0
- data/lib/reader_admin_ui.rb +29 -6
- data/lib/reader_tags.rb +7 -183
- data/lib/sanitize/config/generous.rb +49 -0
- data/lib/site_controller_extensions.rb +35 -0
- data/public/javascripts/reader.js +1 -1
- data/public/stylesheets/sass/reader.sass +18 -8
- data/radiant-reader-extension.gemspec +30 -176
- data/reader_extension.rb +31 -23
- data/spec/controllers/admin/messages_controller_spec.rb +1 -1
- data/spec/controllers/admin/readers_controller_spec.rb +0 -1
- data/spec/controllers/password_resets_controller_spec.rb +1 -1
- data/spec/controllers/reader_activations_controller_spec.rb +1 -1
- data/spec/controllers/readers_controller_spec.rb +67 -40
- data/spec/controllers/site_controller_spec.rb +63 -0
- data/spec/datasets/readers_dataset.rb +100 -11
- data/spec/models/group_spec.rb +46 -0
- data/spec/models/message_spec.rb +40 -15
- data/spec/models/page_spec.rb +81 -0
- data/spec/models/reader_notifier_spec.rb +1 -1
- data/spec/models/reader_spec.rb +17 -12
- metadata +99 -67
- data/.gitignore +0 -2
- data/VERSION +0 -1
- data/app/views/readers/_standard_parts.html.haml +0 -23
- data/spec/datasets/messages_dataset.rb +0 -49
- data/spec/datasets/reader_layouts_dataset.rb +0 -26
- data/spec/datasets/reader_sites_dataset.rb +0 -10
data/config/locales/en.yml
CHANGED
@@ -1,192 +1,232 @@
|
|
1
1
|
en:
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
2
|
+
activerecord:
|
3
|
+
attributes:
|
4
|
+
reader:
|
5
|
+
description: "Text for your profile page"
|
6
|
+
email: "Email address"
|
7
|
+
honorific: "Title or rank"
|
8
|
+
login: "Login username (optional)"
|
9
|
+
name: "Your name"
|
10
|
+
password: "Password"
|
11
|
+
password_confirmation: "Confirm password"
|
12
|
+
errors:
|
13
|
+
models:
|
14
|
+
reader:
|
15
|
+
attributes:
|
16
|
+
name:
|
17
|
+
blank: "please enter a name"
|
18
|
+
too_long: "this is too long: 100 characters max"
|
19
|
+
email:
|
20
|
+
blank: "please enter your email address"
|
21
|
+
invalid: "this doesn't look like an email address"
|
22
|
+
taken: "this address is already registered here"
|
23
|
+
taken_by_author: "this address belongs to an author here. You don't need to register here: just log in to admin."
|
24
|
+
login:
|
25
|
+
taken: "this login is already in use here"
|
26
|
+
password:
|
27
|
+
too_short: "this must have at least six characters"
|
28
|
+
invalid: "this must include at least one non-letter"
|
29
|
+
password_confirmation:
|
30
|
+
|
31
|
+
|
26
32
|
config:
|
27
33
|
reader:
|
28
34
|
allow_registration?: "Allow registration"
|
29
35
|
require_confirmation?: "Confirm email addresses"
|
30
36
|
use_honorifics?: "Use honorifics"
|
31
37
|
layout: "Layout for forms"
|
38
|
+
get_profile?: "As for profile text"
|
32
39
|
email:
|
33
40
|
name: "Message sender"
|
34
41
|
address: "Message reply-to"
|
35
42
|
prefix: "Subject prefix"
|
36
43
|
layout: "Email layout"
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
44
|
+
reader: "reader"
|
45
|
+
readers: "Readers"
|
46
|
+
groups: "Groups"
|
47
|
+
messages: "Messages"
|
48
|
+
settings: "Settings"
|
49
|
+
reader_extension:
|
50
|
+
access_denied: "Access denied"
|
51
|
+
account_settings: "Account settings"
|
52
|
+
account_updated: "Your account has been updated"
|
53
|
+
activate_account: "Activate your account"
|
54
|
+
activation_complete: "Thank you very much for persevering with the registration process. Your account is now active."
|
55
|
+
activation_message_sent: "Account activation instructions have been emailed to you."
|
56
|
+
activation_required: "Please check your email for an activation message"
|
57
|
+
activation_required_header: "Please check your email"
|
58
|
+
activation_required_explanation: "You should have received a confirmation message containing a link that will activate your account."
|
59
|
+
activation_sent: "Activation message sent"
|
60
|
+
affected_fields_highlighted: "The affected fields are highlighted below."
|
61
|
+
all_deliveries_failed: "All deliveries failed"
|
62
|
+
already_active: "Your account is already active."
|
63
|
+
already_logged_in: "You're already logged in!"
|
64
|
+
already_registered: "If you've already registered, you should only need to"
|
65
|
+
and_try_again: "and try again."
|
66
|
+
bold_required: "Fields with bold headings are required and will cause grumbling if left blank."
|
67
|
+
but_not_active: 'but your account is not yet activated. Please check your email for our activation message.'
|
68
|
+
cancel: "cancel"
|
69
|
+
cannot_delete_readers: "To delete readers, please log in as an administrator"
|
70
|
+
cannot_edit_others: "You are not allowed to edit other people's accounts."
|
71
|
+
change_gravatar: "change gravatar image"
|
72
|
+
change_password: "Change your password"
|
73
|
+
check_email: "Please check your email for an activation message"
|
74
|
+
confirm_new_password: "Confirm new password"
|
75
|
+
confirm_password: "Confirm password"
|
76
|
+
confirmation_code: "Confirmation code"
|
77
|
+
confirming_email: "When you press the 'register' button we will send a confirmation email to the address you enter above. Click on a link in that message, and you're in."
|
78
|
+
continue: "Continue"
|
79
|
+
create_message: "create message"
|
80
|
+
dont_fill: "Don't fill this in!"
|
81
|
+
edit_profile: "edit your profile"
|
82
|
+
email_unknown: "Sorry. That email address is not known here."
|
83
|
+
enter_code: "Please enter confirmation code"
|
84
|
+
enter_email_for_reminder: "enter your email address and we will send the message again"
|
85
|
+
everyone_in_group: "Everyone in the group"
|
86
|
+
forgotten_password: "Forgotten your password?"
|
87
|
+
form_notes:
|
88
|
+
description: "you can fill this in later. Textile formatting is allowed."
|
89
|
+
email: "we will send activation instructions to this address"
|
90
|
+
existing_password: "leave blank to keep present password. If changing, at least four characters."
|
91
|
+
login: "you can always use your email address instead"
|
92
|
+
name: "this is how you will be credited on the site"
|
93
|
+
new_password: "at least six characters, please, and with at least one non-letter character"
|
94
|
+
honorific: "this is prepended to your name when you are credited"
|
95
|
+
form_problem: "there was a problem with the form"
|
96
|
+
getting_gravatar: "If you would like a picture to appear next to your messages, give yourself a gravatar at"
|
97
|
+
hello: "hello"
|
98
|
+
honorific: "Title or rank"
|
99
|
+
invitation_message: "Invitation message"
|
100
|
+
invite_description: '<a href="%{url}">Edit your preferences to put some text about yourself here.'
|
101
|
+
if_cant_find: "If you can't find the message, we can"
|
102
|
+
if_mistake_see_admin: "If this is a mistake, please talk to the site administrator about your account."
|
103
|
+
if_not_you: "If that's not you, please"
|
104
|
+
is_free_and_quick: " is free and only takes a moment"
|
105
|
+
joined_on: "Joined on"
|
106
|
+
label:
|
107
|
+
reader:
|
108
|
+
name: "Your name"
|
109
|
+
honorific: "Title"
|
110
|
+
login: "Login username"
|
111
|
+
email: "Email address"
|
112
|
+
password: "Password"
|
113
|
+
repeat_password: "Confirm password"
|
114
|
+
current_password: "Current password"
|
115
|
+
log_in: 'log in'
|
116
|
+
log_in_or_register: "Please log in here. If you haven't already, you will need to <a href='/register'>register</a> first."
|
117
|
+
log_out: "log out"
|
118
|
+
login_name: "Login name"
|
119
|
+
login_or_email: "Login name or email address"
|
120
|
+
login_unknown: "Sorry: we don't recognise that combination of username and password."
|
121
|
+
logout_message: "You are logged out. Bye!"
|
122
|
+
message_delivered: "Message delivered"
|
123
|
+
must_be_empty: "must be empty"
|
124
|
+
navigation:
|
125
|
+
account: "Your account"
|
126
|
+
activate: "Activate account"
|
127
|
+
admin: "Admin"
|
128
|
+
greeting: "Hello %{name}"
|
129
|
+
readers: "Readers"
|
130
|
+
preferences: "Preferences"
|
131
|
+
profile: "Profile"
|
132
|
+
log_in: "Log in"
|
133
|
+
log_out: "Log out"
|
134
|
+
loading: "Loading..."
|
135
|
+
register: "Register"
|
136
|
+
your_account: "Preferences"
|
137
|
+
new_account: "Register here"
|
138
|
+
new_password: "New password"
|
139
|
+
new_password_instructions: "Please enter and confirm the new password you would like to use. It must be at least four characters long, nothing obvious or typical and ideally a mixture of numbers and letters."
|
140
|
+
'no': "no"
|
141
|
+
no_description: "No description available"
|
142
|
+
notes: "notes"
|
143
|
+
page_permission_denied: "You don't have permission to see the page that you have requested."
|
144
|
+
password: "Password"
|
145
|
+
password_incorrect: "Sorry. Wrong password."
|
146
|
+
password_mismatch: "Passwords don't match! Please try again."
|
147
|
+
password_not_yet_changed: "Your password hasn't changed yet, so if you've just remembered it please <a href='%{url}'>log in as usual</a>."
|
148
|
+
password_reset_instructions: "Please enter your email address below. If we recognise it, we'll send you a message with a confirmation link (or if your account is not yet active, we'll send the activation message again)."
|
149
|
+
password_reset_reassurance: "Your password will not change until you fill in that form, so only you can complete this process."
|
150
|
+
password_updated_notice: "Thank you. Your password has been updated and you are now logged in."
|
151
|
+
people: "people"
|
152
|
+
permission_denied: "Permission denied"
|
153
|
+
permitted_groups: "Permitted groups"
|
154
|
+
please: "please"
|
155
|
+
please_avoid_spam_trap: "Please don't fill in the spam trap field"
|
156
|
+
please_check_message: "Sorry: something was wrong in that link. Please check your email message and make sure it is giving you the whole address."
|
157
|
+
please_log_in: "Please log in"
|
158
|
+
please_log_out: "Please log out"
|
159
|
+
please_read_our: "Please read our"
|
160
|
+
please_register: "Please take a moment to register an account."
|
161
|
+
please_use_form: "Please use the registration form"
|
162
|
+
preferences_intro: "You can use this form to change your preferences and enter a bit more information about yourself."
|
163
|
+
reader_admin: "Reader administration"
|
164
|
+
reader_emails: "Administrative messages"
|
165
|
+
reader: 'Reader'
|
166
|
+
reader_logged_in_as: "You are logged in as %{name}."
|
167
|
+
reader_saved: "Reader saved"
|
168
|
+
readers: 'People'
|
169
|
+
readers_introduction: "This is a list of everyone who has joined the site. It's only visible to logged-in users."
|
170
|
+
register: "register"
|
171
|
+
registration: "registration"
|
172
|
+
registration_disallowed: "Sorry. This site does not allow visitors to register"
|
173
|
+
remember_me: "remember me"
|
174
|
+
resend_activation: "Resend activation message"
|
175
|
+
reset_message_instructions: "Thank you. A message has been sent containing the instructions for setting a new password. Remember it hasn't changed yet and won't until you follow the instructions in the message. If you remember your old password, you can just carry on using it and ignore the reset message."
|
176
|
+
reset_message_sent: "Password-reset instructions have been emailed to you"
|
177
|
+
reset_not_found: "Password-reset code not found"
|
178
|
+
sorry_reset_not_found: "Sorry: the system can't find you. That link must have been garbled somewhere along the line. Please paste the 20-character confirmation code into the box below and we'll try again."
|
179
|
+
reset_password: "Reset your password"
|
180
|
+
restart_password_change: "Send another password-reset message"
|
181
|
+
return_to_page: "return to the page you were looking at before you started registering"
|
182
|
+
send_it_again: "send it again"
|
183
|
+
send_reset_button: "send me instructions"
|
184
|
+
set_new_password: "set new password"
|
185
|
+
some_deliveries_failed: "Some deliveries failed"
|
186
|
+
sorry: "sorry"
|
187
|
+
sorry_access_denied: "Sorry: access denied"
|
188
|
+
spam_trap: "it's a spam trap and shouldn't be visible"
|
189
|
+
status_check: "Please wait: loading controls"
|
190
|
+
terms_and_conditions: "terms and conditions"
|
191
|
+
thanks_activated: "Thank you! Your account has been activated."
|
192
|
+
thanks_and_activation_instructions: "Thank you for registering. Now please check your email. We have sent a message containing a link that will automatically activate your account and log you in."
|
193
|
+
this_is_your_page: "This is the page that other (logged-in) site visitors will see when they click on your name."
|
194
|
+
username: "username"
|
195
|
+
welcome_back: "Welcome back"
|
196
|
+
welcome_message: "Welcome message"
|
197
|
+
wrong_email: "you think you might have put the wrong email address in,"
|
198
|
+
'yes': "yes"
|
199
|
+
your_description: "Some text for your profile page"
|
200
|
+
your_email: "Your email address"
|
201
|
+
your_name: "Your name"
|
202
|
+
count_people:
|
203
|
+
zero: "(nobody)"
|
204
|
+
one: "(one person)"
|
205
|
+
other: "(%{count} people)"
|
206
|
+
send_to: "Send to"
|
207
|
+
reader_configuration_page: "reader settings"
|
208
|
+
welcome_sent_automatically: "This message is sent automatically when someone completes the registration and email-confirmation process."
|
209
|
+
password_reset_sent_automatically: "This message is sent automatically when someone asks to reset their password."
|
210
|
+
activation_sent_automatically: "This message is sent automatically when someone begins to register."
|
211
|
+
invitation_sent_automatically: "This message is sent automatically when someone is invited to the site."
|
212
|
+
everyone_unsent: "anyone who has not received this message"
|
213
|
+
everyone_inactive: "anyone who has not activated their account"
|
214
|
+
everyone: "Everyone"
|
215
|
+
send_message: "Send Message"
|
216
|
+
edit_message: "edit message"
|
217
|
+
delete_message: "delete message"
|
218
|
+
this_message_functional: "This is the %{function} message."
|
219
|
+
preview_and_send_message: "Preview and send message"
|
220
|
+
really_delete_message: "Are you sure you want to delete the message '%{title}'? This cannot be undone."
|
221
|
+
delete_reader: "delete reader"
|
222
|
+
really_delete_reader: "Are you sure you want to remove the reader %{name}? This cannot be undone."
|
223
|
+
never_sent: 'never sent'
|
224
|
+
for: 'for'
|
225
|
+
home: 'home'
|
226
|
+
reader_required: "Sorry: this part of the site requires an account."
|
227
|
+
update_account: "Save changes"
|
228
|
+
create_account: "Register"
|
229
|
+
separator: " » "
|
155
230
|
time:
|
156
231
|
formats:
|
157
232
|
date: "%B %e, %Y"
|
158
|
-
username: "username"
|
159
|
-
welcome_back: "Welcome back"
|
160
|
-
welcome_message: "Welcome message"
|
161
|
-
wrong_email: "you think you might have put the wrong email address in,"
|
162
|
-
'yes': "yes"
|
163
|
-
your_description: "A little about yourself"
|
164
|
-
your_email: "Your email address"
|
165
|
-
your_name: "Your name"
|
166
|
-
count_people:
|
167
|
-
zero: "(nobody)"
|
168
|
-
one: "(one person)"
|
169
|
-
other: "(%{count} people)"
|
170
|
-
send_to: "Send to"
|
171
|
-
reader_configuration_page: "reader settings"
|
172
|
-
welcome_sent_automatically: "This message is sent automatically when someone completes the registration and email-confirmation process."
|
173
|
-
password_reset_sent_automatically: "This message is sent automatically when someone asks to reset their password."
|
174
|
-
activation_sent_automatically: "This message is sent automatically when someone begins to register."
|
175
|
-
invitation_sent_automatically: "This message is sent automatically when someone is invited to the site."
|
176
|
-
everyone_unsent: "anyone who has not received this message"
|
177
|
-
everyone_inactive: "anyone who has not activated their account"
|
178
|
-
everyone: "Everyone"
|
179
|
-
send_message: "Send Message"
|
180
|
-
edit_message: "edit message"
|
181
|
-
delete_message: "delete message"
|
182
|
-
this_message_functional: "This is the %{function} message."
|
183
|
-
preview_and_send_message: "Preview and send message"
|
184
|
-
really_delete_message: "Are you sure you want to delete the message '%{title}'? This cannot be undone."
|
185
|
-
delete_reader: "delete reader"
|
186
|
-
really_delete_reader: "Are you sure you want to remove the reader %{name}? This cannot be undone."
|
187
|
-
never_sent: 'never sent'
|
188
|
-
for: 'for'
|
189
|
-
home: 'home'
|
190
|
-
reader_required: "Sorry: this part of the site requires an account."
|
191
|
-
update_account: "Save changes"
|
192
|
-
create_account: "Register"
|
data/config/routes.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
ActionController::Routing::Routes.draw do |map|
|
2
2
|
map.namespace :admin, :path_prefix => 'admin/readers' do |admin|
|
3
3
|
admin.resources :messages, :member => [:preview, :deliver]
|
4
|
+
admin.resources :groups, :has_many => [:memberships, :permissions, :group_invitations, :messages]
|
4
5
|
admin.resource :reader_configuration, :controller => 'reader_configuration'
|
5
6
|
end
|
6
7
|
|
@@ -10,6 +11,10 @@ ActionController::Routing::Routes.draw do |map|
|
|
10
11
|
|
11
12
|
map.resources :readers
|
12
13
|
map.resources :messages, :only => [:index, :show], :member => [:preview]
|
14
|
+
map.resources :groups, :only => [] do |group|
|
15
|
+
group.resources :messages, :only => [:index, :show], :member => [:preview]
|
16
|
+
end
|
17
|
+
|
13
18
|
map.resource :reader_session
|
14
19
|
map.resource :reader_activation, :only => [:show, :new]
|
15
20
|
map.resource :password_reset
|
@@ -0,0 +1,35 @@
|
|
1
|
+
class GroupMessages < ActiveRecord::Migration
|
2
|
+
create_table :groups do |t|
|
3
|
+
t.column :name, :string
|
4
|
+
t.column :description, :text
|
5
|
+
t.column :notes, :text
|
6
|
+
t.column :created_at, :datetime
|
7
|
+
t.column :updated_at, :datetime
|
8
|
+
t.column :created_by_id, :integer
|
9
|
+
t.column :updated_by_id, :integer
|
10
|
+
t.column :homepage_id, :integer
|
11
|
+
t.column :site_id, :integer
|
12
|
+
t.column :lock_version, :integer
|
13
|
+
end
|
14
|
+
|
15
|
+
create_table :memberships do |t|
|
16
|
+
t.column :group_id, :integer
|
17
|
+
t.column :reader_id, :integer
|
18
|
+
end
|
19
|
+
|
20
|
+
create_table :permissions do |t|
|
21
|
+
t.column :group_id, :integer
|
22
|
+
t.column :page_id, :integer
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.up
|
26
|
+
add_column :messages, :group_id, :integer
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.down
|
30
|
+
drop_table :groups
|
31
|
+
drop_table :memberships
|
32
|
+
drop_table :permissions
|
33
|
+
remove_column :messages, :group_id
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class MultipleOwnership < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
rename_column :permissions, :page_id, :permitted_id
|
4
|
+
add_column :permissions, :permitted_type, :string
|
5
|
+
Permission.reset_column_information
|
6
|
+
Permission.all.each {|p| p.update_attributes(:permitted_type => 'Page') }
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.down
|
10
|
+
rename_column :permissions, :permitted_id, :page_id
|
11
|
+
remove_column :permissions, :permitted_type
|
12
|
+
end
|
13
|
+
end
|
@@ -35,7 +35,7 @@ module ControllerExtensions # for inclusion into ApplicationController
|
|
35
35
|
|
36
36
|
def set_reader_for_user
|
37
37
|
if current_user
|
38
|
-
current_reader_session = ReaderSession.create!(Reader.
|
38
|
+
current_reader_session = ReaderSession.create!(Reader.for_user(current_user))
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
data/lib/group_tags.rb
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
module GroupTags
|
2
|
+
include Radiant::Taggable
|
3
|
+
include ReaderHelper
|
4
|
+
|
5
|
+
class TagError < StandardError; end
|
6
|
+
desc %{
|
7
|
+
The root 'group' tag is not meant to be called directly.
|
8
|
+
All it does is summon a group object so that its fields can be displayed with eg.
|
9
|
+
<pre><code><r:group:name /></code></pre>
|
10
|
+
|
11
|
+
This tag will not throw an exception if there is no group; it will just disappear.
|
12
|
+
}
|
13
|
+
tag 'group' do |tag|
|
14
|
+
tag.locals.group = @mailer_vars ? @mailer_vars[:@group] : tag.locals.page.group
|
15
|
+
tag.expand if tag.locals.group
|
16
|
+
end
|
17
|
+
|
18
|
+
[:name, :description, :url].each do |field|
|
19
|
+
desc %{
|
20
|
+
Displays the #{field} field of the currently relevant group. Works in email messages too.
|
21
|
+
|
22
|
+
<pre><code><r:group:#{field} /></code></pre>
|
23
|
+
}
|
24
|
+
tag "group:#{field}" do |tag|
|
25
|
+
tag.locals.group.send(field)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
desc %{
|
30
|
+
Expands if this group has messages.
|
31
|
+
|
32
|
+
<pre><code><r:group:if_messages>...</r:group:if_messages /></code></pre>
|
33
|
+
}
|
34
|
+
tag "group:if_messages" do |tag|
|
35
|
+
tag.expand if tag.locals.group.messages.ordinary.published.any?
|
36
|
+
end
|
37
|
+
|
38
|
+
desc %{
|
39
|
+
Expands if this group does not have messages.
|
40
|
+
|
41
|
+
<pre><code><r:group:unless_messages>...</r:group:unless_messages /></code></pre>
|
42
|
+
}
|
43
|
+
tag "group:unless_messages" do |tag|
|
44
|
+
tag.expand unless tag.locals.group.messages.ordinary.published.any?
|
45
|
+
end
|
46
|
+
|
47
|
+
desc %{
|
48
|
+
Loops through the non-functional messages (ie not welcomes and reminders) that belong to this group
|
49
|
+
and that have been sent, though not necessarily to the present reader (which is the point, really).
|
50
|
+
|
51
|
+
<pre><code><r:group:messages:each>...</r:group:messages:each /></code></pre>
|
52
|
+
}
|
53
|
+
tag "group:messages" do |tag|
|
54
|
+
tag.locals.messages = tag.locals.group.messages.ordinary.published
|
55
|
+
tag.expand
|
56
|
+
end
|
57
|
+
tag "group:messages:each" do |tag|
|
58
|
+
result = []
|
59
|
+
tag.locals.messages.each do |message|
|
60
|
+
tag.locals.message = message
|
61
|
+
result << tag.expand
|
62
|
+
end
|
63
|
+
result
|
64
|
+
end
|
65
|
+
end
|