missing new line when under "view tickets"

45 views
Skip to first unread message

cel...@live.com.sg

unread,
Oct 8, 2013, 9:58:14 PM10/8/13
to trac-...@googlegroups.com
Hi,
 
I created a new ticket. Under description, i input data, with paragraphs (new line). However, when I click on "View Tickets" to view the list of tickets, the description in the description column does not show the content in paragraph form. Instead, it shows a whole chunk of information. How can I get it to show the data in paragraph form?
 
For instance, http://trac-hacks.org/wiki/ResourceReservationPlugin #7478 description shows a whole chunk of info. When i click into #7478, the description is actually in paragraph form. How can I get it to reflect as paragraph form at the "View Tickets"?
 
Thank you very much.

RjOllos

unread,
Oct 10, 2013, 2:33:44 PM10/10/13
to trac-...@googlegroups.com
On Tuesday, October 8, 2013 6:58:14 PM UTC-7, cel...@live.com.sg wrote:
Hi,
 
I created a new ticket. Under description, i input data, with paragraphs (new line). However, when I click on "View Tickets" to view the list of tickets, the description in the description column does not show the content in paragraph form. Instead, it shows a whole chunk of information. How can I get it to show the data in paragraph form?

Which version of Trac are you running? We can see that in 1.0.1, "Description" isn't allowed as a column, but can be shown under the ticket row in the table, and is properly wiki formatted:
http://trac-hacks.org/query?status=assigned&status=new&status=reopened&component=ResourceReservationPlugin&col=id&col=summary&col=component&col=status&col=owner&col=type&col=priority&order=priority&row=description

I'm not sure if the behavior was different in earlier Trac versions.
 
For instance, http://trac-hacks.org/wiki/ResourceReservationPlugin #7478 description shows a whole chunk of info. When i click into #7478, the description is actually in paragraph form. How can I get it to reflect as paragraph form at the "View Tickets"?

For that case, the `TicketQuery` macro is being used on the page. We can show the descriptions as rows here as well, which is a change that I made to that page:
trac-hacks.org/wiki/ResourceReservationPlugin?action=diff&version=14&old_version=13

`TicketQuery` macro doesn't prevent us from showing description as a column. The following patch will cause the description to be formatted as wiki when the description is displayed as a column:

diff --git a/trac/ticket/templates/query_results.html b/trac/ticket/templates/qu
index 4bba241..a6e9211 100644
--- a/trac/ticket/templates/query_results.html
+++ b/trac/ticket/templates/query_results.html
@@ -81,6 +81,7 @@
                       <py:when test="name == 'cc'">${format_emails(ticket_conte
                       <py:when test="name == 'owner' and value">${authorinfo(va
                       <py:when test="name == 'milestone'"><a py:if="value" titl
+                      <py:when test="name == 'description'">${wiki_to_html(tick
                       <py:when test="header.wikify">${wiki_to_oneliner(ticket_c
                       <py:otherwise>$value</py:otherwise>
                     </td>


However, since the intended use seems to be displaying the Description in a row, I'm not sure the patch should be applied.

cel...@live.com.sg

unread,
Oct 21, 2013, 10:37:52 PM10/21/13
to trac-...@googlegroups.com
Hi,
 
I am using Trac 0.12.2.
 
U mentioned that I can use TicketQuery macro to display description  as rows? How do I go about doing that for Trac 0.12.2? I am good with displaying description as rows instead of columns.
 
It seems like ticketquery does not exist in 0.12.2? http://trac.edgewall.org/wiki/0.12/TicketQuery 
 
Thank you.

Steffen Hoffmann

unread,
Oct 22, 2013, 3:39:18 PM10/22/13
to trac-...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 22.10.2013 04:37, cel...@live.com.sg wrote:
> Hi,
>
> I am using Trac 0.12.2.
>
> U mentioned that I can use TicketQuery macro to display description
> as rows? How do I go about doing that for Trac 0.12.2? I am good
> with displaying description as rows instead of columns.
>
> It seems like ticketquery does not exist in 0.12.2?
> http://trac.edgewall.org/wiki/0.12/TicketQuery

See here: http://trac.edgewall.org/wiki/0.12/TracQuery
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlJm1GAACgkQ31DJeiZFuHcDugCfahRweIXuJtsNJRpIZ0Jd0+N/
56AAnR+hAHQwJpszYV+woPOixw3XlDx8
=L375
-----END PGP SIGNATURE-----

cel...@live.com.sg

unread,
Oct 23, 2013, 1:47:34 AM10/23/13
to trac-...@googlegroups.com
Hi, I am now able to display Description as rows. In the query, I changed "row=description" to "col=description". When I do that, description is in column form but is not properly formatted. How do I make it properly formatted?
 
RjOllos mentioned that the following patch will cause the description to be formatted as wiki when the description is displayed as a column:


diff --git a/trac/ticket/templates/query_results.html b/trac/ticket/templates/qu
index 4bba241..a6e9211 100644
--- a/trac/ticket/templates/query_results.html
+++ b/trac/ticket/templates/query_results.html
@@ -81,6 +81,7 @@
                       <py:when test="name == 'cc'">${format_emails(ticket_conte
                       <py:when test="name == 'owner' and value">${authorinfo(va
                       <py:when test="name == 'milestone'"><a py:if="value" titl
+                      <py:when test="name == 'description'">${wiki_to_html(tick
                       <py:when test="header.wikify">${wiki_to_oneliner(ticket_c
                       <py:otherwise>$value</py:otherwise>
                     </td>
 
How do I do the above? I am unable to find query_results.html. i can only find /srv/trac/env/celine/templates/ticket.html.
 
Thank you for your help.

RjOllos

unread,
Oct 25, 2013, 5:36:47 PM10/25/13
to trac-...@googlegroups.com
The patch was truncated. The full patch is:

Index: trac/ticket/templates/query_results.html
===================================================================
--- trac/ticket/templates/query_results.html    (revision 12208)
+++ trac/ticket/templates/query_results.html    (working copy)
@@ -81,6 +81,7 @@
                       <py:when test="name == 'cc'">${format_emails(ticket_context, value)}</py:when>
                       <py:when test="name == 'owner' and value">${authorinfo(value)}</py:when>
                       <py:when test="name == 'milestone'"><a py:if="value" title="View milestone" href="${href.milestone(value)}">${value}</a></py:when>
+                      <py:when test="name == 'description'">${wiki_to_html(ticket_context, value)}</py:when>
                       <py:when test="header.wikify">${wiki_to_oneliner(ticket_context, value)}</py:when>
                       <py:otherwise>$value</py:otherwise>
                     </td>

There are multiple ways to install the patch, but probably the most straightforward is to download the source, apply the patch and reinstall Trac. If Trac was installed through a package manager, then you would need to remove that instance, and it would probably be better to work in a virtualenv.

Overall, unless you are very comfortable managing packages on your OS, I wouldn't recommend trying to patch Trac. The patch is more of a hack anyway, and I'm considering how we might change Trac in a future release to wiki format columns when applicable. I'll follow-up here if I make progress on that.

RjOllos

unread,
Oct 26, 2013, 4:44:06 AM10/26/13
to trac-...@googlegroups.com

RjOllos

unread,
Nov 7, 2013, 12:25:57 AM11/7/13
to trac-...@googlegroups.com
The change has been committed to 1.0-stable, so you can either install 1.0-stable, or wait for 1.0.2. 
Reply all
Reply to author
Forward
0 new messages