root/trac-0.10.3/templates/report.cs

Revision 173, 8.8 kB (checked in by cedenoj, 10 months ago)

refs #2723 Adding the project name to the right of the bs logo on the orange bar. Also adding the o.e logo to the right side of the orange bar. A link to create a new ticket is added to the top section of the first report

Line 
1 <?cs include "header.cs" ?>
2 <?cs include "macros.cs" ?>
3
4 <div id="ctxtnav" class="nav">
5  <h2>Report Navigation</h2>
6  <ul><li class="first"><?cs
7    if:chrome.links.up.0.href ?><a href="<?cs
8     var:chrome.links.up.0.href ?>">Available Reports</a><?cs
9    else ?>Available Reports<?cs
10   /if ?></li><?cs
11   if:report.query_href ?><li class="last"><a href="<?cs
12    var:report.query_href ?>">Custom Query</a></li><?cs
13   /if ?></ul>
14 </div>
15
16 <div id="content" class="report">
17
18  <?cs def:report_hdr(header) ?>
19    <?cs if $header ?>
20      <?cs if idx > 0 ?>
21        </table>
22      <?cs /if ?>
23    <?cs /if ?>
24    <?cs if:header ?><h2><?cs var:header ?></h2><?cs /if ?>
25    <?cs if $report.id == -1 ?>
26      <table class="listing reports">
27    <?cs else ?>
28      <table class="listing tickets">
29    <?cs /if ?>
30     <thead>
31      <tr>
32        <?cs set numcols = #0 ?>
33        <?cs each header = report.headers ?>
34          <?cs if $header.fullrow ?>
35            </tr><tr><th colspan="100"><?cs var:header ?></th>
36          <?cs else ?>
37            <?cs if $report.sorting.enabled ?>
38              <?cs set vars='' ?>
39              <?cs each arg = report.var ?>
40                <?cs set vars = vars + '&amp;' + name(arg) + '=' + arg ?>
41              <?cs /each ?>
42              <?cs set sortValue = '' ?>
43              <?cs if $header.asc == '1' ?>
44                <?cs set sortValue = '?sort='+$header.real+'&amp;asc=0' ?>
45              <?cs else ?>
46                <?cs set sortValue = '?sort='+$header.real+'&amp;asc=1' ?>
47              <?cs /if ?>
48              <?cs if $header ?>
49              <th><a href="<?cs var:sortValue ?><?cs var:vars ?>"><?cs var:header ?></a></th>
50              <?cs /if ?>
51            <?cs elif $header ?>
52              <th><?cs var:header ?></th>
53            <?cs /if ?>
54            <?cs if $header.breakrow ?>
55               </tr><tr>
56            <?cs /if ?>
57          <?cs /if ?>
58          <?cs set numcols = numcols + #1 ?>
59        <?cs /each ?>
60      </tr>
61     </thead>
62  <?cs /def ?>
63  
64  <?cs def:report_cell(class,contents) ?>
65    <?cs if $cell.fullrow ?>
66      </tr><tr class="<?cs var:row_class ?>" style="<?cs var: row_style ?>;border: none; padding: 0;">
67       <td class="fullrow" colspan="100">
68        <?cs var:$contents ?><hr />
69       </td>
70    <?cs else ?>
71    <td <?cs if $cell.breakrow || $col == $numcols ?>colspan="100" <?cs /if
72  ?>class="<?cs var:$class ?>"><?cs if $contents ?><?cs var:$contents ?><?cs /if ?></td>
73  
74  <?cs if $cell.breakafter ?>
75      </tr><tr class="<?cs var: row_class ?>" style="<?cs var: row_style ?>;border: none; padding: 0">
76  <?cs /if ?>
77    <?cs /if ?>
78    <?cs set col = $col + #1 ?>
79  <?cs /def ?>
80  
81  <?cs set idx = #0 ?>
82  <?cs set group = '' ?>
83  
84  <?cs if:report.mode == "list" ?>
85   <h1><?cs var:title ?><?cs
86    if:report.numrows && report.id != -1 ?><span class="numrows"> (<?cs
87     var:report.numrows ?> matches)</span><?cs
88    /if ?></h1><?cs
89    if:report.description ?><div id="description"><?cs
90     var:report.description ?></div><?cs
91    /if ?><?cs
92    if:report.id != -1 ?><?cs
93     if:report.can_create || report.can_modify || report.can_delete ?>
94      <div class="buttons"><?cs
95       if:report.can_modify ?><form action="" method="get"><div>
96        <input type="hidden" name="action" value="edit" />
97        <input type="submit" value="Edit report" accesskey="e" />
98       </div></form><?cs /if ?><?cs
99       if:report.can_create ?><form action="" method="get"><div>
100        <input type="hidden" name="action" value="copy" />
101        <input type="submit" value="Copy report" />
102       </div></form><?cs /if ?><?cs
103       if:report.can_delete ?><form action="" method="get"><div>
104        <input type="hidden" name="action" value="delete" />
105        <input type="submit" value="Delete report" />
106       </div></form><?cs /if ?>
107  <form action="../newticket" method="get"><div>
108   <input type="submit" value="Create new ticket" />
109  </div></form>
110      </div><?cs
111     /if ?><?cs
112    /if ?>
113
114      <?cs each row = report.items ?>
115        <?cs if group != row.__group__ || idx == #0 ?>
116          <?cs if:idx != #0 ?></tbody><?cs /if ?>
117          <?cs set group = row.__group__ ?>
118          <?cs call:report_hdr(group) ?>
119          <tbody>
120        <?cs /if ?>
121
122        <?cs if row.__color__ ?>
123          <?cs set rstem='color'+$row.__color__ +'-' ?>
124        <?cs else ?>
125         <?cs set rstem='' ?>
126        <?cs /if ?>
127        <?cs if idx % #2 ?>
128          <?cs set row_class=$rstem+'even' ?>
129        <?cs else ?>
130          <?cs set row_class=$rstem+'odd' ?>
131        <?cs /if ?>
132
133        <?cs set row_style='' ?>
134        <?cs if row.__bgcolor__ ?>
135          <?cs set row_style='background: ' + row.__bgcolor__ + ';' ?>
136        <?cs /if ?>
137        <?cs if row.__fgcolor__ ?>
138          <?cs set row_style=$row_style + 'color: ' + row.__fgcolor__ + ';' ?>
139        <?cs /if ?>
140        <?cs if row.__style__ ?>
141          <?cs set row_style=$row_style + row.__style__ + ';' ?>
142        <?cs /if ?>
143
144        <tr class="<?cs var: row_class ?>" style="<?cs var: row_style ?>">
145        <?cs set idx = idx + #1 ?>
146        <?cs set col = #0 ?>
147        <?cs each cell = row ?>
148          <?cs if cell.hidden || cell.hidehtml ?>
149          <?cs elif name(cell) == "ticket" || name(cell) == "id" ?>
150            <?cs call:report_cell('ticket',
151                                  '<a title="View ticket" href="'+
152                                  $cell.ticket_href+'">#'+$cell+'</a>') ?>
153          <?cs elif name(cell) == "summary" && cell.ticket_href ?>
154            <?cs call:report_cell('summary', '<a title="View ticket" href="'+
155                                  $cell.ticket_href+'">'+$cell+'</a>') ?>
156          <?cs elif name(cell) == "report" ?>
157            <?cs call:report_cell('report',
158                 '<a title="View report" href="'+$cell.report_href+'">{'+$cell+'}</a>') ?>
159            <?cs set:report_href=$cell.report_href ?>
160          <?cs elif name(cell) == "time" ?>
161            <?cs call:report_cell('date', $cell.date) ?>
162          <?cs elif name(cell) == "date" || name(cell) == "created" || name(cell) == "modified" ?>
163            <?cs call:report_cell('date', $cell.date) ?>
164          <?cs elif name(cell) == "datetime"  ?>
165            <?cs call:report_cell('date', $cell.datetime) ?>
166          <?cs elif name(cell) == "description" ?>
167            <?cs call:report_cell('', $cell.parsed) ?>
168          <?cs elif name(cell) == "title" && $report.id == -1 ?>
169            <?cs call:report_cell('title',
170                                  '<a  title="View report" href="'+
171                                  $report_href+'">'+$cell+'</a>') ?>
172          <?cs else ?>
173            <?cs call:report_cell(name(cell), $cell) ?>
174          <?cs /if ?>
175        <?cs /each ?>
176        </tr>
177      <?cs /each ?>
178     </tbody>
179    </table><?cs
180    if:report.id == -1 && report.can_create?><div class="buttons">
181     <form action="" method="get"><div>
182      <input type="hidden" name="action" value="new" />
183      <input type="submit" value="Create new report" />
184     </div></form></div><?cs
185    /if ?><?cs
186    if report.message ?>
187     <div class="system-message"><?cs var report.message ?></div><?cs
188    elif:idx == #0 ?>
189     <div id="report-notfound">No matches found.</div><?cs
190    /if ?>
191
192  <?cs elif:report.mode == "delete" ?>
193
194   <h1><?cs var:title ?></h1>
195   <form action="<?cs var:report.href ?>" method="post">
196    <input type="hidden" name="id" value="<?cs var:report.id ?>" />
197    <input type="hidden" name="action" value="delete" />
198    <p><strong>Are you sure you want to delete this report?</strong></p>
199    <div class="buttons">
200     <input type="submit" name="cancel" value="Cancel" />
201     <input type="submit" value="Delete report" />
202    </div>
203   </form>
204  
205  <?cs elif:report.mode == "edit" ?>
206  
207    <h1><?cs var:title ?></h1>
208    <form action="<?cs var:report.href ?>" method="post">
209     <div>
210      <input type="hidden" name="action" value="<?cs var:report.action ?>" />
211      <div class="field">
212       <label for="title">Report Title:</label><br />
213       <input type="text" id="title" name="title"
214              value="<?cs var:report.title ?>" size="50" /><br />
215      </div>
216      <div class="field">
217       <label for="description">
218        Description:</label> (You may use <a tabindex="42" href="<?cs
219          var:$trac.href.wiki ?>/WikiFormatting">WikiFormatting</a> here)
220       </label><br />
221       <textarea id="description" name="description" class="wikitext" rows="10" cols="78">
222 <?cs var:report.description ?></textarea>
223      </div>
224      <div class="field">
225       <label for="query">
226        SQL Query for Report:</label><br />
227       <textarea id="query" name="query" cols="85" rows="20"><?cs
228         var:report.sql ?></textarea>
229      </div>
230      <div class="buttons">
231       <input type="submit" value="Save report" />
232       <input type="submit" name="cancel" value="Cancel" />
233      </div>
234     </div>
235     <script type="text/javascript" src="<?cs
236       var:htdocs_location ?>js/wikitoolbar.js"></script>
237    </form>
238  <?cs /if?>
239  
240  <div id="help">
241   <strong>Note:</strong> See <a href="<?cs
242     var:trac.href.wiki ?>/TracReports">TracReports</a> for help on using and
243   creating reports.
244  </div>
245  
246 </div>
247 <?cs include "footer.cs" ?>
Note: See TracBrowser for help on using the browser.