ban_user

NAML documentation   Watch a video
   Usages of this macro
... in ban_user.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<macro name="ban_user" requires="servlet">
    <n.user_page
Macro
Requires: servlet
Parameters: do
.>
        <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.not
Binary
Namespace: BasicNamespace
Parameters: condition
.visitor
Binary
Namespace: ServletNamespace
Parameters: do
.can_manage_banned_users
Macro
Requires: user
>
            <then>
                <n.login
Macro
Requires: servlet
Parameters: message
.><t>Only authorized users can proceed in this area.</t></n.login.>
            </then>
        </n.if.not.visitor.can_manage_banned_users>
        <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.is_submitted_form
Macro
Requires: servlet
>
            <then>
                <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.ban_user_field
Macro
Parameters: do
.is_checked
Macro
Requires: field
>
                    <then><n.page_user
Binary
Namespace: UserPageNamespace
Parameters: do
.ban
Binary
Namespace: UserNamespace
/></then>
                </n.if.ban_user_field.is_checked>
 
                <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.delete_posts_field
Macro
Parameters: do
.is_checked
Macro
Requires: field
>
                    <then><n.page_user
Binary
Namespace: UserPageNamespace
Parameters: do
.delete_user_nodes
Binary
Namespace: UserNamespace
/></then>
                </n.if.delete_posts_field.is_checked>
            </then>
        </n.if.is_submitted_form>
        <n.html
Macro
Parameters: head, body
>
            <head>
                <META NAME="robots" CONTENT="noindex,nofollow"/>
                <n.title
Macro
Parameters: text
.><t>Ban User</t></n.title.>
                <script type="text/javascript">
                    $(document).ready(function() {
                        function enableButton() {
                            var $submit = $('input[type="submit"]');
                            var disabled = !$('#ban_this_user').is(':checked') && !$('#delete_posts').is(':checked');
                            if (disabled)
                                $submit.attr('disabled','true');
                            else
                                $submit.removeAttr('disabled');
                        }
                        $('input[type="checkbox"]').click(enableButton);
                        enableButton();
                    });
                </script>
                <n.bold_label_style
Macro
/>
            </head>
            <body>
                <n.edit_header
Macro
Parameters: first_text, second_text
 first_text="[t]Ban User[/t]" second_text="[n.page_user
Binary
Namespace: UserPageNamespace
Parameters: do
.name
Binary
Namespace: UserNamespace
Parameters: truncate
/]" />
 
                <n.form
Macro
Requires: servlet
Parameters: macro, method, onsubmit, content
.>
                    <table style="margin-bottom: .5em">
                        <tr valign="top">
                            <td><n.page_user
Binary
Namespace: UserPageNamespace
Parameters: do
.avatar
Macro
Requires: user
Parameters: size, border_class, group
 size="big"/></td>
                            <td>
                                <div style="padding:.3em .5em">
                                <t>Select below the actions you want to take:</t>
                                </div>
                                <n.ban_user_control
Macro
/>
                                <n.delete_posts_control
Macro
/>
                            </td>
                        </tr>
                    </table>
 
                    <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.not
Binary
Namespace: BasicNamespace
Parameters: condition
.is_submitted_form
Macro
Requires: servlet
>
                        <then>
                            <div style="margin-top:1.4em">
                                <input type="submit" value="[t]Take Action[/t]" disabled="true"/>
                                <t>or</t> <a href="[n.page_user
Binary
Namespace: UserPageNamespace
Parameters: do
.url
Macro
Requires: user
Parameters: filter, index_record
/]"><t>Cancel</t></a>
                            </div>
                        </then>
                    </n.if.not.is_submitted_form>
                </n.form.>
 
                <p><t>You can also <n.manage_banned_users_link
Macro
Parameters: text, title, class
.>manage banned users</n.manage_banned_users_link.> in <t.location.root_node
Binary
Namespace: NabbleNamespace
Parameters: do
.subject
Macro
Requires: node
/>.</t></p>
            </body>
        </n.html>
    </n.user_page.>
</macro>