view_log

NAML documentation   Watch a video
   Usages of this macro
The source code below doesn't have navigation links because no usage has been compiled yet. Navigation links depend on how and where the macro is used, so first you may try finding all usages of "view_log".
... 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.not.visitor.is_site_admin>
        <then>
            <n.login.><t>Only authorized users can proceed in this area.</t></n.login.>
        </then>
    </n.if.not.visitor.is_site_admin>
    <n.html>
        <head>
            <n.title.>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 first_text="Template Logs" second_text="[n.root_node.get_app_node.subject/]" />
            <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.is_empty.get_log>
                    <then><t>Log is empty</t></then>
                    <else>
                        <pre><n.get_log/></pre>
                    </else>
                </n.if.is_empty.get_log>
            </div>
        </body>
    </n.html>
</macro>