Commits

Anonymous committed e66df72

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

Comments (0)

Files changed (2)

 Rocky Burt              rocky.burt@myrealbox.com
+Daragh Fitzpatrick      Daragh@i2i-Tech.com
 Eric Gillespie          epg@netbsd.org
-Mikael Hallendal         micke@imendio.com
+Mikael Hallendal        micke@imendio.com
 Stephen Hansen          shansen@advpubtech.com
 Laurie Harper           zodiac@holoweb.net
 Francois Harvey         fharvey@securiweb.net
 Nuutti Kotivuori        naked@iki.fi
 Christopher Lenz        cmlenz@gmx.de
 Ivo Looser              ivo.looser@login.ch
+James Moger             jamesm@transonic.com
 Jennifer Murtell        jen@jmurtell.com
 Nicolas Riley           sabi
 Mark Rowe               mrowe@bluewire.net.nz
 Emmeran Seehuber        rototor@rototor.de
 Dmitry Yusupov          dmitry_yus@yahoo.com
 
-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,
                                                             self.mime_type))
         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'
         self.display_raw()
-    
+
 class Attachment(FileCommon):
     def get_attachment_parent_link(self):
         if self.attachment_type == 'ticket':
             return (self.attachment_id,
                     self.env.href.wiki(self.attachment_id))
         assert 0
-    
+
     def render(self):
         FileCommon.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.attachment_type,
                                      self.attachment_id,
                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.attachment_type,
                                                   self.attachment_id,
                                                        self.filename,
                                                        'text'))
         self.req.hdf.setValue('file.filename', urllib.unquote(self.filename))
+        self.req.hdf.setValue('trac.active_module', self.attachment_type) # Kludge
         FileCommon.display(self)
 
 
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 ProjectModifiedEvent.java.
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.