Commits

Anonymous committed d25b903

attachment detail

Comments (0)

Files changed (3)

-1. Add pictures for:
- * /attachment/
  
 2. Replace hardcoded gravatar with an OrderedExtensionPoint implementing IUserPicturesProvider
 
 
 5. Implement preferences screens for both IUserPicturesProviders
 
-6. Contact mike beyer
+6. Contact mike bayer
 
 7. Release! Announce!
 

userpictures/__init__.py

     wiki_diff_size = Option("userpictures", "wiki_diff_size", default="30")
     wiki_history_lineitem_size = Option("userpictures", "wiki_history_lineitem_size", default="20")
     wiki_view_size = Option("userpictures", "wiki_view_size", default="40")
+    attachment_view_size = Option("userpictures", "attachment_view_size", default="40")
     attachment_lineitem_size = Option("userpictures", "attachment_lineitem_size", default="20")
 
     ## ITemplateProvider methods
             filter_.extend(self._report_filter(req, data))
         elif req.path_info.startswith("/wiki"):
             filter_.extend(self._wiki_filter(req, data))
-
+        elif req.path_info.startswith("/attachment"):
+            filter_.extend(self._attachment_filter(req, data))
+        
         if 'attachments' in data and data.get('attachments', {}).get('attachments'):
             filter_.extend(self._page_attachments_filter(req, data))
 
 
         return [Transformer('//td[@class="author"]').filter(find_change)]
 
+    def _attachment_filter(self, req, data):
+        if not data.get('attachment'):
+            return []
+        author = data['attachment'].author
+        return [Transformer('//table[@id="info"]//th'
+                            ).prepend(
+                self._generate_avatar(
+                    req, author,
+                    "attachment-view", self.attachment_view_size)
+                )]
+
     def _page_attachments_filter(self, req, data):
         def find_change(stream):
             author = stream[1][1]

userpictures/htdocs/userpictures.css

   vertical-align: top;
 }
 
+img.userpictures_avatar.attachment-view {
+  margin: 3px 10px 3px 0px;
+  vertical-align: top;
+}
+
 img.userpictures_avatar.search-results {
   margin-right: 5px;
   margin-top: 3px;