menu_delete_post.naml

<override_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');

            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/>', '<n.javascript_string_encode.delete_from_tree_link/>', 'display:none');
        </then>
        <else>
            <n.set_local_node.this_node/>
            <n.if.visitor.is_site_admin>
                <then>NabbleDropdown.show('deleteFromTree<n.local_node.id/>');</then>
            </n.if.visitor.is_site_admin>
            <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>
</override_macro>