comparison src/nabble/view/naml/subscribe.naml @ 0:7ecd1a4ef557

add content
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 21 Mar 2019 19:15:52 -0600
parents
children 72765b66e2c3
comparison
equal deleted inserted replaced
-1:000000000000 0:7ecd1a4ef557
1 <macro name="subscribe" requires="servlet">
2 <n.node_page.>
3 <n.html>
4 <head>
5 <meta name="robots" content="noindex,nofollow"/>
6 <n.title.><t>Subscribe via email</t></n.title.>
7 <n.main_title_css/>
8 </head>
9 <body>
10 <n.if.visitor.is_anonymous>
11 <then>
12 <n.edit_header first_text="[n.page_node.subject/]" second_text="[t]Email Subscription[/t]" />
13 <n.if.is_submitted_form>
14 <then>
15 <n.if.equal value1="send-anonymous" value2="[n.action_parameter/]">
16 <then>
17 <n.catch_exception. id="send-email-block">
18 <n.handle_anonymous_subscription/>
19 </n.catch_exception.>
20 </then>
21 </n.if.equal>
22 <n.if.has_exception for="send-email-block">
23 <then.show_subscription_error/>
24 <else.show_success_message/>
25 </n.if.has_exception>
26 </then>
27 </n.if.is_submitted_form>
28 <n.anonymous_subscription_form/>
29 </then>
30 <else>
31 <n.visitor.profile_header/>
32
33 <n.if.is_submitted_form>
34 <then.save_field_values/>
35 <else.load_field_values/>
36 </n.if.is_submitted_form>
37
38 <n.subscription_form/>
39 </else>
40 </n.if.visitor.is_anonymous>
41 </body>
42 </n.html>
43 </n.node_page.>
44 </macro>
45
46 <macro name="save_field_values">
47 <n.if.equal value1="save-subscription" value2="[n.action_parameter/]">
48 <then>
49 <n.page_node.visitor_subscription.save
50 to="[n.subscription_to_field.value/]"
51 type="[n.subscription_type_field.value/]"
52 />
53 <n.redirect_to.subscription_saved_url/>
54 </then>
55 </n.if.equal>
56 </macro>
57
58 <macro name="load_field_values">
59 <n.subscription_to_field.set_value.>
60 <n.if.page_node.visitor_is_subscribed>
61 <then.page_node.visitor_subscription.to/>
62 <else>DESCENDANTS</else>
63 </n.if.page_node.visitor_is_subscribed>
64 </n.subscription_to_field.set_value.>
65
66 <n.subscription_type_field.set_value.>
67 <n.if.page_node.visitor_is_subscribed>
68 <then.page_node.visitor_subscription.type/>
69 <else>INSTANT</else>
70 </n.if.page_node.visitor_is_subscribed>
71 </n.subscription_type_field.set_value.>
72 </macro>
73
74 <macro name="subscription_form" requires="node_page">
75 <div class="shaded-bg-color rounded second-font main-title">
76 <n.if.page_node.visitor_is_subscribed>
77 <then><t>Edit Subscription</t></then>
78 <else><t>Confirm Subscription</t></else>
79 </n.if.page_node.visitor_is_subscribed>
80 </div>
81 <n.form.>
82 <input type="hidden" name="action" value="save-subscription"/>
83
84 <n.if.page_node.is_app>
85 <then.app_subscription_controls/>
86 <else.post_subscription_controls/>
87 </n.if.page_node.is_app>
88
89 <n.show_mailing_list_alert/>
90
91 <br/>
92 <input type="submit" class="toolbar action-button" value="[t]Save Subscription[/t]"/>
93
94 <n.if.page_node.visitor_is_subscribed>
95 <then>
96 <input type="button" class="toolbar action-button" value="[t]Unsubscribe[/t]" onclick="window.location='[n.page_node.unsubscribe_path/]'"/>
97 </then>
98 </n.if.page_node.visitor_is_subscribed>
99
100 <t>or</t> <a href="javascript:history.back()"><t>Cancel</t></a>
101 </n.form.>
102 </macro>
103
104 <macro name="app_subscription_controls">
105 <table style="margin:.2em 0 .5em">
106 <tr>
107 <td><img src="[n.page_node.image_icon/]" class="image16"/></td>
108 <td class="weak-color" style="font-weight:bold">
109 <n.page_node.subject/>
110 </td>
111 </tr>
112 </table>
113 <div style="margin:.5em 1em .2em">
114 <n.subscription_to_field.radio id="all" option_value="DESCENDANTS"/>
115 <label for="all">
116 <n.if.page_node.is_app>
117 <then><t>Receive every message posted in <t.location><n.italic.page_node.subject/></t.location>.</t></then>
118 <else><t>Receive every reply under this topic.</t></else>
119 </n.if.page_node.is_app>
120 </label>
121 </div>
122 <div style="margin:0 1em .2em">
123 <n.subscription_to_field.radio id="direct" option_value="CHILDREN"/>
124 <label for="direct">
125 <n.if.page_node.is_app>
126 <then><t>Receive new topics only.</t></then>
127 <else><t>Receive direct replies only.</t></else>
128 </n.if.page_node.is_app>
129 </label>
130 </div>
131 <div style="margin:1em 0;font-weight:bold">
132 <t>Subscription Format</t>
133 </div>
134 <div style="margin:.5em 1em .2em">
135 <n.subscription_type_field.radio id="individual" option_value="INSTANT"/>
136 <label for="individual"><t>Individual emails</t> <span class="weak-color"><t>(you can reply by email)</t></span></label>
137 </div>
138 <div style="margin:0 1em .2em">
139 <n.subscription_type_field.radio id="daily" option_value="DAILY_DIGEST"/>
140 <label for="daily"><t>Daily digest</t></label>
141 </div>
142 </macro>
143
144 <macro name="post_subscription_controls" requires="node_page">
145 <n.subscription_to_field.set_value value="DESCENDANTS"/>
146 <n.subscription_to_field.hidden/>
147
148 <n.subscription_type_field.set_value value="INSTANT"/>
149 <n.subscription_type_field.hidden/>
150
151 <div style="font-weight:bold;margin: 2em 0 .5em">
152 <t>Do you really want to subscribe to <t.location><a href="[n.page_node.url/]"><n.page_node.subject/></a></t.location>?</t>
153 </div>
154 <div class="weak-color">
155 <t>You will receive an email for each new message posted under this topic.</t>
156 </div>
157 </macro>
158
159 <macro name="unsubscribe_path" requires="node">
160 /template/NamlServlet.jtp?macro=unsubscribe&node=<n.id/>
161 </macro>
162
163 <macro name="show_mailing_list_alert" requires="node_page">
164 <n.if>
165 <condition>
166 <n.either>
167 <condition1.page_node.is_associated_with_mailing_list_archive/>
168 <condition2.page_node.has_sub_archive/>
169 </n.either>
170 </condition>
171 <then>
172 <div class="info-message rounded" style="padding:.5em;margin-top:1em">
173 <t><b>IMPORTANT:</b> This subscription is independent of the real mailing list subscription.
174 Basically, you will subscribe to the forum archive, not to the mailing list itself.
175 The archive subscription won't guarantee that your messages will be accepted by mailing list.</t>
176 <n.if.page_node.is_a_mailing_list_archive>
177 <then>
178 <n.page_node.get_associated_mailing_list_archive.>
179 <t>If you want to subscribe to the mailing list instead,
180 <n.mailing_list_options_link.>visit this page</n.mailing_list_options_link.>.</t>
181 </n.page_node.get_associated_mailing_list_archive.>
182 </then>
183 </n.if.page_node.is_a_mailing_list_archive>
184 </div>
185 </then>
186 </n.if>
187 </macro>
188
189 <macro name="subscription_to_field" dot_parameter="do">
190 <n.field. name="subscription_to"><n.do/></n.field.>
191 </macro>
192
193 <macro name="subscription_type_field" dot_parameter="do">
194 <n.field. name="subscription_type"><n.do/></n.field.>
195 </macro>
196
197 <macro name="image_icon" requires="node">
198 <n.if.is_app>
199 <then>/images/forum_sm.png</then>
200 <else>/images/thread_sm.png</else>
201 </n.if.is_app>
202 </macro>
203
204 <macro name="show_success_message">
205 <table class="info-message" style="width:100%;padding:.5em">
206 <tr>
207 <td><img src="/images/success.png"/></td>
208 <td style="width:100%;font-weight:bold">
209 <t>Success: a confirmation email has been sent to you.</t>
210 </td>
211 </tr>
212 </table>
213 </macro>
214
215 <macro name="action_parameter">
216 <n.get_parameter name='action'/>
217 </macro>
218
219 <macro name="email_parameter">
220 <n.get_parameter name='email'/>
221 </macro>
222
223 <macro name="code_parameter">
224 <n.get_parameter name='code'/>
225 </macro>
226
227 <macro name="handle_anonymous_subscription" requires="node_page">
228 <n.set_local_subscription.page_node.subscription_for email="[n.email_parameter/]" />
229 <n.if.visitor.can_view.page_node>
230 <then>
231 <n.if.local_subscription.is_subscribed>
232 <then.throw_template_exception name="already_subscribed"/>
233 <else.local_subscription.send_subscription_confirmation/>
234 </n.if.local_subscription.is_subscribed>
235 </then>
236 <else.throw_template_exception name="not_authorized"/>
237 </n.if.visitor.can_view.page_node>
238 </macro>
239
240 <macro name="show_subscription_error" requires="node_page">
241 <n.format_error.handle_exception. for="send-email-block">
242 <n.exception. name="invalid_email">
243 <t>Enter a valid email address.</t>
244 </n.exception.>
245 <n.exception. name="not_authorized">
246 <t>Sorry, but this email is not authorized to view messages under <t.location.page_node.subject/>.</t>
247 </n.exception.>
248 <n.exception. name="already_subscribed">
249 <t>This email is already subscribed.</t>
250 </n.exception.>
251 </n.format_error.handle_exception.>
252 </macro>
253
254 <macro name="anonymous_subscription_form">
255 <div style="margin:1em 0">
256 <t>Enter below your email address and we will send a confirmation email to you.</t>
257 <div class="second-font big-title" style="margin:1em 0 .2em">
258 <t>Enter your email address</t>
259 </div>
260 <n.form.>
261 <input type="hidden" name="node" value="[n.page_node.id/]"/>
262 <input type="hidden" name="action" value="send-anonymous"/>
263 <input type="text" size="40" maxlength="80" name="email"/><br/>
264 <n.if.page_node.is_post>
265 <then>
266 <input type="hidden" name="subscription_to" value="DESCENDANTS"/>
267 <div class="weak-color">
268 <t>You will receive an email for each new message posted under this topic.</t>
269 </div>
270 </then>
271 <else>
272 <input id="sChildren" type="radio" name="subscription_to" value="CHILDREN" checked="true"><label for="sChildren"><t>New topics only</t></label></input><br/>
273 <input id="sDescendants" type="radio" name="subscription_to" value="DESCENDANTS"><label for="sDescendants"><t>All posts</t></label></input><br/>
274 </else>
275 </n.if.page_node.is_post>
276 <input type="submit" class="toolbar action-button" value="[t]Subscribe[/t]" style="margin-top:.5em"/>
277 </n.form.>
278 </div>
279 </macro>
280
281 <macro name="send_subscription_confirmation" requires="subscription,node_page" unindent="true">
282 <n.set_local_subscription.this_subscription />
283 <n.new_email.>
284 <n.send>
285 <to><n.email_parameter/></to>
286 <subject><t>Subscribe to <t.location.page_node.subject/></t></subject>
287 <text_part>
288 <t>Dear user,</t>
289
290 <t>You have been invited to subscribe to <t.location.page_node.subject/>, which is available at:</t>
291 <n.page_node.url/>
292
293 <t>With your subscription, updates will be sent directly to your email address
294 and you can reply to them to participate in the discussion. Your subscription works the same
295 as a mailing list.</t>
296
297 <t>To confirm your subscription, click on the link below:</t>
298 <n.local_subscription.subscription_confirmation_subscribe_by_code_url/>
299
300 <t>Sincerely,</t>
301 <t>The Nabble team</t>
302 ________________________________________
303 <t>Free Embeddable <t.app.page_node.view_name/></t> powered by Nabble
304 <n.nabble_homepage/>
305 </text_part>
306 <html_part>
307 <t>Dear user,</t><br/>
308 <br/>
309 <t>You have been invited to subscribe to <t.location.bold.page_node.subject/>, which is available at:</t><br/>
310 <a href="[n.page_node.url/]"><n.page_node.url/></a><br/>
311 <br/>
312 <t>With your subscription, updates will be sent directly to your email address
313 and you can reply to them to participate in the discussion. Your subscription works the same
314 as a mailing list.</t><br/>
315 <br/>
316 <t>To confirm your subscription, click on the link below:</t>
317 <div style="background-color:#FFFADB;border:#EDDD79 solid 1px;margin:1.2em 0;padding:.5em">
318 <a href="[n.local_subscription.subscription_confirmation_subscribe_by_code_url/]">
319 <n.local_subscription.subscription_confirmation_subscribe_by_code_url/>
320 </a>
321 </div>
322 <t>Sincerely,</t><br/>
323 <t>The Nabble team</t><br/>
324 ________________________________________<br/>
325 <t>Free Embeddable <t.app.page_node.view_name/></t> powered by Nabble<br/>
326 <n.nabble_homepage/>
327 </html_part>
328 </n.send>
329 </n.new_email.>
330 </macro>
331
332 <macro name="subscription_confirmation_subscribe_by_code_url" requires="subscription">
333 <n.subscribe_by_code_url subscription_to="[n.subscription_to_field.value/]"/>
334 </macro>
335
336 <macro name="subscribe_by_code_url" parameters="subscription_to" requires="subscription">
337 <n.remove_spaces.>
338 <n.base_url/>
339 <n.encode_url.>
340 /template/NamlServlet.jtp?macro=subscribe_by_code&node=<n.node.id/>&code=<n.subscription_code/>
341 <n.add_to_path name="subscription_to" value="[n.subscription_to/]" />
342 </n.encode_url.>
343 </n.remove_spaces.>
344 </macro>
345
346 <macro name="subscribe_by_code" requires="servlet">
347 <n.node_page.>
348 <n.catch_exception. id="save-subscription">
349 <n.page_node.get_subscription_by_code. code="[n.code_parameter/]">
350 <n.if.not.is_subscribed>
351 <then.save to="[n.subscription_to_field.value/]" type="INSTANT" />
352 <else.throw_template_exception name="already_subscribed"/>
353 </n.if.not.is_subscribed>
354 </n.page_node.get_subscription_by_code.>
355 </n.catch_exception.>
356 <n.html>
357 <head>
358 <meta name="robots" content="noindex,nofollow"/>
359 <n.title.><t>Subscription Confirmation</t></n.title.>
360 </head>
361 <body>
362 <n.edit_header first_text="[n.page_node.subject/]" second_text="Subscription Confirmation" />
363 <br/>
364 <n.if.has_exception for="save-subscription">
365 <then>
366 <n.handle_exception. for="save-subscription">
367 <n.exception. name="invalid_link">
368 <h2><t>Invalid Code</t></h2>
369 <p><t>The code in the URL is not valid.</t>
370 <t>Please contact Nabble Support if you need help.</t></p>
371 </n.exception.>
372 <n.exception. name="already_subscribed">
373 <h2><t>Already Subscribed</t></h2>
374 <p><t>You are already subscribed to <n.page_node.subject/>.</t></p>
375 </n.exception.>
376 </n.handle_exception.>
377 </then>
378 <else>
379 <h2><t>Subscription Confirmed</t></h2>
380 <p><t>From now on, you will receive an email for each message posted under <t.location.page_node.subject/>.</t></p>
381 </else>
382 </n.if.has_exception>
383 </body>
384 </n.html>
385 </n.node_page.>
386 </macro>
387
388 <macro name="subscription_saved_url">
389 <n.remove_spaces.>
390 <n.page_node.base_url/>
391 /template/NamlServlet.jtp?macro=subscription_saved&node=<n.page_node.id/>
392 </n.remove_spaces.>
393 </macro>
394
395 <macro name="subscription_saved" requires="servlet">
396 <n.node_page.>
397 <n.subscription_msg
398 header="[t]Subscription Confirmed[/t]"
399 message="[t]Your subscription has been successfully saved.[/t]"
400 />
401 </n.node_page.>
402 </macro>
403
404 <macro name="subscription_msg" parameters="header,message">
405 <n.html>
406 <head>
407 <n.title.><n.header/></n.title.>
408 <n.main_title_css/>
409 </head>
410 <body>
411 <n.visitor.profile_header/>
412 <div class="shaded-bg-color rounded second-font main-title">
413 <n.header/>
414 </div>
415
416 <table style="margin-bottom:1em">
417 <tr valign="top">
418 <td><img src="/images/success.png" class="image16"/></td>
419 <td>
420 <b><n.message/></b>
421 <p><a href="[n.page_node.url/]"><t>Return to <t.location.page_node.subject/></t></a></p>
422 </td>
423 </tr>
424 </table>
425 </body>
426 </n.html>
427 </macro>
428
429 <macro name="main_title_css">
430 <style type="text/css">
431 div.main-title {
432 font-size:120%;
433 font-weight:bold;
434 margin:1em 0;
435 padding: .2em;
436 }
437 </style>
438 </macro>
439
440 <macro name="edit_path" requires="subscription">
441 /template/NamlServlet.jtp?macro=subscribe&node=<n.node.id/>
442 </macro>