@register.simple_tag(takes_context=True)
def expand_fragment_link(context, expanding, tooltip, expand_above, expand_below, text=None):
 lines_of_context = context[u'lines_of_context']
 image_class = (u'rb-icon-diff-expand-%s' % expanding)
 expand_pos = ((lines_of_context[0] + expand_above), (lines_of_context[1] + expand_below))
 return render_to_string(u'reviews/expand_link.html', {u'tooltip': tooltip, u'text': text, u'comment_id': context[u'comment'].id, u'expand_pos': expand_pos, u'image_class': image_class})

@ register . simple_tag ( takes_context = True ) def expand_fragment_link ( context , expanding , tooltip , expand_above , expand_below , text = None ) : lines_of_context = context [ u'lines_of_context' ] image_class = ( u'rb-icon-diff-expand-%s' % expanding ) expand_pos = ( ( lines_of_context [ 0 ] + expand_above ) , ( lines_of_context [ 1 ] + expand_below ) ) return render_to_string ( u'reviews/expand_link.html' , { u'tooltip' : tooltip , u'text' : text , u'comment_id' : context [ u'comment' ] . id , u'expand_pos' : expand_pos , u'image_class' : image_class } )
renders a diff comment fragment expansion link .