6 PROCESS logic_header.ttk;
8 pagetype = CGI.param('detail');
10 %] <style> table {border-collapse:collapse;}</style> [%
14 INCLUDE header.ttk title="Reporter Dashboard -- My Recent Reports";
15 INCLUDE navbar.ttk + my_reports;
17 INCLUDE header.ttk title="Reporter Dashboard -- My Recent Templates";
18 INCLUDE navbar.ttk + my_templates;
20 INCLUDE header.ttk title="Reporter Dashboard -- Others Recent Public Reports";
21 INCLUDE navbar.ttk + public_reports;
22 CASE 'otherstemplates';
23 INCLUDE header.ttk title="Reporter Dashboard -- Others Recent Public Templates";
24 INCLUDE navbar.ttk + public_templates;
26 INCLUDE header.ttk title="Reporter Dashboard -- Core Fact Tables";
27 INCLUDE navbar.ttk + fact_tables;
29 INCLUDE header.ttk title="Reporter Dashboard";
30 INCLUDE navbar.ttk + summary;
36 WRAPPER html/table border=0 width='100%';
40 content=link(content='My Recent Reports',href='dashboard?detail=myreports')
42 style='border-bottom:1px solid black';
44 content=link(content='Others Recent Public Reports',href='dashboard?detail=othersreports')
46 style='border-bottom:1px solid black';
49 WRAPPER html/cell valign='top' style='height:200px';
50 INCLUDE my_reports limit=5;
52 WRAPPER html/cell valign='top';
53 INCLUDE public_reports limit=5;
58 content=link(content='My Recent Templates',href='dashboard?detail=mytemplates')
60 style='border-bottom:1px solid black';
62 content=link(content='Others Recent Public Templates',href='dashboard?detail=otherstemplates')
64 style='border-bottom:1px solid black';
67 WRAPPER html/cell valign='top' style='height:200px';
68 INCLUDE my_templates limit=5;
70 WRAPPER html/cell valign='top';
71 INCLUDE public_templates limit=5;
78 content=link(content='Core Fact Tables',href='dashboard?detail=facttables')
79 style='border-bottom:1px solid black';
82 WRAPPER html/cell colspan=2 valign='top';
90 q = "SELECT * FROM reporter.stage3 WHERE owner = " _ user.id() _
91 " ORDER BY runtime DESC";
93 q = q _ ' LIMIT ' _ limit;
102 BLOCK public_reports;
103 q = "SELECT * FROM reporter.stage3 WHERE pub is true" _
104 " and owner != " _ user.id() _ " ORDER BY runtime DESC";
106 q = q _ ' LIMIT ' _ limit;
111 INCLUDE show_reports;
116 WRAPPER html/table width='100%';
118 INCLUDE html/cell content='Public' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;';
119 INCLUDE html/cell content='Report Name' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;';
120 INCLUDE html/cell content='Created at' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;';
121 INCLUDE html/cell content='Scheduled Run Date' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;';
122 INCLUDE html/cell content='Recurrence' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;';
124 FOR report = DBI.query(q);
131 p = utils.JSON2perl( report.params );
132 INCLUDE html/cell content=(report.pub ? 'Y' : 'N') col=bg style='border:solid gray 1px;' align='center';
133 INCLUDE html/cell content=link(content=p.reportname,href="stage3?id=$rid") col=bg style='border:solid gray 1px;';
134 INCLUDE html/cell content=report.create_date.chunk(10).0 col=bg style='border:solid gray 1px;';
135 INCLUDE html/cell content=report.runtime.chunk(10).0 col=bg style='border:solid gray 1px;';
136 INCLUDE html/cell content=report.recurrence col=bg style='border:solid gray 1px;';
143 q = "SELECT * FROM reporter.stage2 WHERE " _
144 " owner = " _ user.id() _ " ORDER BY create_date DESC";
146 q = q _ ' LIMIT ' _ limit;
151 INCLUDE show_templates;
155 BLOCK public_templates;
156 q = "SELECT * FROM reporter.stage2 WHERE pub is true" _
157 " and owner != " _ user.id() _ " ORDER BY create_date DESC";
159 q = q _ ' LIMIT ' _ limit;
164 INCLUDE show_templates;
168 BLOCK show_templates;
169 WRAPPER html/table width='100%' class='withborder';
171 INCLUDE html/cell content='Public' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;';
172 INCLUDE html/cell content='Template Name' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;';
173 INCLUDE html/cell content='Created at' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;';
175 FOR template = DBI.query(q);
182 p = utils.JSON2perl( template.params );
183 INCLUDE html/cell content=(template.pub ? 'Y' : 'N') col=bg style='border:solid gray 1px;' align='center';
184 INCLUDE html/cell content=link(content=p.templatename,href="stage2?id=$tid") col=bg style='border:solid gray 1px;';
185 INCLUDE html/cell content=template.create_date.chunk(10).0 col=bg style='border:solid gray 1px;';
192 WRAPPER html/table width='100%' class='withborder';
194 INCLUDE html/cell content='Fact table' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;';
195 INCLUDE html/cell content='Description' nowrap='nowrap' col='lightgray' style='border:solid gray 1px;';
198 fact_table_xpath = "/reporter/tables/table[@fact-table='true']";
199 FOR tab = config.findnodes(fact_table_xpath);
200 tid = tab.findvalue('@id');
206 p = utils.JSON2perl( template.params );
209 content=link(content=tab.findvalue('label'),href="stage1?id=$tid") style='border:solid gray 1px;';
210 INCLUDE html/cell content=tab.findvalue('description') style='border:solid gray 1px;';