You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If <parenttype>.table_columns exists in the [subtickets] section of trac.ini, it lists columns to show. If missing, the old default behavior is preserved.
diff --git a/tracsubtickets/web_ui.py b/tracsubtickets/web_ui.py
index c619e90..57f2b41 100644
--- a/tracsubtickets/web_ui.py
+++ b/tracsubtickets/web_ui.py
@@ -149,28 +149,37 @@ class SubTicketsModule(Component):
tbody = tag.tbody()
div.append(tag.table(tbody, class_='subtickets'))
+ columns = self.config.getlist('subtickets', '%s.table_columns' %
+
# tickets
def _func(children, depth=0):
for id in sorted(children, key=lambda x: int(x)):
ticket = Ticket(self.env, id)
- # 1st column
+ # The row
+ r=[]
+
+ # Always show the ID and summary
attrs = {'href': req.href.ticket(id)}
if ticket['status'] == 'closed':
attrs['class_'] = 'closed'
link = tag.a('#%s' % id, **attrs)
summary = tag.td(link, ': %s' % ticket['summary'],
style='padding-left: %dpx;' % (depth * 15))
- # 2nd column
- type = tag.td(ticket['type'])
- # 3rd column
- status = tag.td(ticket['status'])
- # 4th column
- href = req.href.query(status='!closed',
+ r.append(summary)
+
+ # Add other columns as configured.
+ for column in columns:
+ if column == 'owner':
+ href = req.href.query(status='!closed',
owner=ticket['owner'])
- owner = tag.td(tag.a(ticket['owner'], href=href))
+ e = tag.td(tag.a(ticket['owner'], href=href))
+ else:
+ e = tag.td(ticket[column])
+
+ r.append(e)
- tbody.append(tag.tr(summary, type, status, owner))
+ tbody.append(tag.tr(*r))
_func(children[id], depth + 1)
_func(data['subtickets'])
The text was updated successfully, but these errors were encountered:
If
<parenttype>.table_columns
exists in the [subtickets] section of trac.ini, it lists columns to show. If missing, the old default behavior is preserved.The text was updated successfully, but these errors were encountered: