manage_banned_users

NAML documentation   Watch a video
   Usages of this macro
... in manage_banned_users.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
<macro name="manage_banned_users">
    <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.html
Macro
Parameters: head, body
>
        <head>
            <META NAME="robots" CONTENT="noindex,nofollow"/>
            <n.title
Macro
Parameters: text
.><t>Banned Users in <t.location.root_node
Binary
Namespace: NabbleNamespace
Parameters: do
.subject
Macro
Requires: node
/></t></n.title.>
            <n.zebra_table_javascript
Macro
Parameters: table_selector
 table_selector="table.banned-users"/>
            <style type="text/css">
                table.banned-users {
                    border-collapse:collapse;
                }
                table.banned-users th {
                    padding: .3em .6em;
                    text-align:left;
                }
                table.banned-users td {
                    padding: .5em;
                }
                table.banned-users td.avatar-col {
                    text-align:center;
                    padding: .5em 0;
                }
            </style>
        </head>
        <body>
            <n.edit_header
Macro
Parameters: first_text, second_text
 first_text="[t]Banned Users in [t.location.root_node
Binary
Namespace: NabbleNamespace
Parameters: do
.subject
Macro
Requires: node
/][/t]"/>
 
            <div style="margin-top:1em">
                <n.banned_users
Binary
Namespace: NabbleNamespace
Parameters: do
.>
                    <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.has_more_elements
Binary
Namespace: ListSequence
Parameters: n
>
                        <then>
                            <table class="banned-users">
                                <tr>
                                    <th style="width:24px"></th>
                                    <th style="min-width:15em"><t>Name</t></th>
                                    <th><t>Action</t></th>
                                </tr>
                                <n.loop
Macro
Requires: sequence
Parameters: by, do
.>
                                    <tr>
                                        <td class="avatar-col"><n.current_user
Binary
Namespace: UserList
Parameters: do
.avatar
Macro
Requires: user
Parameters: size, border_class, group
/></td>
                                        <td><n.current_user
Binary
Namespace: UserList
Parameters: do
.name
Binary
Namespace: UserNamespace
Parameters: truncate
/></td>
                                        <td><a href="[n.current_user
Binary
Namespace: UserList
Parameters: do
.unban_path
Macro
Requires: user
/]"><t>Unban this user</t></a></td>
                                    </tr>
                                </n.loop.>
                            </table>
                        </then>
                        <else>
                            <t>No banned users.</t>
                        </else>
                    </n.if.has_more_elements>
                </n.banned_users.>
            </div>
        </body>
    </n.html>
</macro>