save_registration

NAML documentation   Watch a video
   Usages of this macro
... in save_registration.naml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<override_macro name="save_registration">
    <n.catch_exception
Binary
Namespace: BasicNamespace
Parameters: id, do
. id="save-block">
        <n.set_local_user
Macro
Parameters: user
.get_registration
Binary
Namespace: ServletNamespace
Parameters: registration_key, do, email
 registration_key="[n.get_parameter
Binary
Namespace: RequestNamespace
Parameters: name
 name='key'/]" email="[n.email_field
Macro
Parameters: do
.value
Binary
Namespace: FieldNamespace
/]" />
        <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.is_null
Binary
Namespace: BasicNamespace
Parameters: value
.local_user
Macro
Parameters: do
>
            <then>
                <h1><t>Registration Failed</t></h1>
                <p><t>Please make sure you are using the same browser that you used to fill in the registration request.</t></p>
                <p><t>You can try <n.register_link
Macro
Parameters: text, title
.>registering again</n.register_link.> or contact <n.support_link
Macro
/>.</t></p>
            </then>
            <else>
                <n.local_user
Macro
Parameters: do
.register
Binary
Namespace: UserNamespace
/>
                <n.set_var
Binary
Namespace: BasicNamespace
Parameters: name, value
. name="next_url">
                    <n.get_next_url_from_registration
Binary
Namespace: ServletNamespace
Parameters: registration_key
 registration_key="[n.get_parameter
Binary
Namespace: RequestNamespace
Parameters: name
 name='key'/]" />
                </n.set_var.>
 
                <h1><t>Registration Confirmed</t></h1>
                <p><t>You have been registered for the forum of the Tottenham Hotspur Supporters’ Trust.</t></p>
                <p><a href="[n.var
Binary
Namespace: BasicNamespace
Parameters: name
 name='next_url'/]"><t>Continue</t></a></p>
 
                <n.local_user
Macro
Parameters: do
.after_registration
Macro
Requires: user
/>
            </else>
        </n.if.is_null.local_user>
    </n.catch_exception.>
    <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.has_exception
Binary
Namespace: BasicNamespace
Parameters: for
 for="save-block">
        <then>
            <h1><t>Registration Failed</t></h1>
            <br />
            <n.handle_exception
Binary
Namespace: NabbleNamespace
Parameters: for, do
. for="save-block">
                <n.comment
Macro
Parameters: text
.>
                    fill in as needed
                </n.comment.>
            </n.handle_exception.>
        </then>
    </n.if.has_exception>
</override_macro>
Overrides default macro
... in register.naml
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
<macro name="save_registration">
    <n.catch_exception. id="save-block">
        <n.set_local_user.get_registration registration_key="[n.get_parameter name='key'/]" email="[n.email_field.value/]" />
        <n.if.is_null.local_user>
            <then>
                <h1><t>Registration Failed</t></h1>
                <p><t>Please make sure you are using the same browser that you used to fill in the registration request.</t></p>
                <p><t>You can try <n.register_link.>registering again</n.register_link.> or contact <n.support_link/>.</t></p>
            </then>
            <else>
                <n.local_user.register/>
                <n.set_var. name="next_url">
                    <n.get_next_url_from_registration registration_key="[n.get_parameter name='key'/]" />
                </n.set_var.>
 
                <h1><t>Registration Confirmed</t></h1>
                <p><t>You have been registered to <t.subject.root_node.subject/>.</t></p>
                <p><a href="[n.var name='next_url'/]"><t>Continue</t></a></p>
 
                <n.local_user.after_registration/>
            </else>
        </n.if.is_null.local_user>
    </n.catch_exception.>
    <n.if.has_exception for="save-block">
        <then>
            <h1><t>Registration Failed</t></h1>
            <br />
            <n.handle_exception. for="save-block">
                <n.comment.>
                    fill in as needed
                </n.comment.>
            </n.handle_exception.>
        </then>
    </n.if.has_exception>
</macro>