diff --git a/trac/htdocs/css/report.css b/trac/htdocs/css/report.css
|
a
|
b
|
|
| 50 | 50 | /* Styles for the report list and the report results table |
| 51 | 51 | (extends the styles for "table.listing") */ |
| 52 | 52 | .reports td.title { width: 100% } |
| 53 | | .reports tbody td :link, .reports tbody td :visited, |
| 54 | | .tickets tbody td :link, .tickets tbody td :visited { display: block } |
| 55 | 53 | .tickets { border-bottom: none } |
| 56 | 54 | .tickets thead th { text-transform: capitalize; white-space: nowrap; } |
| 57 | 55 | .tickets tbody td, .reports tbody td { padding: .1em .5em !important } |
diff --git a/trac/htdocs/css/ticket.css b/trac/htdocs/css/ticket.css
|
a
|
b
|
|
| 56 | 56 | width: 20%; |
| 57 | 57 | } |
| 58 | 58 | #ticket table.properties td { width: 30% } |
| | 59 | #ticket table.properties td p:first-child { margin-top: 0 } |
| | 60 | #ticket table.properties td p:last-child { margin-bottom: 0 } |
| 59 | 61 | #ticket table.properties .description { border-top: 1px solid #dd9 } |
| 60 | 62 | |
| 61 | 63 | #ticket .description h3 { |
diff --git a/trac/ticket/api.py b/trac/ticket/api.py
|
a
|
b
|
|
| 271 | 271 | if '' in field['options']: |
| 272 | 272 | field['optional'] = True |
| 273 | 273 | field['options'].remove('') |
| | 274 | elif field['type'] == 'text': |
| | 275 | field['format'] = config.get(name + '.format', 'plain') |
| 274 | 276 | elif field['type'] == 'textarea': |
| | 277 | field['format'] = config.get(name + '.format', 'plain') |
| 275 | 278 | field['width'] = config.getint(name + '.cols') |
| 276 | 279 | field['height'] = config.getint(name + '.rows') |
| 277 | 280 | fields.append(field) |
diff --git a/trac/ticket/query.py b/trac/ticket/query.py
|
a
|
b
|
|
| 575 | 575 | |
| 576 | 576 | cols = self.get_columns() |
| 577 | 577 | labels = dict([(f['name'], f['label']) for f in self.fields]) |
| | 578 | wikify = dict((f['name'], f['type'] == 'text' and f.get('format') == 'wiki') for f in self.fields) |
| 578 | 579 | |
| 579 | 580 | # TODO: remove after adding time/changetime to the api.py |
| 580 | 581 | labels['changetime'] = _('Modified') |
| … |
… |
|
| 582 | 583 | |
| 583 | 584 | headers = [{ |
| 584 | 585 | 'name': col, 'label': labels.get(col, _('Ticket')), |
| | 586 | 'wikify': wikify.get(col, False), |
| 585 | 587 | 'href': self.get_href(context.href, order=col, |
| 586 | 588 | desc=(col == self.order and not self.desc)) |
| 587 | 589 | } for col in cols] |
diff --git a/trac/ticket/templates/query_results.html b/trac/ticket/templates/query_results.html
|
a
|
b
|
|
| 62 | 62 | <py:when test="name == 'reporter'">${authorinfo(value)}</py:when> |
| 63 | 63 | <py:when test="name == 'cc'">${format_emails(ticket_context, value)}</py:when> |
| 64 | 64 | <py:when test="name == 'owner' and value">${authorinfo(value)}</py:when> |
| | 65 | <py:when test="header.wikify">${wiki_to_oneliner(ticket_context, value)}</py:when> |
| 65 | 66 | <py:otherwise>$value</py:otherwise> |
| 66 | 67 | </td> |
| 67 | 68 | </py:with> |
diff --git a/trac/ticket/templates/ticket.html b/trac/ticket/templates/ticket.html
|
a
|
b
|
|
| 155 | 155 | colspan="${fullrow and 3 or None}"> |
| 156 | 156 | <py:if test="field"> |
| 157 | 157 | <py:choose test=""> |
| 158 | | <py:when test="'rendered' in field">${field.rendered}</py:when> |
| 159 | | <py:otherwise>${ticket[field.name]}</py:otherwise> |
| | 158 | <py:when test="field.type == 'textarea' and field.format == 'wiki'"> |
| | 159 | ${wiki_to_html(context, ticket[field.name], escape_newlines=preserve_newlines)} |
| | 160 | </py:when> |
| | 161 | <py:when test="field.type == 'text' and field.format == 'wiki'"> |
| | 162 | ${wiki_to_oneliner(context, ticket[field.name])} |
| | 163 | </py:when> |
| | 164 | <py:otherwise> |
| | 165 | <py:choose test=""> |
| | 166 | <py:when test="'rendered' in field">${field.rendered}</py:when> |
| | 167 | <py:otherwise>${ticket[field.name]}</py:otherwise> |
| | 168 | </py:choose> |
| | 169 | </py:otherwise> |
| 160 | 170 | </py:choose> |
| 161 | 171 | </py:if> |
| 162 | 172 | </td> |
| … |
… |
|
| 324 | 334 | </select> |
| 325 | 335 | <textarea py:when="'textarea'" id="field-${field.name}" name="field_${field.name}" |
| 326 | 336 | cols="${field.width}" rows="${field.height}" |
| | 337 | class="${field.format == 'wiki' and 'wikitext' or None}" |
| 327 | 338 | py:content="value"></textarea> |
| 328 | 339 | <span py:when="'checkbox'"> |
| 329 | 340 | <input type="checkbox" id="field-${field.name}" name="field_${field.name}" |
diff --git a/trac/ticket/tests/api.py b/trac/ticket/tests/api.py
|
a
|
b
|
|
| 24 | 24 | self.env.config.set('ticket-custom', 'test', 'text') |
| 25 | 25 | self.env.config.set('ticket-custom', 'test.label', 'Test') |
| 26 | 26 | self.env.config.set('ticket-custom', 'test.value', 'Foo bar') |
| | 27 | self.env.config.set('ticket-custom', 'test.format', 'wiki') |
| 27 | 28 | fields = TicketSystem(self.env).get_custom_fields() |
| 28 | 29 | self.assertEqual({'name': 'test', 'type': 'text', 'label': 'Test', |
| 29 | | 'value': 'Foo bar', 'order': 0}, |
| | 30 | 'value': 'Foo bar', 'order': 0, 'format': 'wiki'}, |
| 30 | 31 | fields[0]) |
| 31 | 32 | |
| 32 | 33 | def test_custom_field_select(self): |
| … |
… |
|
| 57 | 58 | self.env.config.set('ticket-custom', 'test.value', 'Foo bar') |
| 58 | 59 | self.env.config.set('ticket-custom', 'test.cols', '60') |
| 59 | 60 | self.env.config.set('ticket-custom', 'test.rows', '4') |
| | 61 | self.env.config.set('ticket-custom', 'test.format', 'wiki') |
| 60 | 62 | fields = TicketSystem(self.env).get_custom_fields() |
| 61 | 63 | self.assertEqual({'name': 'test', 'type': 'textarea', 'label': 'Test', |
| 62 | 64 | 'value': 'Foo bar', 'width': 60, 'height': 4, |
| 63 | | 'order': 0}, |
| | 65 | 'order': 0, 'format': 'wiki'}, |
| 64 | 66 | fields[0]) |
| 65 | 67 | |
| 66 | 68 | def test_custom_field_order(self): |