new_topic_forbidden_page

NAML documentation   Watch a video
   Usages of this macro
... in new_topic_forbidden_page.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
36
37
38
39
40
41
42
43
44
45
<override_macro name="new_topic_forbidden_page">
    <n.set_var
Binary
Namespace: BasicNamespace
Parameters: name, value
 name="has_descendants_where_can_reply" value="[n.false
Binary
Namespace: BasicNamespace
/]" />
    <n.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
.descendant_apps_list
Binary
Namespace: NodeNamespace
Parameters: do
.loop
Macro
Requires: sequence
Parameters: by, do
.>
        <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.visitor
Binary
Namespace: ServletNamespace
Parameters: do
.can_create_topic_in
Macro
Requires: user
Parameters: node_attr
.current_node
Binary
Namespace: NodeList
Parameters: do
>
            <then>
                <n.set_var
Binary
Namespace: BasicNamespace
Parameters: name, value
 name="has_descendants_where_can_reply" value="[n.true
Binary
Namespace: BasicNamespace
/]" />
                <n.break
Binary
Namespace: BasicNamespace
/>
            </then>
        </n.if.visitor.can_create_topic_in.current_node>
    </n.page_node.descendant_apps_list.loop.>
    <n.html
Macro
Parameters: head, body
>
        <head>
            <META NAME="robots" CONTENT="noindex,nofollow"/>
            <n.title
Macro
Parameters: text
.>
                <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.var
Binary
Namespace: BasicNamespace
Parameters: name
 name="has_descendants_where_can_reply">
                    <then><t>Choose a Subcategory</t></then>
                    <else><t>Authorized Users Only</t></else>
                </n.if.var>
            </n.title.>
        </head>
        <body>
            <div style="font-size:140%;margin:.5em 0 1em">
                <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.var
Binary
Namespace: BasicNamespace
Parameters: name
 name="has_descendants_where_can_reply">
                    <then><t>Choose a subcategory to post your message</t></then>
                    <else><t>You Cannot Post Here</t></else>
                </n.if.var>
            </div>
            <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.var
Binary
Namespace: BasicNamespace
Parameters: name
 name="has_descendants_where_can_reply">
                <then>
                    <n.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
.descendant_apps_list
Binary
Namespace: NodeNamespace
Parameters: do
.loop
Macro
Requires: sequence
Parameters: by, do
.>
                        <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.visitor
Binary
Namespace: ServletNamespace
Parameters: do
.can_create_topic_in
Macro
Requires: user
Parameters: node_attr
.current_node
Binary
Namespace: NodeList
Parameters: do
>
                            <then>
                                <div style="margin:.3em"><n.current_node
Binary
Namespace: NodeList
Parameters: do
.new_topic_link
Macro
Requires: node
Parameters: href, text, title, class
 text="[n.subject
Macro
Requires: node
/]" /></div>
                            </then>
                        </n.if.visitor.can_create_topic_in.current_node>
                    </n.page_node.descendant_apps_list.loop.>
                </then>
                <else>
                    This is a read-only archive.
                </else>
            </n.if.var>
        </body>
    </n.html>
    <n.exit
Binary
Namespace: BasicNamespace
/>
</override_macro>
Overrides default macro
... in reply.naml
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
<macro name="new_topic_forbidden_page">
    <n.set_var name="has_descendants_where_can_reply" value="[n.false/]" />
    <n.page_node.descendant_apps_list.loop.>
        <n.if.visitor.can_create_topic_in.current_node>
            <then>
                <n.set_var name="has_descendants_where_can_reply" value="[n.true/]" />
                <n.break/>
            </then>
        </n.if.visitor.can_create_topic_in.current_node>
    </n.page_node.descendant_apps_list.loop.>
    <n.html>
        <head>
            <META NAME="robots" CONTENT="noindex,nofollow"/>
            <n.title.>
                <n.if.var name="has_descendants_where_can_reply">
                    <then><t>Choose a Subcategory</t></then>
                    <else><t>Authorized Users Only</t></else>
                </n.if.var>
            </n.title.>
        </head>
        <body>
            <div style="font-size:140%;margin:.5em 0 1em">
                <n.if.var name="has_descendants_where_can_reply">
                    <then><t>Choose a subcategory to post your message</t></then>
                    <else><t>You Cannot Post Here</t></else>
                </n.if.var>
            </div>
            <n.if.var name="has_descendants_where_can_reply">
                <then>
                    <n.page_node.descendant_apps_list.loop.>
                        <n.if.visitor.can_create_topic_in.current_node>
                            <then>
                                <div style="margin:.3em"><n.current_node.new_topic_link text="[n.subject/]" /></div>
                            </then>
                        </n.if.visitor.can_create_topic_in.current_node>
                    </n.page_node.descendant_apps_list.loop.>
                </then>
                <else>
                    <t>Sorry, but you can't create new topics here.<br/>Note that you may still be able to reply to posts.</t>
                    <br/><br/>
                    <n.if.visitor.is_site_admin>
                        <then><t><b>Note</b>: Since you are an administrator, you can <n.page_node.change_permissions_link.>change the permissions of <t.location.page_node.subject/></n.page_node.change_permissions_link.> and make sure you can create new topics here.</t></then>
                        <else><t>You may <n.page_node.unauthorized_link.>request permission to post</n.page_node.unauthorized_link.> here or contact <n.root_node.owner.send_email_link.><n.root_node.owner.name/></n.root_node.owner.send_email_link.> if you have questions.</t></else>
                    </n.if.visitor.is_site_admin>
                </else>
            </n.if.var>
        </body>
    </n.html>
    <n.exit/>
</macro>