summaryrefslogtreecommitdiffstats
path: root/weblog-viewusagestats-html.lsp
blob: 0d534e1661cc5f1f87b49fbeeb31e34f85cb8cf4 (plain)
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
<% local data, viewlibrary, page_info, session = ... %>
<% require("viewfunctions") %>

<% local subdata, pagedata = paginate(data.value, page_info.clientdata, 100) %>

<H1><%= html.html_escape(data.label) %></H1>
<DL>
<% displaypagination(pagedata, page_info) %>
<TABLE>
	<TR style="background:#eee;font-weight:bold;">
		<TD style="padding-right:20px;white-space:nowrap;" class="header">Date</TD>
		<TD style="padding-right:20px;white-space:nowrap;" class="header">Source</TD>
		<TD style="padding-right:20px;white-space:nowrap;" class="header">Requests</TD>
		<TD style="white-space:nowrap;" WIDTH="90%" class="header">Blocks</TD>
	</TR>

<% for i,stat in ipairs(subdata) do %>
	<TR>
		<TD><%= html.html_escape(stat.date) %></TD>
		<TD><%= html.html_escape(stat.sourcename) %></TD>
		<TD><%= html.html_escape(stat.numrequest) %></TD>
		<TD><%= html.html_escape(stat.numblock) %></TD>
	</TR>
<% end %>
</TABLE>

<% if data.errtxt then %>
<p class='error'><%= html.html_escape(data.errtxt) %></p>
<% end %>
<% if #data.value == 0 then %>
<p>No usage stats found</p>
<% end %>
</DL>