Upgrade to 0.12.3 and custom views

28 views
Skip to first unread message

Lukasz Szybalski

unread,
Jun 26, 2013, 4:34:18 PM6/26/13
to trac-users
Hello,

We recently upgrade to 0.12.3 (Debian 7).

1. Is there a way to default that "modify" tab is ALWAYS OPEN? This really slows down the processing time for people who watch incoming new tickets and assign them out to proper milestones? Can I overwrite that somewhere in code if there is not setting for it?


Also less critical :

A). Is there a way to remove the preview. We either get PDF or TIFF files in one of the trac instances we setup. PDF has no preview so you need download in original format anyway, and TIFF files have multiple pages which the preview does not show. When people click on the attachment I want them to go straight into download in original format? What part of the trac would this be in so I can customize the link?
( I know there is a download arrow next to attachment name but that does not work in firefox 20+, and a lot of people don't see it). 

B)  Is there a plugin that would allow displaying "show under each result: attachments". Similar how  "Show under each result:

Selection_326.png

Steffen Hoffmann

unread,
Jun 26, 2013, 6:16:09 PM6/26/13
to trac-...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 26.06.2013 22:34, Lukasz Szybalski wrote:
> Hello,
>
> We recently upgrade to 0.12.3 (Debian 7).
>
> 1. Is there a way to default that "modify" tab is ALWAYS OPEN? This
> really slows down the processing time for people who watch incoming new
> tickets and assign them out to proper milestones? Can I overwrite that
> somewhere in code if there is not setting for it?

Just been discussed and pointed out by Ryan here:

http://trac.edgewall.org/ticket/9807#comment:18

> Also less critical :
>
> A). Is there a way to remove the preview. We either get PDF or TIFF
> files in one of the trac instances we setup. PDF has no preview so you
> need download in original format anyway, and TIFF files have multiple
> pages which the preview does not show. When people click on the
> attachment I want them to go straight into download in original format?
> What part of the trac would this be in so I can customize the link?
> ( I know there is a download arrow next to attachment name but that does
> not work in firefox 20+, and a lot of people don't see it).

See PdfRedirectorPlugin [1], should be possible to do/customize for
other extensions too.

> B) Is there a plugin that would allow displaying "show under each
> result: attachments". Similar how "Show under each result: Description"
> gives you description..I want to show attachments so that you can click
> on them while you are in the query.

I see your point, but have not recognized something like that in
existing hacks, at least not at trac-hacks.org yet. But extending each
ticket match in query by querying for attachments of that ticket and
display matches as a list with links pointing at that attachments sounds
like a doable task.

Got some development foo and time? I see this way to get what you want:

Using the IRequestFilter [2] extension interface to catch calls to
'/query', maybe check for results (matching tickets), before kicking in
at all,
iterate over results and query each ticket for associated attachments,
extend the data object, that will be passed on by a list of matching files,
implant a Genshi fragment containing generator code with
ITemplateStreamFilter [3] to render that list(s) as a linked list per
ticket row in trac/ticket/templates/query_results.html.

Once done, name it TicketQueryAttachmentListPlugin or similar. :-)

Steffen Hoffmann


[1] http://trac-hacks.org/wiki/PdfRedirectorPlugin
[2]
http://trac.edgewall.org/wiki/TracDev/PluginDevelopment/ExtensionPoints/trac.web.api.IRequestFilter
[3]
http://trac.edgewall.org/wiki/TracDev/PluginDevelopment/ExtensionPoints/trac.web.api.ITemplateStreamFilter
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlHLaCgACgkQ31DJeiZFuHebNQCgwIP5NJAjMbVvsH/4fFbMCS9m
MycAn3bUHUhGtmdwG3DsURTS+TU84REY
=ezrK
-----END PGP SIGNATURE-----

Lukasz Szybalski

unread,
Jun 27, 2013, 2:30:05 PM6/27/13
to trac-...@googlegroups.com


On Wednesday, June 26, 2013 5:16:09 PM UTC-5, hasienda wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 26.06.2013 22:34, Lukasz Szybalski wrote:
> Hello,
>
> We recently upgrade to 0.12.3 (Debian 7).
>
> 1. Is there a way to default that "modify" tab is ALWAYS OPEN? This
> really slows down the processing time for people who watch incoming new
> tickets and assign them out to proper milestones? Can I overwrite that
> somewhere in code if there is not setting for it?

Just been discussed and pointed out by Ryan here:

http://trac.edgewall.org/ticket/9807#comment:18

> Also less critical :
>
> A). Is there a way to remove the preview. We either get PDF or TIFF
> files in one of the trac instances we setup. PDF has no preview so you
> need download in original format anyway, and TIFF files have multiple
> pages which the preview does not show. When people click on the
> attachment I want them to go straight into download in original format?
> What part of the trac would this be in so I can customize the link?
> ( I know there is a download arrow next to attachment name but that does
> not work in firefox 20+, and a lot of people don't see it).

See PdfRedirectorPlugin [1], should be possible to do/customize for
other extensions too.

Perfect....
I've modified it and add tif

 if len(path) > 1 and path[-1].lower().endswith('.pdf'):
            if path[0] == 'attachment' and not req.args.get('action') == 'delete':
                filepath = req.href(*(['raw-attachment'] + path[1:]))
                req.redirect(filepath)
            elif path[0] == 'browser':
                path[0] = 'export'
                rev = req.args.get('rev', 'HEAD')
                path.insert(1, rev)
                filepath = req.href('/'.join(path))
                req.redirect(filepath)
        if len(path) > 1 and path[-1].lower().endswith('.tif'):
            if path[0] == 'attachment' and not req.args.get('action') == 'delete':
                filepath = req.href(*(['raw-attachment'] + path[1:]))
                req.redirect(filepath)
            elif path[0] == 'browser':
                path[0] = 'export'
                rev = req.args.get('rev', 'HEAD')
                path.insert(1, rev)
                filepath = req.href('/'.join(path))
                req.redirect(filepath)

Works perfectly.
 

> B)  Is there a plugin that would allow displaying "show under each
> result: attachments". Similar how  "Show under each result: Description"
> gives you description..I want to show attachments so that you can click
> on them while you are in the query.

I see your point, but have not recognized something like that in
existing hacks, at least not at trac-hacks.org yet. But extending each
ticket match in query by querying for attachments of that ticket and
display matches as a list with links pointing at that attachments sounds
like a doable task.

Got some development foo and time? I see this way to get what you want:

Using the IRequestFilter [2] extension interface to catch calls to
'/query', maybe check for results (matching tickets), before kicking in
at all,
iterate over results and query each ticket for associated attachments,
extend the data object, that will be passed on by a list of matching files,
implant a Genshi fragment containing generator code with
ITemplateStreamFilter [3] to render that list(s) as a linked list per
ticket row in trac/ticket/templates/query_results.html.

Once done, name it TicketQueryAttachmentListPlugin or similar. :-)


I would like to have the option to show attachments do? See screenshot. Like here you see "Show under each result: Checkbox for Description,,,another checkbox for attachments.

Would that be possible the way you have the above layout?

Would that be something you could do? Possibly on a paid basis?

Thanks
Lucas
Selection_328.png

Lukasz Szybalski

unread,
Jun 27, 2013, 2:32:36 PM6/27/13
to trac-...@googlegroups.com


On Thursday, June 27, 2013 1:30:05 PM UTC-5, Lukasz Szybalski wrote:


On Wednesday, June 26, 2013 5:16:09 PM UTC-5, hasienda wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 26.06.2013 22:34, Lukasz Szybalski wrote:
> Hello,
>
> We recently upgrade to 0.12.3 (Debian 7).
>
> 1. Is there a way to default that "modify" tab is ALWAYS OPEN? This
> really slows down the processing time for people who watch incoming new
> tickets and assign them out to proper milestones? Can I overwrite that
> somewhere in code if there is not setting for it?

Just been discussed and pointed out by Ryan here:

http://trac.edgewall.org/ticket/9807#comment:18  

I noticed that this actually makes everything open including "columns" batchmodify"...etc I think it should probably be a little more specific to "modify".

Thanks
Lucas

RjOllos

unread,
Jul 2, 2013, 4:58:44 PM7/2/13
to trac-...@googlegroups.com

Try the snippet Remy posted which will only filter the Ticket page:

http://trac.edgewall.org/ticket/9807#comment:18

RjOllos

unread,
Jul 2, 2013, 5:06:55 PM7/2/13
to trac-...@googlegroups.com

That is, I'm assuming you used the snippet from comment:17, which will apply everywhere. If you did use the snippet from comment:18 and it's still not working, then some debugging is in order.

Also, note a further refinement by osimons in comment:25.

RjOllos

unread,
Jul 2, 2013, 5:12:39 PM7/2/13
to trac-...@googlegroups.com
On Wednesday, June 26, 2013 1:34:18 PM UTC-7, Lukasz Szybalski wrote:
Hello,

We recently upgrade to 0.12.3 (Debian 7).

1. Is there a way to default that "modify" tab is ALWAYS OPEN? This really slows down the processing time for people who watch incoming new tickets and assign them out to proper milestones? Can I overwrite that somewhere in code if there is not setting for it?


Also less critical :

A). Is there a way to remove the preview. We either get PDF or TIFF files in one of the trac instances we setup. PDF has no preview so you need download in original format anyway, and TIFF files have multiple pages which the preview does not show. When people click on the attachment I want them to go straight into download in original format? What part of the trac would this be in so I can customize the link?
( I know there is a download arrow next to attachment name but that does not work in firefox 20+, and a lot of people don't see it).


You might also want to take a look at this ticket and voice your opinion:

http://trac.edgewall.org/ticket/11142

RjOllos

unread,
Jul 2, 2013, 5:18:25 PM7/2/13
to trac-...@googlegroups.com
On Thursday, June 27, 2013 11:30:05 AM UTC-7, Lukasz Szybalski wrote:

Perfect....
I've modified it and add tif

 if len(path) > 1 and path[-1].lower().endswith('.pdf'):
            if path[0] == 'attachment' and not req.args.get('action') == 'delete':
                filepath = req.href(*(['raw-attachment'] + path[1:]))
                req.redirect(filepath)
            elif path[0] == 'browser':
                path[0] = 'export'
                rev = req.args.get('rev', 'HEAD')
                path.insert(1, rev)
                filepath = req.href('/'.join(path))
                req.redirect(filepath)
        if len(path) > 1 and path[-1].lower().endswith('.tif'):
            if path[0] == 'attachment' and not req.args.get('action') == 'delete':
                filepath = req.href(*(['raw-attachment'] + path[1:]))
                req.redirect(filepath)
            elif path[0] == 'browser':
                path[0] = 'export'
                rev = req.args.get('rev', 'HEAD')
                path.insert(1, rev)
                filepath = req.href('/'.join(path))
                req.redirect(filepath)


Supporting extensions other than `.pdf` seems like a worthwhile enhancement to the plugin, so I've opened a ticket:

https://trac-hacks.org/ticket/11204


Reply all
Reply to author
Forward
0 new messages