From d2794bf7560db5784c8eeda31bf574c7526de88b Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Sun, 22 Nov 2015 02:19:00 +0100 Subject: split table --- watchnews/web.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/watchnews/web.py b/watchnews/web.py index 05ffcdc..09fb042 100644 --- a/watchnews/web.py +++ b/watchnews/web.py @@ -66,7 +66,8 @@ class DiffSupport: class Difftable(html.div, DiffSupport): def __init__(self, to_version, from_version=None, inline_style=False): - super().__init__() + html.div.__init__(self) + DiffSupport.__init__(self) self.xmlname = "div" self.inline_style = inline_style if from_version == None: @@ -95,7 +96,7 @@ class Difftable(html.div, DiffSupport): from_version.title, to_version.title) diff = difflib._mdiff(from_text, to_text) - self.append(html.table( + self.append(html.div(html.table( html.tr(html.th("Title"), html.td(from_difftitle), html.td(to_difftitle), **{'class': 'textdiff'}), @@ -105,8 +106,8 @@ class Difftable(html.div, DiffSupport): html.tr(html.th("Link"), html.td(html.a(from_version.url, href=from_version.url)), html.td(html.a(to_version.url, href=to_version.url))), - html.tr(html.th("Text", colspan=3)), - html.tr(html.td(self._diff_lines(from_text, to_text), colspan=3)), + html.tr(html.th("Text", colspan=3))), + self._diff_lines(from_text, to_text), **{'class': "versiondiff"} )) @@ -114,7 +115,8 @@ class Difftable(html.div, DiffSupport): class ItemWidget(html.div, DiffSupport): def __init__(self, item): - super().__init__() + html.div.__init__(self) + DiffSupport.__init__(self) self.append(html.h2(html.a(item.title, href=url_for('item', id=item.id)))) versionsFrom = [None] + list(item.versions)[:-1] -- cgit v1.2.1