Ticket #9125: report_patch.diff
| File report_patch.diff, 8.0 KB (added by Carsten Klein <carsten.klein@…>, 2 years ago) |
|---|
-
branches/ReportPatch/trac/ticket/report.py
436 436 header_groups.append([]) 437 437 header_group.append(header) 438 438 439 maxcols = 0 440 for header_group in header_groups: 441 numhidden = 0 442 numcols = 0 443 for header in header_group: 444 if header['hidden']: 445 numhidden += 1 446 else: 447 numcols += 1 448 maxcols = numcols > maxcols and numcols or maxcols 449 i = 1 450 for header in header_group: 451 header['numhidden'] = numhidden 452 header['grpindex'] = i 453 i += 1 454 439 455 # Structure the rows and cells: 440 456 # - group rows according to __group__ value, if defined 441 457 # - group cells the same way headers are grouped -
branches/ReportPatch/trac/ticket/templates/report_view.html
+
96 96 </h2> 97 97 <table class="listing tickets"> 98 98 <thead> 99 <tr py:for="header_group in header_groups"> 100 <th py:for="header in header_group" py:if="not header.hidden" py:with="fullrow = header is header_group[-1]" 101 colspan="${fullrow and '100' or None}"> 99 <tr py:for="header_group in header_groups" py:if="not (header_group[0].hidden and len(header_group)==1)"> 100 <th py:for="header in header_group" py:if="not header.hidden" 101 py:with="fullrow = header is header_group[-1]; 102 grpnumcols = len(header_group); 103 curcol = header.grpindex; 104 grpnumhidden = header.numhidden; 105 colspan = (grpnumcols - grpnumhidden < maxcols and curcol == grpnumcols) and (maxcols - curcol + grpnumhidden + 1) or 1;" 106 colspan="$colspan"> 102 107 <a py:strip="not sorting_enabled" 103 108 py:with="filtered_args = dict([(k,v) for k,v in args.items() if k not in ('sort', 'asc')])" 104 109 href="${href.report(report.id, filtered_args, sort=header.col, asc=not header.asc and '1' or '0')}"> … … 108 113 </tr> 109 114 </thead> 110 115 111 <tbody> 112 <py:for each="row in row_group"> 116 <tbody py:for="row in row_group"> 113 117 <tr py:for="cell_group in row.cell_groups" 118 py:if="not (cell_group[0].header.hidden and len(cell_group) == 1)" 114 119 py:with="fullrow = len(cell_group) == 1; 115 td_attrs = fullrow and {'class': 'fullrow', 'colspan': 100} or {}" 120 grpnumcols = len(cell_group); 121 td_attrs = fullrow and {'class': 'fullrow', 'colspan': maxcols} or {}; 122 td_attrs = fullrow and {'colspan': maxcols} or {}" 116 123 class="${'__color__' in row and 'color'+row.__color__+'-' or ''}${row.__idx__ % 2 and 'odd' or 'even'}" 117 124 style="${'__bgcolor__' in row and 'background: '+row.__bgcolor__+';' or None 118 125 }${'__fgcolor__' in row and 'color: '+row.__fgcolor__+';' or None … … 120 127 }${fullrow and 'border: none; padding: 0;' or None}"> 121 128 122 129 <py:for each="cell in cell_group"> 123 <py:if test="not cell.header.hidden"> 124 <py:with vars="col = cell.header.col.strip('_')"> 130 <py:if test="not cell.header.hidden"> 131 <py:with vars="col = cell.header.col.strip('_'); 132 curcol = cell.header.grpindex; 133 grpnumhidden = cell.header.numhidden; 134 colspan_last = (grpnumcols - grpnumhidden < maxcols) and (maxcols - curcol + grpnumhidden + 1) or 1; 135 td_attrs = (not fullrow and ( curcol == grpnumcols )) and {'colspan': colspan_last} or td_attrs;"> 125 136 <py:choose> 126 137 127 138 <py:when test="col == 'report'"> 128 139 <td class="$col" py:attrs="td_attrs"> 129 140 <a title="View report" href="${href.report(cell.value)}">{$cell.value}</a> 130 < hr py:if="fullrow"/>141 <!-- ! <hr py:if="fullrow"/> --> 131 142 </td> 132 143 </py:when> 133 144 134 145 <py:when test="col in ('ticket', 'id')"> 135 146 <td class="ticket" py:attrs="td_attrs"> 136 147 <a title="View ${row.resource.realm}" href="${url_of(row.resource)}">#$cell.value</a> 137 < hr py:if="fullrow"/>148 <!-- ! <hr py:if="fullrow"/> --> 138 149 </td> 139 150 </py:when> 140 151 141 152 <py:when test="col == 'summary' and row.id"> 142 153 <td class="$col" py:attrs="td_attrs"> 143 154 <a title="View ${row.resource.realm}" href="${url_of(row.resource)}">$cell.value</a> 144 < hr py:if="fullrow"/>155 <!-- ! <hr py:if="fullrow"/> --> 145 156 </td> 146 157 </py:when> 147 158 148 159 <!--! generic fields --> 149 160 <py:when test="col == 'time'"> 150 161 <td class="date" py:attrs="td_attrs">${cell.value != '' and format_time(int(cell.value)) or '--'} 151 < hr py:if="fullrow"/>162 <!-- ! <hr py:if="fullrow"/> --> 152 163 </td> 153 164 </py:when> 154 165 155 166 <py:when test="col in ('date', 'created', 'modified')"> 156 167 <td class="date" py:attrs="td_attrs">${cell.value != '' and format_date(int(cell.value)) or '--'} 157 < hr py:if="fullrow"/>168 <!-- ! <hr py:if="fullrow"/> --> 158 169 </td> 159 170 </py:when> 160 171 161 172 <py:when test="col == 'datetime'"> 162 173 <td class="date" py:attrs="td_attrs">${cell.value != '' and format_datetime(int(cell.value)) or '--'} 163 < hr py:if="fullrow"/>174 <!-- ! <hr py:if="fullrow"/> --> 164 175 </td> 165 176 </py:when> 166 177 167 178 <py:when test="col == 'description'"> 168 179 <td class="$col" py:attrs="td_attrs" xml:space="preserve"> 169 180 ${wiki_to_html(context(row.resource), cell.value)} 170 < hr py:if="fullrow"/>181 <!-- ! <hr py:if="fullrow"/> --> 171 182 </td> 172 183 </py:when> 173 184 174 185 <py:when test="col == 'milestone'"> 175 186 <td class="$col" py:attrs="td_attrs"> 176 187 <a title="View milestone" href="${href.milestone(cell.value)}">$cell.value</a> 177 < hr py:if="fullrow"/>188 <!-- ! <hr py:if="fullrow"/> --> 178 189 </td> 179 190 </py:when> 180 191 181 192 <py:otherwise> 182 193 <td class="$col" py:attrs="td_attrs">$cell.value 183 < hr py:if="fullrow"/>194 <!-- ! <hr py:if="fullrow"/> --> 184 195 </td> 185 196 </py:otherwise> 186 197 … … 189 200 </py:if> 190 201 </py:for> 191 202 </tr> 192 </py:for>193 203 </tbody> 194 204 </table> 195 205 </py:for>
