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
metadata
CHANGED
@@ -1,109 +1,103 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radiant-reader-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 15424093
|
5
|
+
prerelease: 6
|
6
6
|
segments:
|
7
|
-
-
|
8
|
-
-
|
9
|
-
-
|
10
|
-
|
7
|
+
- 2
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
- rc
|
11
|
+
- 4
|
12
|
+
version: 2.0.0.rc4
|
11
13
|
platform: ruby
|
12
14
|
authors:
|
13
|
-
-
|
15
|
+
- William Ross
|
14
16
|
autorequire:
|
15
17
|
bindir: bin
|
16
18
|
cert_chain: []
|
17
19
|
|
18
|
-
date: 2011-
|
19
|
-
default_executable:
|
20
|
+
date: 2011-07-05 00:00:00 Z
|
20
21
|
dependencies:
|
21
22
|
- !ruby/object:Gem::Dependency
|
22
|
-
name: radiant
|
23
|
+
name: radiant-layouts-extension
|
23
24
|
prerelease: false
|
24
25
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
26
|
none: false
|
26
27
|
requirements:
|
27
|
-
- -
|
28
|
+
- - ~>
|
28
29
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
30
|
+
hash: 57
|
30
31
|
segments:
|
31
32
|
- 0
|
32
33
|
- 9
|
33
|
-
-
|
34
|
-
version: 0.9.
|
34
|
+
- 1
|
35
|
+
version: 0.9.1
|
35
36
|
type: :runtime
|
36
37
|
version_requirements: *id001
|
37
38
|
- !ruby/object:Gem::Dependency
|
38
|
-
name: radiant-
|
39
|
+
name: radiant-mailer_layouts-extension
|
39
40
|
prerelease: false
|
40
41
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
42
|
none: false
|
42
43
|
requirements:
|
43
|
-
- -
|
44
|
+
- - ~>
|
44
45
|
- !ruby/object:Gem::Version
|
45
|
-
hash:
|
46
|
+
hash: 25
|
46
47
|
segments:
|
47
48
|
- 0
|
48
|
-
|
49
|
+
- 1
|
50
|
+
- 1
|
51
|
+
version: 0.1.1
|
49
52
|
type: :runtime
|
50
53
|
version_requirements: *id002
|
51
54
|
- !ruby/object:Gem::Dependency
|
52
|
-
name:
|
55
|
+
name: authlogic
|
53
56
|
prerelease: false
|
54
57
|
requirement: &id003 !ruby/object:Gem::Requirement
|
55
58
|
none: false
|
56
59
|
requirements:
|
57
|
-
- -
|
60
|
+
- - ~>
|
58
61
|
- !ruby/object:Gem::Version
|
59
|
-
hash:
|
62
|
+
hash: 7
|
60
63
|
segments:
|
61
|
-
-
|
62
|
-
|
64
|
+
- 2
|
65
|
+
- 1
|
66
|
+
- 6
|
67
|
+
version: 2.1.6
|
63
68
|
type: :runtime
|
64
69
|
version_requirements: *id003
|
65
70
|
- !ruby/object:Gem::Dependency
|
66
|
-
name:
|
71
|
+
name: sanitize
|
67
72
|
prerelease: false
|
68
73
|
requirement: &id004 !ruby/object:Gem::Requirement
|
69
74
|
none: false
|
70
75
|
requirements:
|
71
|
-
- -
|
76
|
+
- - ~>
|
72
77
|
- !ruby/object:Gem::Version
|
73
|
-
hash:
|
78
|
+
hash: 13
|
74
79
|
segments:
|
80
|
+
- 2
|
75
81
|
- 0
|
76
|
-
|
82
|
+
- 1
|
83
|
+
version: 2.0.1
|
77
84
|
type: :runtime
|
78
85
|
version_requirements: *id004
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
requirement: &id005 !ruby/object:Gem::Requirement
|
83
|
-
none: false
|
84
|
-
requirements:
|
85
|
-
- - ">="
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
hash: 3
|
88
|
-
segments:
|
89
|
-
- 0
|
90
|
-
version: "0"
|
91
|
-
type: :runtime
|
92
|
-
version_requirements: *id005
|
93
|
-
description: Centralises reader/member/user registration and management tasks for the benefit of other extensions
|
94
|
-
email: will@spanner.org
|
86
|
+
description: Provides reader/member/user registration and management functions including password-reminder, group-based page access control and administrative email.
|
87
|
+
email:
|
88
|
+
- radiant@spanner.org
|
95
89
|
executables: []
|
96
90
|
|
97
91
|
extensions: []
|
98
92
|
|
99
|
-
extra_rdoc_files:
|
100
|
-
|
93
|
+
extra_rdoc_files: []
|
94
|
+
|
101
95
|
files:
|
102
|
-
- .
|
103
|
-
-
|
104
|
-
-
|
105
|
-
- VERSION
|
96
|
+
- app/controllers/admin/group_invitations_controller.rb
|
97
|
+
- app/controllers/admin/groups_controller.rb
|
98
|
+
- app/controllers/admin/memberships_controller.rb
|
106
99
|
- app/controllers/admin/messages_controller.rb
|
100
|
+
- app/controllers/admin/permissions_controller.rb
|
107
101
|
- app/controllers/admin/reader_configuration_controller.rb
|
108
102
|
- app/controllers/admin/readers_controller.rb
|
109
103
|
- app/controllers/messages_controller.rb
|
@@ -113,26 +107,47 @@ files:
|
|
113
107
|
- app/controllers/reader_sessions_controller.rb
|
114
108
|
- app/controllers/readers_controller.rb
|
115
109
|
- app/helpers/reader_helper.rb
|
110
|
+
- app/models/group.rb
|
111
|
+
- app/models/membership.rb
|
116
112
|
- app/models/message.rb
|
117
113
|
- app/models/message_function.rb
|
118
114
|
- app/models/message_reader.rb
|
115
|
+
- app/models/permission.rb
|
119
116
|
- app/models/reader.rb
|
120
117
|
- app/models/reader_notifier.rb
|
121
118
|
- app/models/reader_session.rb
|
119
|
+
- app/views/admin/group_invitations/new.html.haml
|
120
|
+
- app/views/admin/group_invitations/preview.html.haml
|
121
|
+
- app/views/admin/groups/_add_readers.html.haml
|
122
|
+
- app/views/admin/groups/_form.html.haml
|
123
|
+
- app/views/admin/groups/_list_head.html.haml
|
124
|
+
- app/views/admin/groups/edit.html.haml
|
125
|
+
- app/views/admin/groups/index.html.haml
|
126
|
+
- app/views/admin/groups/new.html.haml
|
127
|
+
- app/views/admin/groups/remove.html.haml
|
128
|
+
- app/views/admin/groups/show.html.haml
|
129
|
+
- app/views/admin/memberships/_reader.html.haml
|
122
130
|
- app/views/admin/messages/_form.html.haml
|
131
|
+
- app/views/admin/messages/_function.haml
|
123
132
|
- app/views/admin/messages/_help.html.haml
|
124
133
|
- app/views/admin/messages/_list_function.haml
|
134
|
+
- app/views/admin/messages/_list_notes.html.haml
|
125
135
|
- app/views/admin/messages/_message_description.html.haml
|
136
|
+
- app/views/admin/messages/_message_group.html.haml
|
126
137
|
- app/views/admin/messages/edit.html.haml
|
127
138
|
- app/views/admin/messages/index.haml
|
128
139
|
- app/views/admin/messages/new.html.haml
|
129
140
|
- app/views/admin/messages/preview.html.haml
|
130
141
|
- app/views/admin/messages/show.html.haml
|
142
|
+
- app/views/admin/pages/_listed.html.haml
|
143
|
+
- app/views/admin/pages/_page_groups.html.haml
|
144
|
+
- app/views/admin/permissions/_page.html.haml
|
131
145
|
- app/views/admin/reader_configuration/edit.html.haml
|
132
146
|
- app/views/admin/reader_configuration/show.html.haml
|
133
147
|
- app/views/admin/readers/_avatar.html.haml
|
134
148
|
- app/views/admin/readers/_form.html.haml
|
135
149
|
- app/views/admin/readers/_password_fields.html.haml
|
150
|
+
- app/views/admin/readers/_reader_groups.html.haml
|
136
151
|
- app/views/admin/readers/edit.html.haml
|
137
152
|
- app/views/admin/readers/index.html.haml
|
138
153
|
- app/views/admin/readers/new.html.haml
|
@@ -153,13 +168,16 @@ files:
|
|
153
168
|
- app/views/readers/_extra_controls.html.haml
|
154
169
|
- app/views/readers/_flasher.html.haml
|
155
170
|
- app/views/readers/_form.html.haml
|
156
|
-
- app/views/readers/
|
171
|
+
- app/views/readers/_memberships.html.haml
|
157
172
|
- app/views/readers/edit.html.haml
|
158
173
|
- app/views/readers/index.html.haml
|
159
174
|
- app/views/readers/login.html.haml
|
160
175
|
- app/views/readers/new.html.haml
|
161
176
|
- app/views/readers/permission_denied.html.haml
|
162
177
|
- app/views/readers/show.html.haml
|
178
|
+
- app/views/shared/_standard_reader_parts.html.haml
|
179
|
+
- app/views/site/not_allowed.html.haml
|
180
|
+
- config/initializers/authlogic_connect_config.rb
|
163
181
|
- config/initializers/radiant_config.rb
|
164
182
|
- config/locales/en.yml
|
165
183
|
- config/routes.rb
|
@@ -170,6 +188,7 @@ files:
|
|
170
188
|
- db/migrate/005_last_login.rb
|
171
189
|
- db/migrate/007_adapt_for_authlogic.rb
|
172
190
|
- db/migrate/20090921125653_reader_messages.rb
|
191
|
+
- db/migrate/20090921125654_group_messages.rb
|
173
192
|
- db/migrate/20090924164413_functional_messages.rb
|
174
193
|
- db/migrate/20090925081225_standard_messages.rb
|
175
194
|
- db/migrate/20091006102438_message_visibility.rb
|
@@ -179,14 +198,23 @@ files:
|
|
179
198
|
- db/migrate/20091020135152_contacts.rb
|
180
199
|
- db/migrate/20091111090819_ensure_functional_messages_visible.rb
|
181
200
|
- db/migrate/20091119092936_messages_have_layout.rb
|
201
|
+
- db/migrate/20091120083119_groups_public.rb
|
182
202
|
- db/migrate/20100922152338_lock_versions.rb
|
183
203
|
- db/migrate/20101004074945_unlock_version.rb
|
184
204
|
- db/migrate/20101019094714_message_sent_date.rb
|
205
|
+
- db/migrate/20110214101339_multiple_ownership.rb
|
185
206
|
- lib/controller_extensions.rb
|
207
|
+
- lib/group_tags.rb
|
208
|
+
- lib/grouped_model.rb
|
209
|
+
- lib/grouped_page.rb
|
210
|
+
- lib/message_tags.rb
|
211
|
+
- lib/radiant-reader-extension.rb
|
186
212
|
- lib/reader_admin_ui.rb
|
187
213
|
- lib/reader_site.rb
|
188
214
|
- lib/reader_tags.rb
|
189
215
|
- lib/rfc822.rb
|
216
|
+
- lib/sanitize/config/generous.rb
|
217
|
+
- lib/site_controller_extensions.rb
|
190
218
|
- lib/tasks/reader_extension_tasks.rake
|
191
219
|
- public/images/admin/chk_off.png
|
192
220
|
- public/images/admin/chk_on.png
|
@@ -196,31 +224,32 @@ files:
|
|
196
224
|
- public/stylesheets/sass/admin/reader.sass
|
197
225
|
- public/stylesheets/sass/reader.sass
|
198
226
|
- radiant-reader-extension.gemspec
|
227
|
+
- Rakefile
|
199
228
|
- reader_extension.rb
|
229
|
+
- README.md
|
200
230
|
- spec/controllers/admin/messages_controller_spec.rb
|
201
231
|
- spec/controllers/admin/readers_controller_spec.rb
|
202
232
|
- spec/controllers/password_resets_controller_spec.rb
|
203
233
|
- spec/controllers/reader_activations_controller_spec.rb
|
204
234
|
- spec/controllers/readers_controller_spec.rb
|
205
|
-
- spec/
|
206
|
-
- spec/datasets/reader_layouts_dataset.rb
|
207
|
-
- spec/datasets/reader_sites_dataset.rb
|
235
|
+
- spec/controllers/site_controller_spec.rb
|
208
236
|
- spec/datasets/readers_dataset.rb
|
209
237
|
- spec/lib/reader_admin_ui_spec.rb
|
210
238
|
- spec/lib/reader_site_spec.rb
|
211
239
|
- spec/matchers/reader_login_system_matcher.rb
|
240
|
+
- spec/models/group_spec.rb
|
212
241
|
- spec/models/message_spec.rb
|
242
|
+
- spec/models/page_spec.rb
|
213
243
|
- spec/models/reader_notifier_spec.rb
|
214
244
|
- spec/models/reader_spec.rb
|
215
245
|
- spec/spec.opts
|
216
246
|
- spec/spec_helper.rb
|
217
|
-
|
218
|
-
homepage: http://github.com/spanner/radiant-reader-extension
|
247
|
+
homepage: http://radiant.spanner.org/reader
|
219
248
|
licenses: []
|
220
249
|
|
221
|
-
post_install_message:
|
222
|
-
rdoc_options:
|
223
|
-
|
250
|
+
post_install_message: "\n Add this to your radiant project with:\n\n config.gem 'radiant-reader-extension', :version => '~> 2.0.0.rc4'\n\n and please remember to enable ActionMailer in your project's config/environment.rb.\n "
|
251
|
+
rdoc_options: []
|
252
|
+
|
224
253
|
require_paths:
|
225
254
|
- lib
|
226
255
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -235,33 +264,36 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
235
264
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
236
265
|
none: false
|
237
266
|
requirements:
|
238
|
-
- - "
|
267
|
+
- - ">"
|
239
268
|
- !ruby/object:Gem::Version
|
240
|
-
hash:
|
269
|
+
hash: 25
|
241
270
|
segments:
|
242
|
-
-
|
243
|
-
|
271
|
+
- 1
|
272
|
+
- 3
|
273
|
+
- 1
|
274
|
+
version: 1.3.1
|
244
275
|
requirements: []
|
245
276
|
|
246
277
|
rubyforge_project:
|
247
|
-
rubygems_version: 1.
|
278
|
+
rubygems_version: 1.7.2
|
248
279
|
signing_key:
|
249
280
|
specification_version: 3
|
250
|
-
summary:
|
281
|
+
summary: Reader/viewer/visitor registration, login and access-control for Radiant CMS
|
251
282
|
test_files:
|
252
283
|
- spec/controllers/admin/messages_controller_spec.rb
|
253
284
|
- spec/controllers/admin/readers_controller_spec.rb
|
254
285
|
- spec/controllers/password_resets_controller_spec.rb
|
255
286
|
- spec/controllers/reader_activations_controller_spec.rb
|
256
287
|
- spec/controllers/readers_controller_spec.rb
|
257
|
-
- spec/
|
258
|
-
- spec/datasets/reader_layouts_dataset.rb
|
259
|
-
- spec/datasets/reader_sites_dataset.rb
|
288
|
+
- spec/controllers/site_controller_spec.rb
|
260
289
|
- spec/datasets/readers_dataset.rb
|
261
290
|
- spec/lib/reader_admin_ui_spec.rb
|
262
291
|
- spec/lib/reader_site_spec.rb
|
263
292
|
- spec/matchers/reader_login_system_matcher.rb
|
293
|
+
- spec/models/group_spec.rb
|
264
294
|
- spec/models/message_spec.rb
|
295
|
+
- spec/models/page_spec.rb
|
265
296
|
- spec/models/reader_notifier_spec.rb
|
266
297
|
- spec/models/reader_spec.rb
|
298
|
+
- spec/spec.opts
|
267
299
|
- spec/spec_helper.rb
|
data/.gitignore
DELETED
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.3.13
|
@@ -1,23 +0,0 @@
|
|
1
|
-
- content_for :reader_css do
|
2
|
-
%link{:rel => 'stylesheet', :type => 'text/css', :href => '/stylesheets/reader.css', :media => 'all'}
|
3
|
-
|
4
|
-
- content_for :reader_js do
|
5
|
-
%script{:src => '/javascripts/reader.js', :type => 'text/javascript'}
|
6
|
-
|
7
|
-
- content_for :reader_css do
|
8
|
-
- reader_css_paths.each do |path|
|
9
|
-
%link{:rel => 'stylesheet', :href => path, :type => 'text/css'}
|
10
|
-
|
11
|
-
- content_for :reader_js do
|
12
|
-
- reader_js_paths.each do |path|
|
13
|
-
%script{:src => path, :type => 'text/javascript'}
|
14
|
-
|
15
|
-
- content_for :person do
|
16
|
-
- if @reader && !@reader.new_record?
|
17
|
-
= standard_gravatar_for(@reader)
|
18
|
-
|
19
|
-
- content_for :section_navigation do
|
20
|
-
= link_to t('navigation.readers'), readers_url, :class => 'section'
|
21
|
-
= link_to t('navigation.loading'), reader_session_url, :class => "remotecontent"
|
22
|
-
- if Radiant::Config['reader.help_url']
|
23
|
-
= link_to t('navigation.reader_help'), Radiant::Config['reader.help_url']
|
@@ -1,49 +0,0 @@
|
|
1
|
-
class MessagesDataset < Dataset::Base
|
2
|
-
datasets = [:readers, :users]
|
3
|
-
datasets << :reader_sites if defined? Site
|
4
|
-
uses *datasets
|
5
|
-
|
6
|
-
def load
|
7
|
-
create_message "Normal"
|
8
|
-
create_message "Filtered", :filter_id => 'Textile', :body => 'this is a *filtered* message'
|
9
|
-
create_message "Welcome", :filter_id => 'Textile', :body => 'Hi', :function_id => 'welcome'
|
10
|
-
create_message "Activation", :filter_id => 'Textile', :body => 'Hi?', :function_id => 'activation'
|
11
|
-
create_message "Invitation", :filter_id => 'Textile', :body => 'Hi!', :function_id => 'invitation'
|
12
|
-
create_message "Password", :filter_id => 'Textile', :body => 'Oh', :function_id => 'password_reset'
|
13
|
-
create_message "Taggy", :filter_id => 'Textile', :body => %{
|
14
|
-
To <r:recipient:name />
|
15
|
-
|
16
|
-
Ying Tong Iddle I Po.
|
17
|
-
|
18
|
-
From <r:sender:name />
|
19
|
-
}
|
20
|
-
end
|
21
|
-
|
22
|
-
helpers do
|
23
|
-
def create_message(subject, attributes={})
|
24
|
-
attributes = message_attributes(attributes.update(:subject => subject))
|
25
|
-
message = create_model Message, subject.symbolize, attributes
|
26
|
-
message.update_attribute(:created_by, users(:existing))
|
27
|
-
end
|
28
|
-
|
29
|
-
def message_attributes(attributes={})
|
30
|
-
subject = attributes[:subject] || "Message"
|
31
|
-
symbol = subject.symbolize
|
32
|
-
attributes = {
|
33
|
-
:subject => subject,
|
34
|
-
:body => "This is the #{subject} message"
|
35
|
-
}.merge(attributes)
|
36
|
-
attributes[:site] = sites(:test) if defined? Site
|
37
|
-
attributes
|
38
|
-
end
|
39
|
-
|
40
|
-
def seem_to_send(message, reader)
|
41
|
-
message = messages(message) unless message.is_a?(Message)
|
42
|
-
reader = readers(reader) unless reader.is_a?(Reader)
|
43
|
-
sending = MessageReader.find_or_create_by_message_id_and_reader_id(message.id, reader.id)
|
44
|
-
sending.sent_at = 10.minutes.ago
|
45
|
-
sending.save
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
class ReaderLayoutsDataset < Dataset::Base
|
2
|
-
uses :reader_sites if defined? Site
|
3
|
-
|
4
|
-
def load
|
5
|
-
create_layout "Main"
|
6
|
-
create_layout "Other"
|
7
|
-
create_layout "email", :content => %{
|
8
|
-
<html>
|
9
|
-
<head><title><r:title /></title></head>
|
10
|
-
<body>
|
11
|
-
<p>header</p>
|
12
|
-
<r:content />
|
13
|
-
<p>footer</p>
|
14
|
-
</body>
|
15
|
-
<html>
|
16
|
-
}
|
17
|
-
end
|
18
|
-
|
19
|
-
helpers do
|
20
|
-
def create_layout(name, attributes={})
|
21
|
-
attributes[:site] ||= sites(:test) if Layout.reflect_on_association(:site)
|
22
|
-
create_model :layout, name.symbolize, attributes.update(:name => name)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
end
|
@@ -1,10 +0,0 @@
|
|
1
|
-
class ReaderSitesDataset < Dataset::Base
|
2
|
-
uses :home_page
|
3
|
-
|
4
|
-
def load
|
5
|
-
create_record Site, :mysite, :name => 'My Site', :domain => 'mysite.domain.com', :base_domain => 'mysite.domain.com', :position => 1, :homepage_id => page_id(:home)
|
6
|
-
create_record Site, :yoursite, :name => 'Your Site', :domain => '^yoursite', :base_domain => 'yoursite.test.com', :position => 2
|
7
|
-
create_record Site, :test, :name => 'Test host', :domain => '^test\.', :base_domain => 'test.host', :position => 6
|
8
|
-
Page.current_site = sites(:test) if defined? Site
|
9
|
-
end
|
10
|
-
end
|