Modify ↓
Opened 14 years ago
Closed 12 years ago
#8066 closed defect (fixed)
TracLink to a PDF in the repository is not redirected
Reported by: | Owned by: | Ryan J Ollos | |
---|---|---|---|
Priority: | normal | Component: | PdfRedirectorPlugin |
Severity: | normal | Keywords: | source browser, preview |
Cc: | Steffen Hoffmann | Trac Release: | 0.12 |
Description
Hello,
I gave the plugin a try. It looks good when the file referenced is an attachment.
However when you use [source:file.pdf]
then the preview is still generated. I tried that on a git repository, but I suppose that svn behaves the same way.
It would be cool to have that straight. Thanks for your good work!
Cheers!
Attachments (0)
Change History (9)
comment:1 Changed 14 years ago by
Summary: | PDF preview in repository browser → TracLink to a PDF in the repository is not redirected |
---|
comment:2 Changed 13 years ago by
comment:3 Changed 12 years ago by
Cc: | Steffen Hoffmann added; anonymous removed |
---|---|
Owner: | changed from Nicholas Bergson-Shilcock to Ryan J Ollos |
Status: | new → assigned |
comment:4 Changed 12 years ago by
Proposed patch, which is nearly a complete rewrite of this tiny plugin.
-
trunk/pdfredirector/pdfredirector.py
13 13 return template, data, content_type 14 14 15 15 def pre_process_request(self, req, handler): 16 16 17 path = req.path_info.strip('/').split('/') 17 if len(path) < 2 or path[0] != 'attachment' or req.args.get('action') == 'delete': 18 return handler 19 20 if not path[-1].lower().endswith('.pdf'): 21 return handler 22 23 filename = req.href(*(['raw-attachment'] + path[1:])) 24 25 req.redirect(filename) 18 19 if len(path) > 1 and path[-1].lower().endswith('.pdf'): 20 if path[0] == 'attachment' and not req.args.get('action') == 'delete': 21 filepath = req.href(*(['raw-attachment'] + path[1:])) 22 req.redirect(filepath) 23 elif path[0] == 'browser': 24 path[0] = 'export' 25 rev = req.args.get('rev', 'HEAD') 26 path.insert(1, rev) 27 filepath = req.href('/'.join(path)) 28 req.redirect(filepath) 26 29 27 28 29 30 30 return handler
comment:5 Changed 12 years ago by
comment:7 Changed 12 years ago by
I think it is time to bump the revision and create a tag for this. Anyone r11799 or later that can give some feedback?
comment:8 Changed 12 years ago by
comment:9 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note: See
TracTickets for help on using
tickets.
Yes, svn behaves in the same way. I agree that this would be a nice enhancement.