From a96eb41a7f79d1e098ee5c13d9985bf0067777f3 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sun, 15 Nov 2009 13:18:59 +0000 Subject: [PATCH] Use new link tag; SimpleTable can now output docgen types other than gtk svn: r13588 --- src/Simple/_SimpleTable.py | 13 +++++++++++-- src/data/Web_Mainz.css | 8 +++++++- src/web/djangodb.py | 1 - src/web/utils.py | 2 +- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/Simple/_SimpleTable.py b/src/Simple/_SimpleTable.py index ffcc5d41b..63a892ea9 100644 --- a/src/Simple/_SimpleTable.py +++ b/src/Simple/_SimpleTable.py @@ -224,7 +224,7 @@ class SimpleTable(object): elif isinstance(item, gen.lib.Source): retval.append(_('Source')) if (self.__link_col == col or link is None): - link = ('Souce', item.handle) + link = ('Source', item.handle) elif isinstance(item, gen.lib.Event): name = self.access.event_type(item) retval.append(name) @@ -284,7 +284,7 @@ class SimpleTable(object): else: self.__rows.sort(lambda a, b: cmp(a[idx],b[idx])) - def write(self, document, link=False): + def write(self, document): self.simpledoc = document # simpledoc; simpledoc.doc = docgen object if self.simpledoc.doc.type == "standard": doc = self.simpledoc.doc @@ -308,13 +308,21 @@ class SimpleTable(object): doc.write_text(col, 'TableTitle') doc.end_cell() doc.end_row() + index = 0 for row in self.__rows: doc.start_row() for col in row: doc.start_cell('TableDataCell', span=1) + if self.__link[index]: + obj_type, handle = self.__link[index] + doc.start_link("/%s/%s" % + (obj_type.lower(), handle)) doc.write_text(col, 'Normal') + if self.__link[index]: + doc.stop_link() doc.end_cell() doc.end_row() + index += 1 doc.end_table() doc.start_paragraph("Normal") doc.end_paragraph() @@ -404,3 +412,4 @@ class SimpleTable(object): col_dict = self.__cell_markup.get(x, {}) col_dict[y] = data self.__cell_markup[x] = col_dict + diff --git a/src/data/Web_Mainz.css b/src/data/Web_Mainz.css index be9a88e8e..a8141c0ea 100644 --- a/src/data/Web_Mainz.css +++ b/src/data/Web_Mainz.css @@ -323,11 +323,17 @@ table tr td.TableHeaderCell { } table tr td.TableDataCell { - color: #f8eec9; + color: #7D5925; + background-color: white; border:solid 2px #7D5925; font-size: 0.8em; } +table tr td.TableDataCell a { + color: black; + text-decoration: none; +} + table.infolist tr th a { text-decoration:none; } diff --git a/src/web/djangodb.py b/src/web/djangodb.py index 906e6270f..ce8af56d3 100644 --- a/src/web/djangodb.py +++ b/src/web/djangodb.py @@ -38,7 +38,6 @@ class DjangoDb(GrampsDbBase): return obj def get_event_from_handle(self, handle): - print "get_event_from_handle:", handle obj = gen.lib.Event() obj.unserialize(self.dji.get_event(self.dji.Event.get(handle=handle))) return obj diff --git a/src/web/utils.py b/src/web/utils.py index 5bf6c3ee1..2058af7ca 100644 --- a/src/web/utils.py +++ b/src/web/utils.py @@ -78,7 +78,7 @@ def events_table(djperson): print djevent.description table.row( djevent.description, - str(djevent.event_type), + table.db.get_event_from_handle(djevent.handle), djevent.gramps_id, display_date(djevent), get_title(djevent.place),