#NEWLINE# def render_to_string( self , request , inline = True ) : #NEWLINE# #INDENT# 'Renders the review UI to an HTML string.\n\n        This renders the review UI to a string for use in embedding into\n        either an existing page or a new page.\n\n        If inline is True, the rendered review UI will be embeddable into\n        an existing page.\n\n        If inline is False, it will be rendered for use as a full, standalone\n        page, compelte with Review Board chrome.\n        ' #NEWLINE# self . request = request #NEWLINE# ( last_activity_time , updated_object ) = self . review_request . get_last_activity ( ) #NEWLINE# draft = self . review_request . get_draft ( request . user ) #NEWLINE# review_request_details = ( draft or self . review_request ) #NEWLINE# ( close_description , close_description_rich_text ) = self . review_request . get_close_description ( ) #NEWLINE# context = { #NEWLINE# #INDENT# 'caption' : self . get_caption ( draft ) , #NEWLINE# 'close_description' : close_description , #NEWLINE# 'close_description_rich_text' : close_description_rich_text , #NEWLINE# 'comments' : self . get_comments ( ) , #NEWLINE# 'draft' : updated_object , #NEWLINE# 'last_activity_time' : last_activity_time , #NEWLINE# 'review_request_details' : review_request_details , #NEWLINE# 'review_request' : self . review_request , #NEWLINE# 'review_ui' : self , #NEWLINE# 'review_ui_uuid' : six . text_type ( uuid4 ( ) ) , #NEWLINE# self . object_key : self . obj , #NEWLINE# self . diff_object_key : self . diff_against_obj , #NEWLINE# #UNINDENT# } #NEWLINE# if inline : #NEWLINE# #INDENT# context . update ( { #NEWLINE# #INDENT# 'base_template' : 'reviews/ui/base_inline.html' , #NEWLINE# 'review_ui_inline' : True , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if self . review_request . repository_id : #NEWLINE# #INDENT# diffset_count = DiffSet . objects . filter ( history__pk = self . review_request . diffset_history_id ) . count ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# diffset_count = 0 #NEWLINE# #UNINDENT# context . update ( { #NEWLINE# #INDENT# 'base_template' : 'reviews/ui/base.html' , #NEWLINE# 'has_diffs' : ( ( draft and draft . diffset ) or ( diffset_count > 0 ) ) , #NEWLINE# 'review' : self . review_request . get_pending_review ( request . user ) , #NEWLINE# 'review_ui_inline' : False , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# context . update ( self . get_extra_context ( request ) ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# logging . error ( 'Error when calling get_extra_context for FileAttachmentReviewUI %r: %s' , self , e , exc_info = 1 ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# return render_to_string ( self . template_name , RequestContext ( request , make_review_request_context ( request , self . review_request , context ) ) ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# logging . error ( 'Error when calling get_js_model_data or get_js_view_data for FileAttachmentReviewUI %r: %s' , self , e , exc_info = 1 )