6 PROCESS logic_header.ttk;
8 pagetype = CGI.param('detail');
13 INCLUDE header.ttk title="Reporter Dashboard -- My Recent Reports";
14 INCLUDE navbar.ttk + my_reports;
16 INCLUDE header.ttk title="Reporter Dashboard -- My Recent Templates";
17 INCLUDE navbar.ttk + my_templates;
19 INCLUDE header.ttk title="Reporter Dashboard -- Others Recent Public Reports";
20 INCLUDE navbar.ttk + public_reports;
21 CASE 'otherstemplates';
22 INCLUDE header.ttk title="Reporter Dashboard -- Others Recent Public Templates";
23 INCLUDE navbar.ttk + public_templates;
25 INCLUDE header.ttk title="Reporter Dashboard -- Core Fact Tables";
26 INCLUDE navbar.ttk + fact_tables;
28 INCLUDE header.ttk title="Reporter Dashboard";
29 INCLUDE navbar.ttk + summary;
35 WRAPPER html/table border=0 width='100%';
39 content=link(content='My Recent Reports',href='dashboard?detail=myreports')
41 style='border-bottom:1px solid black';
43 content=link(content='Others Recent Public Reports',href='dashboard?detail=othersreports')
45 style='border-bottom:1px solid black';
48 WRAPPER html/cell valign='top' style='height:200px';
49 INCLUDE my_reports limit=5;
51 WRAPPER html/cell valign='top';
52 INCLUDE public_reports limit=5;
57 content=link(content='My Recent Templates',href='dashboard?detail=mytemplates')
59 style='border-bottom:1px solid black';
61 content=link(content='Others Recent Public Templates',href='dashboard?detail=otherstemplates')
63 style='border-bottom:1px solid black';
66 WRAPPER html/cell valign='top' style='height:200px';
67 INCLUDE my_templates limit=5;
69 WRAPPER html/cell valign='top';
70 INCLUDE public_templates limit=5;
77 content=link(content='Core Fact Tables',href='dashboard?detail=facttables')
78 style='border-bottom:1px solid black';
81 WRAPPER html/cell colspan=2 valign='top' style='height:200px';
89 q = "SELECT * FROM reporter.stage3 WHERE owner = " _ user.id() _
90 " ORDER BY runtime DESC";
92 q = q _ ' LIMIT ' _ limit;
101 BLOCK public_reports;
102 q = "SELECT * FROM reporter.stage3 WHERE pub is true" _
103 " and owner != " _ user.id() _ " ORDER BY runtime DESC";
105 q = q _ ' LIMIT ' _ limit;
110 INCLUDE show_reports;
115 WRAPPER html/table width='100%';
117 INCLUDE html/cell content='Public' nowrap='nowrap' col='lightgray';
118 INCLUDE html/cell content='Report Name' nowrap='nowrap' col='lightgray';
119 INCLUDE html/cell content='Created at' nowrap='nowrap' col='lightgray';
120 INCLUDE html/cell content='Scheduled Run Date' nowrap='nowrap' col='lightgray';
121 INCLUDE html/cell content='Recurrence' nowrap='nowrap' col='lightgray';
123 FOR report = DBI.query(q);
129 p = utils.JSON2perl( report.params );
130 INCLUDE html/cell content=(report.pub ? 'Y' : 'N') col=bg;
131 INCLUDE html/cell content=p.reportname col=bg;
132 INCLUDE html/cell content=report.create_date.chunk(10).0 col=bg;
133 INCLUDE html/cell content=report.runtime.chunk(10).0 col=bg;
134 INCLUDE html/cell content=report.recurrence col=bg;
141 q = "SELECT * FROM reporter.stage2 WHERE " _
142 " owner = " _ user.id() _ " ORDER BY create_date DESC";
144 q = q _ ' LIMIT ' _ limit;
149 INCLUDE show_templates;
153 BLOCK public_templates;
154 q = "SELECT * FROM reporter.stage2 WHERE pub is true" _
155 " and owner != " _ user.id() _ " ORDER BY create_date DESC";
157 q = q _ ' LIMIT ' _ limit;
162 INCLUDE show_templates;
166 BLOCK show_templates;
167 WRAPPER html/table width='100%';
169 INCLUDE html/cell content='Public' nowrap='nowrap' col='lightgray';
170 INCLUDE html/cell content='Template Name' nowrap='nowrap' col='lightgray';
171 INCLUDE html/cell content='Created at' nowrap='nowrap' col='lightgray';
173 FOR template = DBI.query(q);
180 p = utils.JSON2perl( template.params );
181 INCLUDE html/cell content=(template.pub ? 'Y' : 'N') col=bg;
182 INCLUDE html/cell content=link(content=p.templatename,href="stage2?id=$tid") col=bg;
183 INCLUDE html/cell content=template.create_date.chunk(10).0 col=bg;
184 INCLUDE html/cell content=template.recurrence col=bg;
191 WRAPPER html/table width='100%';
193 INCLUDE html/cell content='Fact table' nowrap='nowrap' col='lightgray';
194 INCLUDE html/cell content='Description' nowrap='nowrap' col='lightgray';
196 FOR tab IN config.findnodes("/reporter/tables/table[@fact-table='true']");
197 tid = tab.findvalue('@id');
203 p = utils.JSON2perl( template.params );
206 content=link(content=tab.findvalue('tablename'),href="stage1?id=$tid");
207 INCLUDE html/cell content=tab.findvalue('description');