From 52d573eba88125cbc139bc2e6489b09c0cca33b4 Mon Sep 17 00:00:00 2001 From: "Rob G. Healey" Date: Mon, 21 Sep 2009 22:22:45 +0000 Subject: [PATCH] Re-placed alphabet navigation as horizontal. Fixed several problems in NarrativeWeb, and some changes to WebCal. svn: r13231 --- src/data/Web_Visually.css | 331 ++++++++++++++------------ src/plugins/webreport/NarrativeWeb.py | 252 ++++++++++---------- src/plugins/webreport/WebCal.py | 126 +++++----- 3 files changed, 359 insertions(+), 350 deletions(-) diff --git a/src/data/Web_Visually.css b/src/data/Web_Visually.css index dcb6e32cb..e38e54a3d 100644 --- a/src/data/Web_Visually.css +++ b/src/data/Web_Visually.css @@ -32,7 +32,6 @@ see . -------------------------------------------------------------------------------------------------- Color Palette -------------------------------------------------------------------------------------------------- -brown darkest #453619 brown dark #542 brown light #C1B398 gray #696969 @@ -50,18 +49,10 @@ Females Web_Gender_Female.png # $Id$ - NarrativeWeb Styles --------------------------------------------------------------------------------------------- - General Elements ----------------------------------------------------- */ - body { - color: #000; - margin: 0; - padding: 130px 0px 0px 0px; background-color: #FFF; - font-family: Arial, sans, sans-serif, Helvetica; } div { margin:0; @@ -136,7 +127,7 @@ h4 { color: #FFF; margin-top: .3cm; padding:.2em 0 .2em 20px; - background-color: #453619; + background-color: #000; border-bottom:solid 4px #5D835F; } h5, h6 { @@ -144,6 +135,17 @@ h5, h6 { font-style:italic; margin:1.3em 0 .5em 1em; } +a { + color: #542; +} +a:visited { + color: #542; +} +a:hover { + color: #000; + background-color: #C1B398; + text-decoration:underline; +} p#description { max-width:800px; margin:0; @@ -153,10 +155,6 @@ p#description:first-letter { color: #228A22; font-size:xx-large; } -p a { - color: #FFF; - text-decoration:underline; -} sup { line-height:0; } @@ -173,17 +171,6 @@ ol li a { ol li a:hover { text-decoration:underline; } -a { - color: #542; -} -a:visited { - color: #542; -} -a:hover { - color: #000; - background-color: #C1B398; - text-decoration:underline; -} span.preposition { padding-left:1em; padding-right:1em; @@ -197,7 +184,8 @@ span.preposition { ----------------------------------------------------- */ #header { position: fixed; - top: 0; + top: 0px; + left: 0px; overflow: auto; width: 100%; height: 90px; @@ -205,16 +193,13 @@ span.preposition { background-color: #542; border-bottom: solid 8px #5D835F; } -body#WebCal #header, body#fullyearlinked #header { - width: 100%; - height; 90px; -} #SiteTitle { margin:0; padding:.5em 0 0.5em 10px; - font-size: 40px; + font-size: 36px; + font-weight: bold; color: #FFF; - font-style:italic; + font-style: italic; } p#user_header { font-size:1.3em; @@ -278,60 +263,38 @@ p#user_header { padding:0; } -/* Alphabet Navigation ------------------------------------------------------ */ -div#alphabet { - padding:0; - margin:0; -} -div#alphabet ul { - list-style:none; - min-width:770px; - height:24px; - margin:0; - padding:0 0 0 9px; - border-top:solid 2px #000; - border-bottom:solid 4px #000; - background-color: #6AF364; -} -div#alphabet ul li:after { - content:" |"; -} -div#alphabet ul li:first-child { - content: " |"; -} -div#alphabet ul li.letters { - margin:0; - float:left; -} -div#alphabet ul li.letters a { - display:block; - float:left; - font:bold 16px/100% sans; - color: #000; - margin:0; - padding:5px 5px; - text-decoration:none; -} -div#alphabet ul li.letters a:hover { - background-color: #000; - color: #FFF; -} - /* Navigation ----------------------------------------------------- */ -#navigation { +div#nnavigation, div#subnavigation { + width: 100%; + height: 32px; +} +body#NarrativeWeb #navigation { position: fixed; top: 104px; - width: 100%; - height: 52px; + left: 0px; } -body#WebCal #navigation, body#fullyearlinked #navigation { - width: 100%; - height: 52px; +body#WebCal #navigation { + position: fixed; + top: 140px; + left: 24px; + right: 20px; } -#subnavigation { - width: 100%; +body#fullyearlinked #navigation, body#OneDay #navigation { + position: fixed; + top: 140px; + left: 0px; +} +body#WebCal #subnavigation { + position: fixed; + top: 98px; + left: 24px; + right: 20px; +} +body#fullyearlinked #subnavigation, body#OneDay #subnavigation { + position: fixed; + top: 98px; + left: 0px; } #navigation ul, #subnavigation ul { list-style:none; @@ -339,45 +302,49 @@ body#WebCal #navigation, body#fullyearlinked #navigation { height:32px; margin:0; padding:0 0 0 20px; - background-color: #FFF; - border-bottom:solid 2px #000; + border-bottom:solid 2px #5D835F; } #navigation ul li, #subnavigation ul li { margin:0; float:left; } #navigation ul li a, #subnavigation ul li a { + padding: 6px 10px 8px 1px; display:block; float:left; font:normal 16px/100% serif; color: #000; text-decoration:none; margin:0; - padding:5px 5px; - +} +body#WebCal #navigation ul li a, body#fullyearlinked #navigation ul li a, +body#WebCal #subnavigation ul li a { + color: #FFF; +} +body#fullyearlinked #subnavigation ul li a { + color: #000; } #navigation ul li a:hover, #subnavigation ul li a:hover { + margin-top: -6px; + padding: 11px 10px 12px 1px; background-color: #C1B398; color: #000; - border-top:solid 3px #C1B398; - border-bottom:solid 8px #C1B398; } #navigation ul li.CurrentSection a, #subnavigation ul li.CurrentSection a { font-weight:bold; - font-size:16px; + font-style: italic; margin-top:-6px; - padding-top:11px; - padding-bottom:8px; + padding: 11px 10px 12px 1px; background-color: #CCC; color: #000; - border-bottom:solid 4px #CCC; } #navigation ul li.CurrentSection a:hover { background-color: #000; color: #FFF; } #subnavigation ul li.CurrentSection a { - border-width:0 0 1px 0; + border-width: 0px 0px 2px 0px; + border-color: #FFF; } /* Main Table @@ -389,12 +356,13 @@ table.infolist { font-size: 12px; } table.infolist thead tr th { - font:normal 1.1em/1.2em serif; + font:bold 1.1em/1.2em serif; + text-transform: uppercase; color: #000; margin:0; padding:.2em 10px; background-color: #6AF364; - border: solid 1px #5D835F; + border: solid 1px #000; } table.infolist thead tr th a { background-color: #6AF364; @@ -414,7 +382,7 @@ table.infolist tr td a { color: #000; } table.infolist tr.BeginLetter td, table.infolist tr.BeginSurname td { - border-top:solid 1px #453619; + border-top:solid 1px #000; } table.infolist tr td.ColumnLetter { width:3%; @@ -458,6 +426,55 @@ table.infolist tbody tr td.ColumnParents span.mother:before { content:"+ "; } +/* + NarrativeWeb +----------------------------------------------------- */ +body#NarrativeWeb { + color: #000; + margin: 0; + padding: 160px 0px 0px 4px; + background-color: #FFF; + font-family: Arial, sans, sans-serif, Helvetica; +} + +/* Alphabet Navigation +----------------------------------------------------- */ +div#alphabet { + position: fixed; + top: 136px; + left: 4px; + width: 100%; + height: 32px; + overflow: auto; + border-width: 2px 4px 2px 4px; + border-style: solid; + border-color: #5D835F; + background-color: #6AF364; +} +div#alphabet ul { + display: block; + list-style: none; + margin: 0; + padding: 0px 0px 0px 20px; +} +div#alphabet ul li { + display: block; + padding: 6px 0px 6px 16px; + font: bold 16px/100% sans; + margin:0; + float: left; +} +div#alphabet ul li:before { + content: "| "; +} +div#alphabet ul li a { + text-decoration: none; +} +div#alphabet ul li a:hover { + padding: 20px 8px 10px 4px; + background-color: #C1B398; +} + /* Surnames ----------------------------------------------------- */ #Surnames { } @@ -487,6 +504,9 @@ table.surnamelist thead tr th.ColumnLetter { table.surnamelist tbody tr td { background-color: #D8F3D6; } +table.surnamelist tbody tr td.ColumnLetter a { + background: none; +} table.surnamelist tbody tr td.ColumnSurname { background-color: #FFF; } @@ -514,30 +534,30 @@ table.surnamelist tbody tr td.ColumnSurname:hover, table.surname { border-bottom:solid 1px #000; } -table.surname tbody tr td { - border-bottom:dashed 1px #000; -} table.surname thead tr th.ColumnName { width:20%; padding-left:20px; } -table.surname tbody tr td.ColumnName { - background-color: #FFF; - width:20%; - padding:0; +table.surname tbody tr td { + border-bottom: dashed 1px #000; + background-color: #D8F3D6; } -table.surname tbody tr td.ColumnName a { - display:block; - padding:.6em 10px .6em 20px; +table.surname tbody tr td a { + display: block; + padding: .6em 10px .6em 20px; + background-color: #FFF; +} +table.surname tbody tr td a:hover { + background-color: #C1B398; +} +table.surname tbody tr td.ColumnName { + width:20%; } table.surname tbody tr td.ColumnName a span.grampsid { } table.surname tbody tr td.ColumnName:hover { background-color: #C1B398; } -table.surname tbody tr td.ColumnPartner { - background-color: #FFF; -} table.surname thead tr th.ColumnParents, table.surname tbody tr td.ColumnParents { width:25%; @@ -548,12 +568,19 @@ table.surname tbody tr td.ColumnParents { #Individuals { } #Individuals table.individuallist { - border-bottom:solid 1px #453619; + border-bottom:solid 1px #5D835F; } #Individuals table.individuallist tbody tr td { - border-bottom:dashed 1px #453619; + border-bottom: dashed 1px #000; + background-color: #D8F3D6; +} +#Individuals table.individuallist tbody tr td a { + background-color: #FFF; + display: block; + padding: .6em 10px; } #Individuals table.individuallist tbody tr td a:hover { + background-color: #C1B398; text-decoration:none; } table.individuallist tbody tr td.ColumnSurname a:hover, @@ -564,25 +591,9 @@ table.individuallist tbody tr td.ColumnSurname a:active { } table.individuallist tbody tr td.ColumnName { padding:0; - background-color: #FFF; } -table.individuallist tbody tr td.ColumnName a { - display:block; - padding:.6em 10px; - vertical-align:middle; -} -table.individuallist tbody tr td.ColumnName a:hover { } - table.individuallist tbody tr td.ColumnPartner { padding:0; - background-color: #FFF; -} -table.individuallist tbody tr td.ColumnPartner a { - display:block; - padding:.6em 10px; - vertical-align:middle; -} -table.individuallist tbody tr td.ColumnPartner a:hover { } #Individuals div table.infolist tr td p { font:normal .9em/1.2em sans-serif; @@ -592,8 +603,6 @@ table.individuallist tbody tr td.ColumnPartner a:hover { display:inline; } -/* IndividualDetail ------------------------------------------------------- */ #IndividualDetail { } #IndividualDetail div table.infolist tr td { @@ -640,31 +649,39 @@ table.eventlist tbody tr td { background-color: #D8F3D6; padding: 4px 0px 4px 0px; } +table.eventlist tbody tr td a { + display: block; + padding: .3em 30px .4em 0px; +} +table.eventlist tbody tr td a:hover { + background-color: #C1B398; +} table.eventlist tbody tr td.ColumnType { - background-color: #FFF; border-top: solid 1px #5D835F; width: 20%; } +table.eventlist tbody tr td.ColumnType a { + background-color: #FFF; +} table.eventlist tbody tr td.ColumnDate { width: 16%; } table.eventlist tbody tr td.ColumnPlace { - background-color: #FFF; width: 35%; } table.eventlist tbody tr td.ColumnSources { - background-color: #FFF; width: 12%; } +table.eventlist tbody tr td.ColumnSources sup { + margin-top: 1em; +} table.eventlist tbody tr td.ColumnNotes { width: 25%; } table.eventlist tbody tr td.ColumnPerson { - background-color: #FFF; width: 35%; } table.eventlist tbody tr td.ColumnPartner { - background-color: #FFF; width: 35%; } div#EventDetail h3 { @@ -713,7 +730,7 @@ div#EventDetail table.eventlist tbody tr td.ColumnType { #GalleryNav a { font-weight:bold; text-decoration:none; - border:solid 1px #453619; + border:solid 1px #5D835F; } #GalleryNav a:hover { } @@ -738,7 +755,7 @@ div#EventDetail table.eventlist tbody tr td.ColumnType { position:relative; overflow:hidden; text-align:center; - border:solid 1px #453619; + border:solid 1px #5D835F; } #GalleryDisplay img { margin:0 auto; @@ -777,7 +794,7 @@ table.exiflist tr td.ColumnValue { width:500px; margin:0 auto; padding:3em; - border:double 4px #453619; + border:double 4px #5D835F; } #Contact #summaryarea img { float:right; @@ -970,17 +987,16 @@ div#events h4 { padding-left:20px; } #IndividualDetail div#events table.infolist tbody tr td { - padding-top:.4em; - padding-bottom:.8em; + padding: .4em 0 .8em 0; } #IndividualDetail div#events table.infolist tbody tr td.ColumnAttribute { - border-bottom:solid 1px #453619; + border-bottom:solid 1px #5D835F; } #IndividualDetail div#events table.infolist tbody tr td.ColumnValue { - border-bottom:solid 1px #000; + border-bottom:solid 1px #5D835F; } table.infolist tbody tr td.ColumnValue p { - font-family:sans-serif; + font-family: sans-serif; color: #696969; margin:.2em 0 0 2em; } @@ -1297,7 +1313,7 @@ div#pedigree { margin-top:-25px; margin-left:16px; background-color: #FFF; - border:solid 1px #453619; + border:solid 1px #5D835F; } #treeContainer div.boxbg a:hover { position:relative; @@ -1308,7 +1324,7 @@ div#pedigree { width:190px; margin-left:-20px; padding:10px 25px 12px 25px; - border:solid 2px #453619; + border:solid 2px #5D835F; } #treeContainer div.boxbg a:hover, #treeContainer div.AncCol3 a:hover, @@ -1372,7 +1388,7 @@ div#pedigree { height:1px; margin:0 0 0 16px; padding:0; - background-color: #453619; + background-color: #000; } #tree div div.bhline { position:absolute; @@ -1380,7 +1396,7 @@ div#pedigree { width:1px; margin:0 0 0 16px; padding:0; - background-color: #453619; + background-color: #000; } .ghline, .gvline { display:none; @@ -1390,7 +1406,7 @@ div#pedigree { -------------------------------------------------------------------------------------------- */ /* Calendar : General */ body#WebCal { - padding: 98px 14px 0px 14px; + padding: 170px 14px 0px 14px; background-color: #542; } .calendar { @@ -1437,13 +1453,13 @@ body#WebCal { font-style:italic; color: #000; background-color: #6AF364; - border:solid 2px #453619; + border:solid 2px #5D835F; } .calendar tfoot tr td { padding:.7em 5% 1em 5%; border-top:solid 2px #000; vertical-align:middle; - color: #453619; + color: #000; background-color: #D8F3D6; } @@ -1468,7 +1484,7 @@ body#WebCal { padding:0; border-width:1px 0 0 1px; border-style:solid; - border-color: #453619; + border-color: #5D835F; } .calendar tbody tr td.weekday { background-color: #FFF; @@ -1477,13 +1493,13 @@ body#WebCal { background-color: #D8F3D6; } .calendar tbody tr td.saturday { - border-right:solid 1px #453619; + border-right:solid 1px #5D835F; } .calendar tbody tr td.sunday { - border-left:solid 1px #453619; + border-left:solid 1px #5D835F; } .calendar tbody tr td:first-child { - border-left:solid 1px #453619; + border-left:solid 1px #5D835F; } .calendar tbody tr:first-child td { border-top:none; @@ -1502,7 +1518,7 @@ body#WebCal { width:92%; margin:0 4%; padding:.2em 0 .3em 0; - border-top:dashed 1px #453619; + border-top:dashed 1px #000; } .calendar tbody tr td ul li:first-child { border:none; @@ -1514,7 +1530,7 @@ body#WebCal { color: #0A65B5; } .calendar tbody tr td ul li span.yearsmarried em { - color: #453619; + color: #000; } .calendar tbody tr td.highlight { } @@ -1534,7 +1550,7 @@ body#WebCal { /* Calendar : Full Year */ body#fullyearlinked { - padding: 98px 14px 0px 14px; + padding: 170px 0px 0px 0px; } body#fullyearlinked div.content { width:963px; @@ -1545,7 +1561,7 @@ body#fullyearlinked table.calendar { float:left; width:320px; height:18em; - border:solid 1px #453619; + border:solid 1px #5D835F; } body#fullyearlinked table.calendar thead tr th { height:2em; @@ -1563,3 +1579,8 @@ body#fullyearlinked table.calendar tbody tr td.saturday { body#fullyearlinked able.calendar tbody tr td.sunday { border:solid 2px #000; } + +/* Calendar : One Day */ +body#OneDay { + padding: 170px 0px 0px 0px; +} diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index 31b25c576..a4e9123ed 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -255,6 +255,7 @@ class BasePage(object): self.noid = report.options['nogid'] self.linkhome = report.options['linkhome'] self.create_media = report.options['gallery'] + self.inc_events = report.options['inc_events'] def dump_attribute(self, attr, showsrc): """ @@ -271,7 +272,7 @@ class BasePage(object): ("Value", attr.get_value() ) ] if showsrc: - srcrefs = self.get_citation_links(attr.get_source_references() ) + srcrefs = self.get_citation_links(attr.get_source_references() ) or " " source_row = ("Sources", srcrefs) attr_data_row.append(source_row) @@ -404,8 +405,7 @@ class BasePage(object): # return unordered note list to its callers return unordered - def display_event_row(self, evt, evt_ref, showplc, showdescr, showsrc, - shownote, subdirs, hyp): + def display_event_row(self, evt, evt_ref, showplc, showdescr, showsrc, shownote, subdirs, hyp): """ display the event row for class IndividualPage @@ -436,8 +436,7 @@ class BasePage(object): """ for more information: see get_event_data() """ - event_data = self.get_event_data(evt, evt_ref, showplc, showdescr, showsrc, - shownote, subdirs, hyp) + event_data = self.get_event_data(evt, evt_ref, showplc, showdescr, showsrc, shownote, subdirs, hyp) for (label, colclass, data) in event_data: data = data or " " @@ -456,16 +455,21 @@ class BasePage(object): url = self.report.build_url_fname_html(handle, 'evt', up) - evt_hyper = Html('a', eventtype, href=url, title=eventtype) - if not self.noid and gid: - evt_hyper += Html('span', ' [%s] ' % gid, class_ = "grampsid", - inline = True) + # if event pages are being created, then hyperlink the event type + if self.inc_events: + evt_hyper = Html('a', eventtype, href=url, title=eventtype) + if not self.noid and gid: + evt_hyper += Html('span', ' [%s] ' % gid, class_ = "grampsid", + inline = True) - # return event hyper link to its callers - return evt_hyper + # return event hyper link to its callers + return evt_hyper - def get_event_data(self, evt, evt_ref, showplc, showdescr, showsrc, shownote, - subdirs, hyper, gid=None): + # return just the eventtype + else: + return eventtype + + def get_event_data(self, evt, evt_ref, showplc, showdescr, showsrc, shownote, subdirs, hyp, gid=None): """ retrieve event data from event and evt_ref @@ -476,7 +480,7 @@ class BasePage(object): @param: showsrc = to show the event source references or not? @param: shownote = show notes or not? @param: subdirs = either True or False - @param: hyper = to hyperlink the event type or not? + @param: hyp = to hyperlink the event type or not? """ db = self.report.database @@ -484,7 +488,7 @@ class BasePage(object): evt_type = get_event_type(evt, evt_ref) # get hyperlink or not? - if hyper: + if hyp: evt_hyper = self.event_link(evt_type, evt_ref.ref, gid, subdirs) else: evt_hyper = evt_type @@ -516,13 +520,14 @@ class BasePage(object): info.append(descr_row) if showsrc: - srcrefs = evt.get_source_references() + srcrefs = self.get_citation_links( evt.get_source_references() ) or " " source_row = [SHEAD, 'Sources', srcrefs] info.append(source_row) if shownote: notelist = evt.get_note_list() notelist.extend(evt_ref.get_note_list() ) + notelist = self.dump_notes(notelist) note_row = [NHEAD, 'Notes', notelist] info.append(note_row) @@ -681,11 +686,10 @@ class BasePage(object): addr_header.append([SHEAD, 'Sources']) for (label, colclass) in addr_header: - trow += Html("th", label, class_ = "Column%s" % colclass, - inline = True) + trow += Html("th", label, class_ = "Column%s" % colclass, inline = True) # return table header row back to module - return trow, addr_header + return trow # begin summaryarea division with Html("div", id="summaryarea") as summaryarea: @@ -703,8 +707,7 @@ class BasePage(object): table += thead # add header row - header_row, addr_header = write_address_header(showsrc) - thead += header_row + thead += write_address_header(showsrc) # begin table body tbody = Html("tbody") @@ -717,30 +720,26 @@ class BasePage(object): tbody += trow addr_data_row = [ - [_dd.display(address.get_date_object() )], - [address.get_street()], - [address.get_city()], - [address.get_county()], - [address.get_state()], - [address.get_country()], - [address.get_postal_code()], - [address.get_phone()] ] + ["Date", _dd.display(address.get_date_object() )], + ["Streetaddress", address.get_street()], + ["City", address.get_city()], + ["County", address.get_county()], + ["State/ Province", address.get_state()], + ["Cntry", address.get_country()], + ["Postslcode", address.get_postal_code()], + ["Phone", address.get_phone()] ] # get source citation list if showsrc: - addr_data_row.append([self.get_citation_links( + addr_data_row.append(["Sources", self.get_citation_links( address.get_source_references() )]) - index = 0 - for value in addr_data_row: - colclass = addr_header[index][1] + for (colclass, value) in addr_data_row: value = value or " " - trow += Html("td", value, class_ = "Column%s" % colclass, - inline = True) - index += 1 + trow += Html("td", value, class_ = "Column%s" % colclass, inline = True) - # address: note list + # address: notelist notelist = self.display_note_list(address.get_note_list()) if notelist is not None: summaryarea += notelist @@ -924,8 +923,10 @@ class BasePage(object): page, head, body = Html.page('%s - %s' % (html_escape(self.title_str), html_escape(title)), - self.report.encoding, xmllang - ) + self.report.encoding, xmllang ) + + # add narrative specific body id + body.attr = 'id="NarrativeWeb" ' # create additional meta tags meta = (Html('meta', attr = _META1) + @@ -1381,23 +1382,6 @@ class BasePage(object): # return hyperlink to its caller return hyper - def individual_link(self, url, person): - """ - creates a hyperlink for a partner in IndividualListPage, and SurnameListPage - with no image class attached to it. - - @param: url = hyperlink to person - @param: person = person to be hyperlinked - """ - - person_name = self.get_name(person) - - # 1. start building link to image or person - hyper = Html('a', person_name, href=url, title=html_escape(person_name)) - - # return hyperlink to its caller - return hyper - # TODO. Check img_url of callers def media_link(self, handle, img_url, name, up, usedescr=True): url = self.report.build_url_fname_html(handle, 'img', up) @@ -1499,23 +1483,23 @@ class IndividualListPage(BasePage): indlistpage, body = self.write_header(_('Individuals')) # begin Individuals division - with Html("div", class_ = "content", id="Individuals") as section: - body += section + with Html("div", class_ = "content", id="Individuals") as individuallist: + body += individuallist - # Individual List description + # add alphabet navigation + alpha_nav = alphabet_navigation(db, person_handle_list, _PERSON) + if alpha_nav is not None: + individuallist += alpha_nav + + # Individual List page message msg = _("This page contains an index of all the individuals in the " "database, sorted by their last names. Selecting the person’s " "name will take you to that person’s individual page.") - section += Html('p', msg, id='description') - - # add alphabet navigation after page msg - alpha_nav = alphabet_navigation(db, person_handle_list, _PERSON) - if alpha_nav is not None: - section += alpha_nav + individuallist += Html('p', msg, id='description') # begin table and table head with Html("table", class_ = "infolist IndividualList") as table: - section += table + individuallist += table thead = Html("thead") table += thead @@ -1547,9 +1531,7 @@ class IndividualListPage(BasePage): tbody = Html("tbody") table += tbody - # list of person handles for this report person_handle_list = sort_people(db, person_handle_list) - for (surname, handle_list) in person_handle_list: first = True if surname: @@ -1565,20 +1547,20 @@ class IndividualListPage(BasePage): # surname column trow = Html("tr") + tbody += trow tcell = Html("td", class_ = "ColumnSurname", inline = True) + trow += tcell if first: trow.attr = 'class="BeginSurname"' if surname: - tcell += Html('a', surname, name=letter, title='Letter %s' % letter, - inline = True) + tcell += Html('a', surname, name=letter, + title='Surnames starting with letter %s' % letter) else: tcell += " " else: tcell += " " - tbody += trow - trow += tcell - first = False + # firstname column tcell = Html("td", class_ = "ColumnName") trow += tcell @@ -1588,6 +1570,8 @@ class IndividualListPage(BasePage): # birth column if showbirth: tcell = Html("td", class_ = "ColumnBirth", inline = True) + trow += tcell + birth = ReportUtils.get_birth_or_fallback(db, person) if birth: birth_date = _dd.display(birth.get_date_object()) @@ -1597,11 +1581,12 @@ class IndividualListPage(BasePage): tcell += Html('em', birth_date) else: tcell += " " - trow += tcell # death column if showdeath: tcell = Html("td", class_ = "ColumnDeath", inline = True) + trow += tcell + death = ReportUtils.get_death_or_fallback(db, person) if death: death_date = _dd.display(death.get_date_object()) @@ -1611,11 +1596,12 @@ class IndividualListPage(BasePage): tcell += Html('em', death_date) else: tcell += " " - trow += tcell # partner column if showpartner: tcell = Html("td", class_ = "ColumnPartner") + trow += tcell + family_list = person.get_family_handle_list() first_family = True partner_name = None @@ -1630,7 +1616,7 @@ class IndividualListPage(BasePage): tcell += ', ' if partner_handle in report_handle_list: url = self.report.build_url_fname_html(partner_handle, 'ppl') - tcell += self.individual_link(url, partner) + tcell += self.person_link(url, partner, True, partner.gramps_id) else: tcell += partner_name first_family = False @@ -1638,11 +1624,12 @@ class IndividualListPage(BasePage): tcell += " " else: tcell += " " - trow += tcell # parents column if showparents: tcell = Html("td", class_ = "ColumnParents") + trow += tcell + parent_handle_list = person.get_parent_family_handle_list() if parent_handle_list: parent_handle = parent_handle_list[0] @@ -1656,8 +1643,7 @@ class IndividualListPage(BasePage): if mother: mother_name = self.get_name(mother) if mother and father: - fathercell = Html('span', father_name, - class_ = "father fatherNmother") + fathercell = Html('span', father_name, class_ = "father fatherNmother") mothercell = Html('span', mother_name, class_ = "mother") tcell += (fathercell, mothercell) elif mother: @@ -1666,7 +1652,6 @@ class IndividualListPage(BasePage): tcell += Html('span', father_name, class_ = "father") else: tcell += " " - trow += tcell # create clear line for proper styling # create footer section @@ -1786,7 +1771,7 @@ class SurnamePage(BasePage): tcell += ',' if partner_handle in report_handle_list: url = self.report.build_url_fname_html(partner_handle, 'ppl', True) - tcell += self.individual_link(url, partner) + tcell += self.person_link(url, partner, True, partner.gramps_id) else: tcell += partner_name else: @@ -1844,22 +1829,23 @@ class PlaceListPage(BasePage): placelistpage, body = self.write_header(_('Places')) # begin places division - with Html("div", class_ = "content", id="Places") as section: - body += section - - msg = _("This page contains an index of all the places in the " - "database, sorted by their title. Clicking on a place’s " - "title will take you to that place’s page.") - section += Html('p', msg, id='description') + with Html("div", class_ = "content", id="Places") as placelist: + body += placelist # begin alphabet navigation alpha_nav = alphabet_navigation(db, place_handles, _PLACE) if alpha_nav is not None: - section += alpha_nav + placelist += alpha_nav + + # place list page message + msg = _("This page contains an index of all the places in the " + "database, sorted by their title. Clicking on a place’s " + "title will take you to that place’s page.") + placelist += Html('p', msg, id='description') # begin places table and table head with Html("table", class_ = "infolist placelist") as table: - section += table + placelist += table # begin table head thead = Html("thead") @@ -1892,22 +1878,21 @@ class PlaceListPage(BasePage): if lang_country == "sv_SE" and ( letter == u'W' or letter == u'V' ): letter = u'V,W' + trow = Html("tr") + tbody += trow if letter != last_letter: last_letter = letter - trow = Html("tr", class_ = "BeginLetter") - tbody += trow + trow.attr = 'class = "BeginLetter" ' tcell = Html("td", class_ = "olumnLetter", inline = True) + ( Html('a', last_letter, name=last_letter, - title="Letter %s" % last_letter) + title="Places beginning with letter %s" % last_letter) ) else: - trow = Html("tr") - tbody += trow tcell = Html("td", " ", class_ = "ColumnLetter", inline = True) trow += tcell tcell = Html("td", class_ = "ColumnName") + \ - self.place_link(place.handle, place_title, place.gramps_id) + self.place_link(place.handle, place_title, place.gramps_id) trow += tcell # add clearline for proper styling @@ -2628,20 +2613,20 @@ class SurnameListPage(BasePage): with Html("div", class_ = "content", id="surnames") as surnamelist: body += surnamelist - # page description - msg = _( 'This page contains an index of all the ' - 'surnames in the database. Selecting a link ' - 'will lead to a list of individuals in the ' - 'database with this same surname.') - surnamelist += Html('p', msg, id='description') - - # add alphabet navigation after page msg + # add alphabet navigation... # only if surname list not surname count if order_by == self.ORDER_BY_NAME: alpha_nav = alphabet_navigation(db, person_handle_list, _PERSON) if alpha_nav is not None: surnamelist += alpha_nav + # page message + msg = _( 'This page contains an index of all the ' + 'surnames in the database. Selecting a link ' + 'will lead to a list of individuals in the ' + 'database with this same surname.') + surnamelist += Html('p', msg, id='description') + if order_by == self.ORDER_BY_COUNT: table_id = 'SortByCount' else: @@ -2711,8 +2696,8 @@ class SurnameListPage(BasePage): trow.attr = ' class="BeginLetter" ' tcell = Html("td", class_ = "ColumnLetter", inline = True) + ( - Html('a', last_letter, name=last_letter) - ) + Html('a', last_letter, name=last_letter, + title="Surnames starting with letter %s" % last_letter) ) trow += tcell tcell = Html("td", class_ = "ColumnSurname") + \ @@ -2911,41 +2896,45 @@ class SourcePage(BasePage): section += thumbnail # add section title - section += Html('h3', html_escape(self.page_title.strip()), inline = True) + section += Html('h3', html_escape(source.get_title()), inline = True) # begin sources table with Html("table", class_ = "infolist source") as table: section += table + tbody = Html("tbody") + table += tbody + grampsid = None if not self.noid: grampsid = source.gramps_id for (label, val) in [(_('GRAMPS ID'), grampsid), - (_('Author'), source.author), - (_('Publication information'), source.pubinfo), - (_('Abbreviation'), source.abbrev)]: + (_('Author'), source.author), + (_('Publication information'), source.pubinfo), + (_('Abbreviation'), source.abbrev)]: if val: trow = Html("tr") + ( Html("td", label, class_ = "ColumnAttribute"), Html("td", val, class_ = "ColumnValue") ) - table += trow + tbody += trow # additional media - sourcegallery = self.display_additional_images_as_gallery(media_list) - if sourcegallery is not None: - section += sourcegallery + sourcemedia = self.display_additional_images_as_gallery(media_list) + if sourcemedia is not None: + section += sourcemedia # additional notes - sourcenotes = self.display_note_list(source.get_note_list()) - if sourcenotes is not None: - section += sourcenotes + notelist = source.get_note_list() + if notelist: + notelist = self.display_note_list(notelist) + section += notelist # references - source_references = self.display_references(src_list[source.handle]) - if source_references is not None: - section += source_references + src_references = self.display_references(src_list[source.handle]) + if src_references is not None: + section += src_references # add clearline for proper styling # add footer section @@ -4348,7 +4337,7 @@ class IndividualPage(BasePage): event_header_row.append(descr_row) if showsrc: - source_row = (SHEAD, 'Sources') + source_row = (SHEAD, 'Sources') event_header_row.append(source_row) if shownote: @@ -5750,23 +5739,32 @@ def alphabet_navigation(db, handle_list, key): num_ltrs = len(sorted_alpha_index) nrows = (num_ltrs / 35) + 1 index = 0 + + first_letter = True for rows in xrange(nrows): unordered = Html('ul') section += unordered + cols = 0 while (cols <= 35 and index < num_ltrs): + list = Html("li", inline = True) + unordered += list + + if first_letter: + list.attr = 'class = "CurrentSection" ' + ltr = sorted_alpha_index[index] title_str = _('Surnames') if key == 0 else _('Places') if lang_country == "sv_SE" and ltr == u'V': title_str += _(' starting with %s') % "V,W" - unordered += (Html('li', class_ = "letters", inline = True) + - Html('a', "V,W", href="#V,W", title=title_str) - ) + hyper = Html('a', "V,W", href="#V,W") else: title_str += _(' starting with %s') % ltr - unordered += Html('li', class_ = "letters", inline = True) + ( - Html('a', ltr, href='#%s' % ltr, title=title_str) - ) + hyper = Html('a', ltr, href='#%s' % ltr) + hyper.attr += "title = %s" % title_str + list += hyper + + first_letter = False cols += 1 index += 1 diff --git a/src/plugins/webreport/WebCal.py b/src/plugins/webreport/WebCal.py index 0b4b12f6f..7fd977d5d 100644 --- a/src/plugins/webreport/WebCal.py +++ b/src/plugins/webreport/WebCal.py @@ -432,10 +432,6 @@ class WebCalReport(Report): currentsection = proper styling of this navigation bar """ - # creating more than one year - if not self.multiyear: - return - num_years = (self.end_year - self.start_year) cal_year = self.start_year @@ -443,49 +439,43 @@ class WebCalReport(Report): # otherwise, 18 years in a row years_in_row = 22 if self.css is not 'Web_Visually.css' else 18 - # figure out number of rows - nrows = get_num_of_rows(num_years, years_in_row) - # begin year division - yearnav = Html("div", id="navigation") + with Html("div", id = "navigation") as section: - for row in range(0, (num_years // years_in_row)): + for row in xrange((num_years // years_in_row) + 1): - unordered = Html("ul") - yearnav += unordered - cols = 1 - while (cols <= years_in_row and cal_year <= self.end_year): - url = '' + unordered = Html("ul") + section += unordered - # begin subdir level - subdirs = ['..'] * nr_up - subdirs.append(str(cal_year)) + cols = 1 + while (cols <= years_in_row and cal_year <= self.end_year): + url = '' - # each year will link to current month. - # this will always need an extension added - full_month_name = get_full_month_name(self.today.get_month()) + # begin subdir level + subdirs = ['..'] * nr_up + subdirs.append(str(cal_year)) - # Note. We use '/' here because it is a URL, not a OS dependent - # pathname. - url = os.path.join(subdirs, full_month_name) + self.ext -# url = '/'.join(subdirs + [full_month_name]) + self.ext + # each year will link to current month. + # this will always need an extension added + full_month_name = get_full_month_name(self.today.get_month()) - # Figure out if we need
  • or just plain
  • - cs = str(cal_year) == currentsection and 'class="CurrentSection"' or '' - unordered += Html("li", attr=cs , inline = True) + ( + # Note. We use '/' here because it is a URL, not a OS dependent + # pathname. + url = '/'.join(subdirs + [full_month_name]) + self.ext - # create hyperlink - Html("a", str(cal_year), href = url, inline = True) - ) + # Figure out if we need
  • or just plain
  • + cs = str(cal_year) == currentsection and 'class="CurrentSection"' or '' + unordered += Html("li", attr=cs , inline = True) + ( - # increase columns - cols += 1 + # create hyperlink + Html("a", str(cal_year), href = url, title=str(cal_year), inline = True) + ) - # increase calendar year - cal_year += 1 + cols += 1 + cal_year += 1 # return yearnav to its caller - return yearnav + return section # --------------------------------------------------------------------------------------- # @@ -516,49 +506,49 @@ class WebCalReport(Report): # Add a link for year_glance() if requested navs.append(('fullyearlinked', _('Year Glance'), self.fullyear)) - monthnav = Html("div", id="subnavigation") - ul = Html("ul") + # begin month subnavigation + with Html("div", id = "subnavigation") as section: - navs = [(u, n) for u, n, c in navs if c] - for url_fname, nav_text in navs: + unordered = Html("ul") + section += unordered - if type(url_fname) == int: - url_fname = get_full_month_name(url_fname) + navs = [(u, n) for u, n, c in navs if c] + for url_fname, nav_text in navs: - if type(nav_text) == int: - nav_text = get_short_month_name(nav_text) + if type(url_fname) == int: + url_fname = get_full_month_name(url_fname) - # Note. We use '/' here because it is a URL, not a OS dependent pathname - # need to leave home link alone, so look for it ... - url = url_fname - add_subdirs = True - if not (url.startswith('http:') or url.startswith('/')): - for ext in _WEB_EXT: - if url_fname.endswith(ext): - add_subdirs = False + if type(nav_text) == int: + nav_text = get_short_month_name(nav_text) + + # Note. We use '/' here because it is a URL, not a OS dependent pathname + # need to leave home link alone, so look for it ... + url = url_fname + add_subdirs = True + if not (url.startswith('http:') or url.startswith('/')): + for ext in _WEB_EXT: + if url_fname.endswith(ext): + add_subdirs = False - # whether to add subdirs or not??? - if add_subdirs: - subdirs = ['..'] * nr_up - subdirs.append(str(year)) - url = '/'.join(subdirs + [url_fname]) + # whether to add subdirs or not??? + if add_subdirs: + subdirs = ['..'] * nr_up + subdirs.append(str(year)) + url = '/'.join(subdirs + [url_fname]) - if not _has_webpage_extension(url): - url += self.ext + if not _has_webpage_extension(url): + url += self.ext - # Figure out if we need
  • or just plain
  • - cs = url_fname == currentsection and 'class="CurrentSection"' or '' - ul += Html("li", attr = cs, inline = True) + ( + # Figure out if we need
  • or just plain
  • + cs = url_fname == currentsection and 'class="CurrentSection"' or '' + unordered += Html("li", attr = cs, inline = True) + ( - # create hyperlink - Html("a", nav_text, href = url, inline = True) - ) - - # add ul to monthnav - monthnav += ul + # create hyperlink + Html("a", nav_text, href = url, title=url_fname, inline = True) + ) # return monthnav to its caller - return monthnav + return section # --------------------------------------------------------------------------------------- #