menu_delete_post

NAML documentation   Watch a video
   Usages of this macro
... in menu_delete_post.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
<override_macro name="menu_delete_post" requires="node">
    <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.is_in_command
Binary
Namespace: BasicNamespace
Parameters: name
 name="dropdown">
        <then>
            dropdown.add('deletePost<n.id
Binary
Namespace: NodeNamespace
/>', '<n.javascript_string_encode
Binary
Namespace: NabbleNamespace
Parameters: text
.delete_post_link
Macro
Requires: node
Parameters: text, title, class
/>', 'display:none');
            dropdown.add('deleteRecursively<n.id
Binary
Namespace: NodeNamespace
/>', '<n.javascript_string_encode
Binary
Namespace: NabbleNamespace
Parameters: text
.delete_recursively_link
Macro
Requires: node
Parameters: text, title, class
/>', 'display:none');
 
            Nabble.deleteFromTree = function(nodeId) {
                if( !confirm("Do you really want to permanently delete this message and attach all replies under the parent post?\n\nCAUTION: this action cannot be reverted.") )
                    return;
                var newLocation = "/template/NamlServlet.jtp?macro=delete_from_tree&node="+nodeId+Nabble.getClientID();
                Nabble.setTop(newLocation);
            };
            dropdown.add('deleteFromTree<n.id
Binary
Namespace: NodeNamespace
/>', '<n.javascript_string_encode
Binary
Namespace: NabbleNamespace
Parameters: text
.delete_from_tree_link
Macro
Requires: node
Parameters: text, title, class
/>', 'display:none');
        </then>
        <else>
            <n.set_local_node
Macro
Parameters: node
.this_node
Binary
Namespace: NodeNamespace
Parameters: do
/>
            <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.visitor
Binary
Namespace: ServletNamespace
Parameters: do
.is_site_admin
Macro
Requires: user
>
                <then>NabbleDropdown.show('deleteFromTree<n.local_node
Macro
Parameters: do
.id
Binary
Namespace: NodeNamespace
/>');</then>
            </n.if.visitor.is_site_admin>
            <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.visitor
Binary
Namespace: ServletNamespace
Parameters: do
.can_delete
Macro
Requires: user
Parameters: node_attr
.local_node
Macro
Parameters: do
>
                <then>
                    NabbleDropdown.show('deletePost<n.local_node
Macro
Parameters: do
.id
Binary
Namespace: NodeNamespace
/>');
                </then>
            </n.if.visitor.can_delete.local_node>
            <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.visitor
Binary
Namespace: ServletNamespace
Parameters: do
.can_delete_recursively
Macro
Requires: user
Parameters: node
.local_node>
                <then>
                    NabbleDropdown.show('deleteRecursively<n.local_node
Macro
Parameters: do
.id
Binary
Namespace: NodeNamespace
/>');
                </then>
            </n.if.visitor.can_delete_recursively.local_node>
        </else>
    </n.if.is_in_command>
</override_macro>
Overrides default macro
... in dropdown.naml
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
<macro name="menu_delete_post" requires="node">
    <n.if.is_in_command name="dropdown">
        <then>
            dropdown.add('deletePost<n.id/>', '<n.javascript_string_encode.delete_post_link/>', 'display:none');
            dropdown.add('deleteRecursively<n.id/>', '<n.javascript_string_encode.delete_recursively_link/>', 'display:none');
        </then>
        <else>
            <n.set_local_node.this_node/>
            <n.if.visitor.can_delete.local_node>
                <then>
                    NabbleDropdown.show('deletePost<n.local_node.id/>');
                </then>
            </n.if.visitor.can_delete.local_node>
            <n.if.visitor.can_delete_recursively.local_node>
                <then>
                    NabbleDropdown.show('deleteRecursively<n.local_node.id/>');
                </then>
            </n.if.visitor.can_delete_recursively.local_node>
        </else>
    </n.if.is_in_command>
</macro>