| 91 | | <table class="properties" |
| 92 | | py:with="fields = [f for f in fields if not f.skip]"> |
| 93 | | <tr> |
| 94 | | <th id="h_reporter">Reported by:</th> |
| 95 | | <td headers="h_reporter" class="searchable">${authorinfo(ticket.reporter)}</td> |
| 96 | | <th id="h_owner">Assigned to:</th> |
| 97 | | <td headers="h_owner">${authorinfo(ticket.owner)} |
| 98 | | <py:if test="ticket.status == 'assigned'">(accepted)</py:if> |
| 99 | | </td> |
| 100 | | </tr> |
| 101 | | <tr py:for="row in group(fields, 2, lambda f: f.type != 'textarea')" |
| 102 | | py:with="fullrow = len(row) == 1"> |
| 103 | | <py:for each="idx, field in enumerate(row)"> |
| 104 | | <th py:if="idx == 0 or not fullrow"> |
| 105 | | <py:if test="field">${field.label or field.name}:</py:if> |
| 106 | | </th> |
| 107 | | <td py:if="idx == 0 or not fullrow" |
| | 77 | <!-- Ticket (pre)view --> |
| | 78 | <div id="ticket" py:attrs="preview and {'class':'ticketdraft'}"> |
| | 79 | |
| | 80 | <!--! created/last modified --> |
| | 81 | <div class="date"> |
| | 82 | <p py:if="opened">Opened ${dateinfo(opened)} ago</p> |
| | 83 | <p py:if="lastmod">Last modified ${dateinfo(lastmod)} ago</p> |
| | 84 | <p py:if="not opened"><i>(not yet created)</i></p> |
| | 85 | </div> |
| | 86 | |
| | 87 | <!--! summary --> |
| | 88 | <h2 class="summary searchable" py:choose=""> |
| | 89 | <py:when test="ticket.summary">${ticket.summary}<br /></py:when> |
| | 90 | <py:otherwise>Summary: </py:otherwise> |
| | 91 | <input py:attrs="edit and {'type': 'text', 'size': '70'} or {'type': 'hidden'}" |
| | 92 | id="field-summary" name="field_summary" value="${ticket.summary}" /> |
| | 93 | </h2> |
| | 94 | |
| | 95 | <table class="properties" |
| | 96 | py:with="fields = [f for f in fields if not f.skip]"> |
| | 97 | <tr> |
| | 98 | <th id="h_reporter">Reported by:</th> |
| | 99 | <td headers="h_reporter" class="searchable">${authorinfo(ticket.reporter)}</td> |
| | 100 | <th id="h_owner">Assigned to:</th> |
| | 101 | <td headers="h_owner">${authorinfo(ticket.owner)} |
| | 102 | <py:if test="ticket.status == 'assigned'">(accepted)</py:if> |
| | 103 | </td> |
| | 104 | </tr> |
| | 105 | <tr py:for="row in group(fields, 2, lambda f: f.type != 'textarea')" |
| | 106 | py:with="fullrow = len(row) == 1"> |
| | 107 | <py:for each="idx, field in enumerate(row)"> |
| | 108 | <th py:if="idx == 0 or not fullrow"> |
| | 109 | <py:if test="field">${field.label or field.name}:</py:if> |
| | 110 | </th> |
| | 111 | <td py:if="idx == 0 or not fullrow" |
| 110 | | <py:if test="field">${ticket[field.name]}</py:if> |
| 111 | | </td> |
| 112 | | </py:for> |
| 113 | | </tr> |
| 114 | | </table> |
| 115 | | <form py:if="ticket.description" method="get" action="#comment" |
| 116 | | class="printableform"> |
| 117 | | <div class="description"> |
| 118 | | <h3 id="comment:description"> |
| 119 | | <!-- check ticket.id; you can't reply to a ticket that does not yet exist. --> |
| 120 | | <span py:if="'TICKET_APPEND' in perm and ticket.id" class="inlinebuttons"> |
| 121 | | <input type="hidden" name="replyto" value="description" /> |
| 122 | | <input type="submit" name="reply" value="Reply" title="Reply, quoting this description" /> |
| 123 | | </span> |
| 124 | | Description |
| 125 | | <span py:if="description_change" class="lastmod" |
| 126 | | title="$description_change.date"> |
| 127 | | (last modified by ${authorinfo(description_change.author)}) |
| 128 | | (<a href="${href.ticket(ticket.id, action='diff', version=description_change.cnum)}">diff</a>) |
| 129 | | </span> |
| 130 | | </h3> |
| 131 | | <div class="searchable"> |
| 132 | | ${wiki_to_html(context, ticket.description)} |
| | 114 | <py:if test="field"> |
| | 115 | <input py:if="preview" type="hidden" id="field-${field.name}" |
| | 116 | name="field_${field.name}" value="${ticket[field.name]}" /> |
| | 117 | <py:if test="ticket.id">${ticket[field.name]} <br /></py:if> |
| | 118 | <py:choose test="edit and field.type"> |
| | 119 | <py:when test="False" /> |
| | 120 | <select py:when="'select'" id="field-${field.name}" name="field_${field.name}"> |
| | 121 | <option py:if="field.optional"></option> |
| | 122 | <option py:for="option in field.options" |
| | 123 | selected="${ticket[field.name] == option or None}" |
| | 124 | py:content="option"></option> |
| | 125 | </select> |
| | 126 | <textarea py:when="'textarea'" id="field-${field.name}" name="field_${field.name}" |
| | 127 | cols="${field.width}" rows="${field.height}" |
| | 128 | py:content="ticket[field.name]"></textarea> |
| | 129 | <span py:when="'checkbox'"> |
| | 130 | <input type="checkbox" id="field-${field.name}" name="field_${field.name}" |
| | 131 | checked="${ticket[field.name] == '1' and 'checked' or None}" value="1" /> |
| | 132 | <input type="hidden" name="field_checkbox_${field.name}" value="1" /> |
| | 133 | </span> |
| | 134 | <label py:when="'radio'" |
| | 135 | py:for="idx, option in enumerate(field.options)"> |
| | 136 | <input type="radio" name="field_${field.name}" value="${option}" |
| | 137 | checked="${ticket[field.name] == option or None}" /> |
| | 138 | ${option} |
| | 139 | </label> |
| | 140 | <input py:otherwise="" type="text" id="field-${field.name}" |
| | 141 | name="field_${field.name}" value="${ticket[field.name]}" /> |
| | 142 | </py:choose> |
| | 143 | </py:if> |
| | 144 | </td> |
| | 145 | </py:for> |
| | 146 | </tr> |
| | 147 | </table> |
| | 148 | <form py:strip="edit or preview" method="get" action="#comment" |
| | 149 | class="printableform"> |
| | 150 | <div class="description"> |
| | 151 | <h3 id="comment:description"> |
| | 152 | <!-- check ticket.id; you can't reply to a ticket that does not yet exist. --> |
| | 153 | <span py:if="'TICKET_APPEND' in perm and ticket.id and not edit" class="inlinebuttons"> |
| | 154 | <input type="hidden" name="replyto" value="description" /> |
| | 155 | <input type="submit" name="reply" value="Reply" title="Reply, quoting this description" /> |
| | 156 | </span> |
| | 157 | Description |
| | 158 | <py:choose test=""> |
| | 159 | <py:when test="edit"> |
| | 160 | (you may use <a tabindex="42" class="lastmod" href="${href.wiki('WikiFormatting')}">WikiFormatting</a> here): |
| | 161 | </py:when> |
| | 162 | <span py:otherwise="" py:if="description_change" class="lastmod" |
| | 163 | title="$description_change.date"> |
| | 164 | (last modified by ${authorinfo(description_change.author)}) |
| | 165 | (<a href="${href.ticket(ticket.id, action='diff', version=description_change.cnum)}">diff</a>) |
| | 166 | </span> |
| | 167 | </py:choose> |
| | 168 | </h3> |
| | 169 | <div class="searchable" py:choose=""> |
| | 170 | <py:if test="ticket.description">${wiki_to_html(context, ticket.description)}</py:if> |
| | 171 | <py:choose> |
| | 172 | <textarea py:when="edit" |
| | 173 | id="field-description" name="field_description" class="wikitext" |
| | 174 | rows="10" cols="68" py:content="ticket.description" /> |
| | 175 | <input py:otherwise="" type="hidden" id="field-description" name="field_description" |
| | 176 | value="ticket.description" /> |
| | 177 | </py:choose> |
| | 178 | </div> |
| 248 | | <fieldset id="properties" py:if="'TICKET_CHGPROP' in req.perm or ('TICKET_CREATE' in req.perm and not ticket.id)" |
| 249 | | py:with="fields = [f for f in fields if not f.skip]"> |
| 250 | | <legend>Change Properties</legend> |
| 251 | | <table> |
| 252 | | <tr> |
| 253 | | <th><label for="field-summary">Summary:</label></th> |
| 254 | | <td class="fullrow" colspan="3"> |
| 255 | | <input type="text" id="field-summary" name="field_summary" value="${ticket.summary}" |
| 256 | | size="70" /> |
| 257 | | </td> |
| 258 | | </tr> |
| 259 | | <py:if test="'TICKET_ADMIN' in perm"> |
| 260 | | <tr> |
| 261 | | <th><label for="field-reporter">Reporter:</label></th> |
| 262 | | <td class="fullrow" colspan="3"> |
| 263 | | <input type="text" id="field-reporter" name="field_reporter" |
| 264 | | value="${ticket.reporter}" size="70" /> |
| 265 | | </td> |
| 266 | | </tr> |
| 267 | | </py:if> |
| 268 | | <py:if test="'TICKET_ADMIN' in perm or not ticket.id"> |
| 269 | | <tr> |
| 270 | | <th><label for="field-description">Description:</label></th> |
| 271 | | <td class="fullrow" colspan="3"> |
| 272 | | <textarea id="field-description" name="field_description" class="wikitext" |
| 273 | | rows="10" cols="68" py:content="ticket.description"></textarea> |
| 274 | | </td> |
| 275 | | </tr> |
| 276 | | </py:if> |
| 277 | | <tr py:for="row in group(fields, 2, lambda f: f.type != 'textarea')" |
| 278 | | py:with="fullrow = len(row) == 1"> |
| 279 | | <py:for each="idx, field in enumerate(row)"> |
| 280 | | <th class="col${idx + 1}" py:if="idx == 0 or not fullrow"> |
| 281 | | <label for="field-${field.name}" py:if="field" |
| 282 | | py:strip="field.type == 'radio'">${field.label or field.name}:</label> |
| 283 | | </th> |
| 284 | | <td class="col${idx + 1}" py:if="idx == 0 or not fullrow" |
| 285 | | py:attrs="{'colspan': fullrow and 3 or None}"> |
| 286 | | <py:choose test="field.type" py:if="field"> |
| 287 | | <select py:when="'select'" id="field-${field.name}" name="field_${field.name}"> |
| 288 | | <option py:if="field.optional"></option> |
| 289 | | <option py:for="option in field.options" |
| 290 | | selected="${ticket[field.name] == option or None}" |
| 291 | | py:content="option"></option> |
| 292 | | </select> |
| 293 | | <textarea py:when="'textarea'" id="field-${field.name}" name="field_${field.name}" |
| 294 | | cols="${field.width}" rows="${field.height}" |
| 295 | | py:content="ticket[field.name]"></textarea> |
| 296 | | <span py:when="'checkbox'"> |
| 297 | | <input type="checkbox" id="field-${field.name}" name="field_${field.name}" |
| 298 | | checked="${ticket[field.name] == '1' and 'checked' or None}" value="1" /> |
| 299 | | <input type="hidden" name="field_checkbox_${field.name}" value="1" /> |
| 300 | | </span> |
| 301 | | <label py:when="'radio'" |
| 302 | | py:for="idx, option in enumerate(field.options)"> |
| 303 | | <input type="radio" name="field_${field.name}" value="${option}" |
| 304 | | checked="${ticket[field.name] == option or None}" /> |
| 305 | | ${option} |
| 306 | | </label> |
| 307 | | <input py:otherwise="" type="text" id="field-${field.name}" |
| 308 | | name="field_${field.name}" value="${ticket[field.name]}" /> |
| 309 | | </py:choose> |
| 310 | | </td> |
| 311 | | </py:for> |
| 312 | | </tr> |
| 313 | | </table> |
| 314 | | |
| 315 | | </fieldset> |
| 316 | | |
| | 356 | |
| | 357 | <!--! |
| | 358 | |
| | 359 | <fieldset id="properties" py:if="'TICKET_CHGPROP' in req.perm or ('TICKET_CREATE' in req.perm and not ticket.id)" |
| | 360 | py:with="fields = [f for f in fields if not f.skip]"> |
| | 361 | <legend>Change Properties</legend> |
| | 362 | <table> |
| | 363 | <py:if test="'TICKET_ADMIN' in perm"> |
| | 364 | <tr> |
| | 365 | <th><label for="field-reporter">Reporter:</label></th> |
| | 366 | <td class="fullrow" colspan="3"> |
| | 367 | <input type="text" id="field-reporter" name="field_reporter" |
| | 368 | value="${ticket.reporter}" size="70" /> |
| | 369 | </td> |
| | 370 | </tr> |
| | 371 | </py:if> |
| | 372 | <tr py:for="row in group(fields, 2, lambda f: f.type != 'textarea')" |
| | 373 | py:with="fullrow = len(row) == 1"> |
| | 374 | <py:for each="idx, field in enumerate(row)"> |
| | 375 | <th class="col${idx + 1}" py:if="idx == 0 or not fullrow"> |
| | 376 | <label for="field-${field.name}" py:if="field" |
| | 377 | py:strip="field.type == 'radio'">${field.label or field.name}:</label> |
| | 378 | </th> |
| | 379 | <td class="col${idx + 1}" py:if="idx == 0 or not fullrow" |
| | 380 | py:attrs="{'colspan': fullrow and 3 or None}"> |
| | 381 | </td> |
| | 382 | </py:for> |
| | 383 | </tr> |
| | 384 | </table> |
| | 385 | |
| | 386 | </fieldset> |
| | 387 | --> |
| | 388 | |