Anonymous committed e66df72

Highlight proper module in navbar for attachments. Closes #404.

Comments (0)

Files changed (2)

 Rocky Burt    
+Daragh Fitzpatrick
 Eric Gillespie
-Mikael Hallendal
+Mikael Hallendal
 Stephen Hansen
 Laurie Harper 
 Francois Harvey
 Nuutti Kotivuori
 Christopher Lenz
 Ivo Looser    
+James Moger   
 Jennifer Murtell
 Nicolas Riley           sabi
 Mark Rowe     
 Emmeran Seehuber
 Dmitry Yusupov
-The Elusive Anonymous
+The ever so elusive Anonymous
 Diggs and Lula (official pawprint contributors)
 Our apologies to everyone we forgot to mention, but without whose invaluable
-help, Trac would not continue to rapidly evolve. 
+help, Trac would not continue to rapidly evolve.
         self.env.log.debug("Displaying file: %s  mime-type: %s" % (self.filename,
         data = util.to_utf8(self.read_func(self.DISP_MAX_FILE_SIZE))
         if len(data) == self.DISP_MAX_FILE_SIZE:
             self.req.hdf.setValue('file.max_file_size_reached', '1')
             self.req.hdf.setValue('file.max_file_size', str(self.DISP_MAX_FILE_SIZE))
     def display_text(self):
         self.mime_type = 'text/plain'
 class Attachment(FileCommon):
     def get_attachment_parent_link(self):
         if self.attachment_type == 'ticket':
             return (self.attachment_id,
         assert 0
     def render(self):
         self.view_form = 0
             # Send an attachment
             perm_map = {'ticket':perm.TICKET_VIEW, 'wiki': perm.WIKI_VIEW}
             self.perm.assert_permission (perm_map[self.attachment_type])
             self.path = os.path.join(self.env.get_attachments_dir(),
                self.args.has_key('author') and \
                self.args.has_key('attachment') and \
                hasattr(self.args['attachment'], 'file'):
             # Create a new attachment
             if not self.attachment_type in ['ticket', 'wiki']:
                 raise util.TracError('Unknown attachment type')
             perm_map = {'ticket':perm.TICKET_MODIFY, 'wiki': perm.WIKI_MODIFY}
             self.perm.assert_permission (perm_map[self.attachment_type])
             filename = self.env.create_attachment(self.db,
         self.req.hdf.setValue('file.filename', urllib.unquote(self.filename))
+        self.req.hdf.setValue('trac.active_module', self.attachment_type) # Kludge
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.