From d50cfb29f16fb8366f1b86c20400980212ef70d5 Mon Sep 17 00:00:00 2001 From: "Rob G. Healey" Date: Sat, 27 Mar 2010 07:11:10 +0000 Subject: [PATCH] Created CSS elements for WebLinks sections in Individual Pages and AddressBook Pages. Fixed missing hyperlinks and description fields. Problem from Alain Aupeix. No bug tracker created. svn: r14942 --- src/data/Web_Basic-Ash.css | 25 +++++++- src/data/Web_Basic-Blue.css | 24 ++++++- src/data/Web_Basic-Cypress.css | 25 +++++++- src/data/Web_Basic-Lilac.css | 25 +++++++- src/data/Web_Basic-Peach.css | 25 +++++++- src/data/Web_Basic-Spruce.css | 25 +++++++- src/data/Web_Mainz.css | 25 +++++++- src/data/Web_Nebraska.css | 25 +++++++- src/data/Web_Visually.css | 27 +++++++- src/plugins/webreport/NarrativeWeb.py | 91 +++++++++++++++++---------- 10 files changed, 274 insertions(+), 43 deletions(-) diff --git a/src/data/Web_Basic-Ash.css b/src/data/Web_Basic-Ash.css index e90588240..2556e39f5 100644 --- a/src/data/Web_Basic-Ash.css +++ b/src/data/Web_Basic-Ash.css @@ -4,7 +4,7 @@ # # Copyright 2008 Jason M. Simanek # Copyright 2009 Stephane Charette -# Copyright (c) 2008-2009 Rob G. Healey +# Copyright (c) 2008-2010 Rob G. Healey # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1037,6 +1037,29 @@ div#sourcerefs ol li ol { /* Subsections : Weblinks ----------------------------------------------------- */ +div#WebLinks { + margin : 0 auto; + padding: 0; +} + +table.weblinks tr td { + background-color: #EEE; + border-bottom: dashed 1px #000; +} +table.weblinks tr td.ColumnRowLabel { + width: 5%; +} +table.weblinks tr td.ColumnType { + width: 30%; +} +table.weblinks tr td.ColumnPath { + background-color: #FFF; + width: 435; +} +table.weblinks tr td.ColumnDescription { + width: 30%; +} + /* Subsections : Pedigree ----------------------------------------------------- */ diff --git a/src/data/Web_Basic-Blue.css b/src/data/Web_Basic-Blue.css index f046b8a9f..3cb943188 100644 --- a/src/data/Web_Basic-Blue.css +++ b/src/data/Web_Basic-Blue.css @@ -874,7 +874,7 @@ div#AddressBookList, AddressBookDetail { width: 100%; } div#AddressBookList table.addressbook { - margin: .3em 0 .3em 0; + } div#AddressBookList table.addressbook tbody tr.Totals { border: solid 1px #000; @@ -1221,6 +1221,28 @@ div#summaryarea table.infolist tbody tr td.ColumnAttribute { /* Subsections : Weblinks ----------------------------------------------------- */ +div#WebLinks { + margin : 0 auto; + padding: 0; +} + +table.weblinks tr td { + background-color: #BCEAF6; + border-bottom: dashed 1px #000; +} +table.weblinks tr td.ColumnRowLabel { + width: 5%; +} +table.weblinks tr td.ColumnType { + width: 30%; +} +table.weblinks tr td.ColumnPath { + background-color: #FFF; + width: 435; +} +table.weblinks tr td.ColumnDescription { + width: 30%; +} /* Subsections : Pedigree ----------------------------------------------------- */ diff --git a/src/data/Web_Basic-Cypress.css b/src/data/Web_Basic-Cypress.css index 5694ed3d4..25ea4866a 100644 --- a/src/data/Web_Basic-Cypress.css +++ b/src/data/Web_Basic-Cypress.css @@ -4,7 +4,7 @@ # # Copyright 2008 Jason M. Simanek # Copyright 2009 Stephane Charette -# Copyright (c) 2008-2009 Rob G. Healey +# Copyright (c) 2008-2010 Rob G. Healey # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1064,6 +1064,29 @@ div#sourcerefs ol li ol { /* Subsections : Weblinks ----------------------------------------------------- */ +div#WebLinks { + margin : 0 auto; + padding: 0; +} + +table.weblinks tr td { + background-color: #E0E6E0; + border-bottom: dashed 1px #000; +} +table.weblinks tr td.ColumnRowLabel { + width: 5%; +} +table.weblinks tr td.ColumnType { + width: 30%; +} +table.weblinks tr td.ColumnPath { + background-color: #FFF; + width: 435; +} +table.weblinks tr td.ColumnDescription { + width: 30%; +} + /* Subsections : Pedigree ----------------------------------------------------- */ diff --git a/src/data/Web_Basic-Lilac.css b/src/data/Web_Basic-Lilac.css index ce63a3e6e..d9e5e9157 100644 --- a/src/data/Web_Basic-Lilac.css +++ b/src/data/Web_Basic-Lilac.css @@ -4,7 +4,7 @@ # # Copyright 2008 Jason M. Simanek # Copyright 2009 Stephane Charette -# Copyright (c) 2008-2009 Rob G. Healey +# Copyright (c) 2008-2010 Rob G. Healey # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1014,6 +1014,29 @@ div#sourcerefs ol li ol { /* Subsections : Weblinks ----------------------------------------------------- */ +div#WebLinks { + margin : 0 auto; + padding: 0; +} + +table.weblinks tr td { + background-color: #E6E0E9; + border-bottom: dashed 1px #000; +} +table.weblinks tr td.ColumnRowLabel { + width: 5%; +} +table.weblinks tr td.ColumnType { + width: 30%; +} +table.weblinks tr td.ColumnPath { + background-color: #FFF; + width: 435; +} +table.weblinks tr td.ColumnDescription { + width: 30%; +} + /* Subsections : Pedigree ----------------------------------------------------- */ diff --git a/src/data/Web_Basic-Peach.css b/src/data/Web_Basic-Peach.css index 21a344e29..65c012841 100644 --- a/src/data/Web_Basic-Peach.css +++ b/src/data/Web_Basic-Peach.css @@ -4,7 +4,7 @@ # # Copyright 2008 Jason M. Simanek # Copyright 2009 Stephane Charette -# Copyright (c) 2008-2009 Rob G. Healey +# Copyright (c) 2008-2010 Rob G. Healey # # This program is free software; you can redistribute it and/or modify @@ -1017,6 +1017,29 @@ div#sourcerefs ol li ol { /* Subsections : Weblinks ----------------------------------------------------- */ +div#WebLinks { + margin : 0 auto; + padding: 0; +} + +table.weblinks tr td { + background-color: #FFE09F; + border-bottom: dashed 1px #000; +} +table.weblinks tr td.ColumnRowLabel { + width: 5%; +} +table.weblinks tr td.ColumnType { + width: 30%; +} +table.weblinks tr td.ColumnPath { + background-color: #FFF; + width: 435; +} +table.weblinks tr td.ColumnDescription { + width: 30%; +} + /* Subsections : Pedigree ----------------------------------------------------- */ diff --git a/src/data/Web_Basic-Spruce.css b/src/data/Web_Basic-Spruce.css index 0d15733de..181db50a3 100644 --- a/src/data/Web_Basic-Spruce.css +++ b/src/data/Web_Basic-Spruce.css @@ -4,7 +4,7 @@ # # Copyright 2008 Jason M. Simanek # Copyright 2009 Stephane Charette -# Copyright (c) 2008-2009 Rob G. Healey +# Copyright (c) 2008-2010 Rob G. Healey # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1015,6 +1015,29 @@ div#sourcerefs ol li ol { /* Subsections : Weblinks ----------------------------------------------------- */ +div#WebLinks { + margin : 0 auto; + padding: 0; +} + +table.weblinks tr td { + background-color: #EAFFF4; + border-bottom: dashed 1px #000; +} +table.weblinks tr td.ColumnRowLabel { + width: 5%; +} +table.weblinks tr td.ColumnType { + width: 30%; +} +table.weblinks tr td.ColumnPath { + background-color: #FFF; + width: 435; +} +table.weblinks tr td.ColumnDescription { + width: 30%; +} + /* Subsections : Pedigree ----------------------------------------------------- */ diff --git a/src/data/Web_Mainz.css b/src/data/Web_Mainz.css index 2f9e3f758..2dacd2a63 100644 --- a/src/data/Web_Mainz.css +++ b/src/data/Web_Mainz.css @@ -4,7 +4,7 @@ # # Copyright 2008 Jason M. Simanek # Copyright 2009 Stephane Charette -# Copyright (c) 2008-2009 Rob G. healey +# Copyright (c) 2008-2010 Rob G. healey # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1018,6 +1018,29 @@ div#sourcerefs ol li ol { /* SubSection : Weblinks ----------------------------------------------------- */ +div#WebLinks { + margin : 0 auto; + padding: 0; +} + +table.weblinks tr td { + background-color: #FFFFE7; + border-bottom: dashed 1px #000; +} +table.weblinks tr td.ColumnRowLabel { + width: 5%; +} +table.weblinks tr td.ColumnType { + width: 30%; +} +table.weblinks tr td.ColumnPath { + background-color: #FFF; + width: 435; +} +table.weblinks tr td.ColumnDescription { + width: 30%; +} + /* SubSection : Pedigree ----------------------------------------------------- */ diff --git a/src/data/Web_Nebraska.css b/src/data/Web_Nebraska.css index d66c993ac..26ac967f4 100644 --- a/src/data/Web_Nebraska.css +++ b/src/data/Web_Nebraska.css @@ -4,7 +4,7 @@ # # Copyright 2008 Jason M. Simanek # Copyright 2009 Stephane Charette -# Copyright (c) 2008-2009 Rob G. Healey +# Copyright (c) 2008-2010 Rob G. Healey # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1068,6 +1068,29 @@ div#summaryarea table.infolist tbody tr td.ColumnAttribute { /* Subsections : Weblinks ----------------------------------------------------- */ +div#WebLinks { + margin : 0 auto; + padding: 0; +} + +table.weblinks tr td { + background-color: #F6F2EE; + border-bottom: dashed 1px #000; +} +table.weblinks tr td.ColumnRowLabel { + width: 5%; +} +table.weblinks tr td.ColumnType { + width: 30%; +} +table.weblinks tr td.ColumnPath { + background-color: #FFF; + width: 435; +} +table.weblinks tr td.ColumnDescription { + width: 30%; +} + /* Subsections : Pedigree ----------------------------------------------------- */ diff --git a/src/data/Web_Visually.css b/src/data/Web_Visually.css index c3ddf7107..b1bd5f674 100644 --- a/src/data/Web_Visually.css +++ b/src/data/Web_Visually.css @@ -2,8 +2,8 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright 2008-2009 Rob G. Healey -# Copyright 2009 Stephane Charette +# Copyright 2008-2010 Rob G. Healey +# Copyright 2009 Stephane Charette # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1214,6 +1214,29 @@ div#summaryarea table.infolist tbody tr td.ColumnAttribute { /* Subsections : Weblinks ----------------------------------------------------- */ +div#WebLinks { + margin : 0 auto; + padding: 0; +} + +table.weblinks tr td { + background-color: #6AF364; + border-bottom: dashed 1px #000; +} +table.weblinks tr td.ColumnRowLabel { + width: 5%; +} +table.weblinks tr td.ColumnType { + width: 30%; +} +table.weblinks tr td.ColumnPath { + background-color: #FFF; + width: 435; +} +table.weblinks tr td.ColumnDescription { + width: 30%; +} + /* Subsections : Pedigree ----------------------------------------------------- */ diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index 354973196..82642a788 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -1425,49 +1425,74 @@ class BasePage(object): return None # begin web links division - with Html("div", class_ = "subsection", id = "weblinks") as section: + with Html("div", class_ = "subsection", id = "WebLinks") as section: # begin web title section += Html("h4", _("Web Links"), inline = True) - # ordered list - ordered = Html("ol") - section += ordered + # begin weblinks table + with Html("table", class_ = "infolist weblinks") as table: + section += table - for url in urllist: - uri = url.get_path() - descr = url.get_description() - if not descr: - descr = uri - _type = url.get_type() + thead = Html("thead") + table += thead - list = Html("li") - ordered += list + trow = Html("tr") + thead += trow + + trow.extend( + Html('th', label, class_ = "Column" + colclass, inline = True) + for (label, colclass) in [ + (" ", "RowLabel"), + (THEAD, "Type"), + (_("Path"), "Path"), + (DESCRHEAD, "Description") ] + ) + + tbody = Html("tbody") + table += tbody + + index = 0 + for url in urllist: + + trow = Html("tr") + tbody += trow - # Email address - if _type == UrlType.EMAIL: - if not uri.startswith("mailto:"): - list += Html("a",descr, href = 'mailto: %s' % uri) - else: - list += Html("a", descr, href = uri) + _type = url.get_type() + uri = url.get_path() + descr = url.get_description() - # Web Site address - elif _type == UrlType.WEB_HOME: - if not uri.startswith("http://"): - list += Html("a", descr, href = 'http://%s' % uri) - else: - list += Html("a", descr, href = uri) + if not descr: + descr = uri - # FTP server address - elif _type == UrlType.WEB_FTP: - if not uri.startswith("ftp://"): - list += Html("a", descr, href = 'ftp://%s' % uri) - else: - list += Html("a", descr, href = uri) + trow.extend( + Html("td", index + 1, class_ = "ColumnRowLabel", inline = True) + ) + + # Email address + if _type == UrlType.EMAIL: + if not uri.startswith("mailto:"): + uri = "mailto: %(email)s" % { 'email' : uri } - # custom type - else: - list += Html("a", descr, href = uri) + # Web Site address + elif _type == UrlType.WEB_HOME: + if not uri.startswith("http://"): + uri = "http://%(website)s" % { "website" : uri } + + # FTP server address + elif _type == UrlType.WEB_FTP: + if not uri.startswith("ftp://"): + uri = "ftp://%(ftpsite)s" % { "ftpsite" : uri } + + uri = Html("a", descr, href = uri) + trow.extend( + Html("td", data, class_ = "Column" + colclass) + for (data, colclass) in [ + (str(_type), "Type"), + (uri, "Path"), + (descr, "Description") ] + ) + index += 1 # return web links to its caller return section