view_log

   Usages of this macro
... in tools.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
<macro name="view_log" requires="servlet">
    <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.not
Binary
Namespace: BasicNamespace
Parameters: condition
.visitor
Binary
Namespace: ServletNamespace
Parameters: do
.is_site_admin
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.is_site_admin>
    <n.html
Macro
Parameters: head, body
>
        <head>
            <n.title
Macro
Parameters: text
.>Template Logs</n.title.>
            <script type="text/javascript">
                function refreshLog() {
                    var call = '/template/NamlServlet.jtp?macro=get_site_log';
                    $.get(call, function(data) {
                        data = Nabble.trim(data);
                        data = data.length == 0? 'Log is empty' : '<pre>'+data+'</pre>';
                        $('#log_data').html(data);
                    });
                };
                function clearLog() {
                    var call = '/template/NamlServlet.jtp?macro=clear_site_log';
                    $.get(call, function(data) {
                        if (Nabble.trim(data) == 'ok')
                            $('#log_data').html('Log is empty');
                    });
                };
            </script>
        </head>
        <body>
            <n.edit_header
Macro
Parameters: first_text, second_text
 first_text="Template Logs" second_text="[n.root_node
Binary
Namespace: NabbleNamespace
Parameters: do
.get_app_node
Binary
Namespace: NodeNamespace
Parameters: do
.subject
Macro
Requires: node
/]" />
            <div style="margin:.5em 0">
                <button class="toolbar" style="font-weight:bold" onclick="refreshLog()"><t>Refresh</t></button>
                <button class="toolbar" style="font-weight:bold" onclick="clearLog()"><t>Clear Log</t></button>
            </div>
            <div id="log_data" style="padding:.3em;margin-top:.5em;overflow-x:auto">
                <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.is_empty
Binary
Namespace: BasicNamespace
Parameters: value
.get_log
Binary
Namespace: NabbleNamespace
>
                    <then><t>Log is empty</t></then>
                    <else>
                        <pre><n.get_log
Binary
Namespace: NabbleNamespace
/></pre>
                    </else>
                </n.if.is_empty.get_log>
            </div>
        </body>
    </n.html>
</macro>