@register.simple_tag(takes_context=True)
def diff_chunk_header(context, header):
 lines_of_context = context[u'lines_of_context']
 chunk = context[u'chunk']
 line = chunk[u'lines'][0]
 if (header[u'line'] >= line[1]):
  expand_offset = ((line[1] + chunk[u'numlines']) - header[u'line'])
  expandable = True
 else:
  expand_offset = 0
  expandable = False
 return _diff_expand_link(context, expandable, (u'<code>%s</code>' % escape(header[u'text'])), _(u'Expand to header'), (lines_of_context[0], (expand_offset + lines_of_context[1])), u'rb-icon-diff-expand-header')

@ register . simple_tag ( takes_context = True ) def diff_chunk_header ( context , header ) : lines_of_context = context [ u'lines_of_context' ] chunk = context [ u'chunk' ] line = chunk [ u'lines' ] [ 0 ] if ( header [ u'line' ] >= line [ 1 ] ) : expand_offset = ( ( line [ 1 ] + chunk [ u'numlines' ] ) - header [ u'line' ] ) expandable = True else : expand_offset = 0 expandable = False return _diff_expand_link ( context , expandable , ( u'<code>%s</code>' % escape ( header [ u'text' ] ) ) , _ ( u'Expand to header' ) , ( lines_of_context [ 0 ] , ( expand_offset + lines_of_context [ 1 ] ) ) , u'rb-icon-diff-expand-header' )
renders a diff header as html .