@@ -351,3 +351,30 @@ def match_request(self, req):
351351 def process_request (self , req ):
352352 html = format_to_html (req , self .env , req .args .get ('text' , '' ))
353353 req .send (html .encode ('utf-8' ))
354+
355+
356+ class HighlightCommentedRevisions (Component ):
357+ implements (IRequestFilter )
358+
359+ # IRequestFilter methods
360+ def pre_process_request (self , req , handler ):
361+ return handler
362+
363+ def post_process_request (self , req , template , data , metadata ):
364+ if not re .match (r'^\/log\/\w+' , req .path_info ):
365+ return template , data , metadata
366+
367+ query_params = {
368+ 'type' : 'changeset' ,
369+ 'reponame' : data ['reponame' ],
370+ }
371+ revisions_with_comments = []
372+ for revision in data ['changes' ]:
373+ query_params ['revision' ] = revision
374+ has_comments = bool (Comments (None , self .env ).count (query_params ))
375+ if has_comments :
376+ revisions_with_comments .append (revision )
377+
378+ add_script_data (req , {'CodeCommentsCommentedRevisions' : revisions_with_comments })
379+ add_script (req , 'code-comments/log-view-enhancer.js' )
380+ return template , data , metadata
0 commit comments