Ejemplo n.º 1
0
    def render_part_body(self, part, mode):
        new, old = part.new_value, part.old_value

        if mode == 'html':
            diff = HtmlDiff.diff(old['body'], new['body'], n=2, css=False)
            return '<span>Description has changed:</span>' + diff

        raise NotImplementedError()
Ejemplo n.º 2
0
    def render_part_body(self, part, mode):
        new, old = part.new_value, part.old_value

        if mode == 'html':
            diff = HtmlDiff.diff(old['body'], new['body'], n=2, css=False)
            collaspe_id = u'part-' + str(part.id)
            return u'<span class="collapsible">Description has changed</span><span data-toggle="collapse" data-target="#' + collaspe_id + u'" title="Toggle diff">…</span><div class="collapse" id="' + collaspe_id + u'">' + diff + u'</div>'

        return super(IssueRendererCollapsableTitleAndBody, self).render_part_body(part, mode)