From 79efac73da1dbb8c743b054224be8c30c94b5403 Mon Sep 17 00:00:00 2001 From: "Rob G. Healey" Date: Fri, 11 Sep 2009 06:24:13 +0000 Subject: [PATCH] Updated work in WebCal. Updated style elements to match current work. svn: r13193 --- src/data/Web_Visually.css | 18 +++++- src/plugins/webreport/WebCal.py | 109 ++++++++++++++++---------------- 2 files changed, 71 insertions(+), 56 deletions(-) diff --git a/src/data/Web_Visually.css b/src/data/Web_Visually.css index ddd5060c3..2a935331f 100644 --- a/src/data/Web_Visually.css +++ b/src/data/Web_Visually.css @@ -322,9 +322,18 @@ div#alphabet ul li.letters a:hover { width: 100%; height: 52px; } +body#WebCal #navigation, body#fullyearlinked #navigation { + position: fixed; + top: 100px; + width: 100%; + height: 56px; +} #subnavigation { - margin:0; - padding:0; + position: fixed; + top: 136px; + width: 100%; + height: 56px; + border-top: solid 2px #5D835F; } #navigation ul, #subnavigation ul { list-style:none; @@ -1380,7 +1389,7 @@ div#pedigree { -------------------------------------------------------------------------------------------- */ /* Calendar : General */ body#WebCal { - padding:0 14px; + padding: 172px 14px 0px 14px; background-color: #542; } .calendar { @@ -1523,6 +1532,9 @@ body#WebCal { } /* Calendar : Full Year */ +body#fullyearlinked { + padding: 144px 14px 0px 14px; +} body#fullyearlinked div.content { width:963px; margin:0 auto; diff --git a/src/plugins/webreport/WebCal.py b/src/plugins/webreport/WebCal.py index de594b85f..2fe3a4d02 100644 --- a/src/plugins/webreport/WebCal.py +++ b/src/plugins/webreport/WebCal.py @@ -360,7 +360,7 @@ class WebCalReport(Report): const.URL_HOMEPAGE) _META2 = 'name="author" content="%s"' % self.author - page, head, body = Html.page(title=title, encoding=self.encoding, lang=xmllang) + page, head, body = Html.page(title, self.encoding, xmllang) # GRAMPS favicon fname1 = '/'.join([subdirs] + ['images'] + ['favicon.ico']) @@ -369,19 +369,22 @@ class WebCalReport(Report): fname2 = '/'.join([subdirs] + ['styles'] + [_CALENDARSCREEN]) # create additional meta tags - meta = Html('meta', attr = _META1) + ( - Html('meta', attr = _META2,indent=False) + meta = Html("meta", attr = _META1) + ( + Html("meta", attr = _META2, indent=False) ) # links for GRAMPS favicon and stylesheets - links = Html('link',rel='shortcut icon', href=fname1,type='image/x-icon') + ( - Html('link',rel='stylesheet', href=fname2,type='text/css',media='screen',indent=False) + links = Html("link", rel='shortcut icon', href=fname1, + type = "image/x-icon") + ( + Html("link",rel="stylesheet", href=fname2, type="text/css", media= "screen", + indent = False) ) # add printer stylesheet to webcalendar() and one_day() only if add_print: fname = '/'.join([subdirs] + ['styles'] + [_CALENDARPRINT]) - links += Html('link',rel='stylesheet', href=fname,type='text/css',media='print',indent=False) + links += Html("link",rel="stylesheet", href=fname,type="text/css", + media="print",indent = False) # add additional meta tags and stylesheet links to head section head += (meta, links) @@ -390,10 +393,10 @@ class WebCalReport(Report): body.attr = 'id="%s"' % body_id # start header division section - headerdiv = Html('div', id="header") + ( + headerdiv = Html("div", id="header") + ( # page title - Html('h1', title, id = "SiteTitle",inline=True), + Html("h1", title, id = "SiteTitle", inline = True) ) # Created for ? @@ -404,7 +407,7 @@ class WebCalReport(Report): 'author' : self.author} else: msg = _('Created for %(author)s') % {'author' : self.author} - headerdiv += Html('p', msg, id="CreatorInfo") + headerdiv += Html("p", msg, id="CreatorInfo") # add header division to body body += headerdiv @@ -441,12 +444,12 @@ class WebCalReport(Report): nrows = get_num_of_rows(num_years, years_in_row) # begin year division and table - yearnav = Html('div', id="navigation") - year_table = Html('table') + yearnav = Html("div", id="navigation") + year_table = Html("table") for rows in range(0, nrows): - tabrow = Html('tr') - unordered = Html('ul') + trow = Html("tr") + unordered = Html("ul") cols = 1 while (cols <= years_in_row and cal_year <= self.end_year): url = '' @@ -465,10 +468,10 @@ class WebCalReport(Report): # Figure out if we need
  • or just plain
  • cs = str(cal_year) == currentsection and 'class="CurrentSection"' or '' - unordered += Html('li', attr=cs ,inline=True) + ( + unordered += Html("li", attr=cs , inline = True) + ( # create hyperlink - Html('a', str(cal_year), href = url,inline=True) + Html("a", str(cal_year), href = url, inline = True) ) # increase columns @@ -478,10 +481,10 @@ class WebCalReport(Report): cal_year += 1 # add unordered list to table row - tabrow += unordered + trow += unordered # close row and add to table - year_table += tabrow + year_table += trow # close table and add to year division yearnav += year_table @@ -518,8 +521,8 @@ 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') + monthnav = Html("div", id="subnavigation") + ul = Html("ul") navs = [(u, n) for u, n, c in navs if c] for url_fname, nav_text in navs: @@ -550,10 +553,10 @@ class WebCalReport(Report): # Figure out if we need
  • or just plain
  • cs = url_fname == currentsection and 'class="CurrentSection"' or '' - ul += Html('li', attr = cs,inline=True) + ( + ul += Html("li", attr = cs, inline = True) + ( # create hyperlink - Html('a', nav_text, href = url,inline=True) + Html("a", nav_text, href = url, inline = True) ) # add ul to monthnav @@ -611,23 +614,23 @@ class WebCalReport(Report): th_txt = '%s %d' % (month_name, year) # begin calendar table - cal_table = Html('table', class_='calendar', id = month_name) + cal_table = Html("table", class_ = "calendar", id = month_name) # begin table head, - thead = Html('thead') - tr = Html('tr') - th = Html('th', th_txt, class_ ='monthName', colspan=7,inline=True) + thead = Html("thead") + tr = Html("tr") + th = Html('th', th_txt, class_ ='monthName', colspan=7, inline = True) # add them together now tr += th thead += tr # Calendar weekday names header - weekday_names = Html('tr') + weekday_names = Html("tr") for day_col in range(7): dayclass = get_class_for_daycol(day_col) dayname = get_name_for_daycol(day_col) - th = Html('th', class_ =dayclass,inline=True) + ( + th = Html('th', class_ =dayclass, inline = True) + ( Html('abbr', dayname[0], title=dayname) ) @@ -638,7 +641,7 @@ class WebCalReport(Report): thead += weekday_names # begin table body - tbody = Html('tbody') + tbody = Html("tbody") # get first of the month and month information current_date, current_ord, monthinfo = get_first_day_of_month(year, month) @@ -649,7 +652,7 @@ class WebCalReport(Report): week = monthinfo[week_row] # if you look this up in wikipedia, the first week is called week0 - tr = Html('tr', class_ = 'week%d' % week_row) + tr = Html("tr", class_ = "week%d" % week_row) # begin calendar day column for day_col in range(0, 7): @@ -662,7 +665,7 @@ class WebCalReport(Report): tdid = "%s%02d" % (abbr_month_name, day) # add calendar date division - datediv = Html('div', day, class_='date',inline=True) + datediv = Html("div", day, class_ = "date", inline = True) # a day in the previous or next month if day == 0: @@ -678,10 +681,10 @@ class WebCalReport(Report): specclass = "next " + dayclass # continue table cell, , without id tag - td = Html('td', class_ = specclass,inline=True) + ( + td = Html('td', class_ = specclass, inline = True) + ( # adds date for previous and next month days - Html('div', specday, class_ = 'date',inline=True) + Html("div", specday, class_ = "date", inline = True) ) # add table cell, , to table row, @@ -721,7 +724,7 @@ class WebCalReport(Report): # create hyperlink to one_day() fname_date = full_month_name + '/' + fname_date - ahref = Html('a', datediv, href=fname_date,inline=True) + ahref = Html("a", datediv, href=fname_date, inline = True) # add hyperlink to table cell, td += ahref @@ -733,10 +736,10 @@ class WebCalReport(Report): else: # continue table cell, , without id tag - td = Html('td', class_ = hilightday,inline=True) + ( + td = Html('td', class_ = hilightday, inline = True) + ( # adds date division - Html('div', day, class_ = 'date',inline=True) + Html("div", day, class_ = "date", inline = True) ) # WebCal @@ -746,9 +749,9 @@ class WebCalReport(Report): td += datediv # list the events - ul = Html('ul') + ul = Html("ul") for nyears, date, text, event in day_list: - ul += Html('li', text,inline=False if event == 'Anniversary' + ul += Html("li", text, inline=False if event == 'Anniversary' else True) # add events to table cell, @@ -758,10 +761,10 @@ class WebCalReport(Report): else: # create empty day with date - td = Html('td', class_ = dayclass,inline=True) + ( + td = Html('td', class_ = dayclass, inline = True) + ( # adds date division - Html('div', day, class_ = 'date',inline=True) + Html("div", day, class_ = "date", inline = True) ) # nothing for this month @@ -769,7 +772,7 @@ class WebCalReport(Report): td = Html('td', class_ = dayclass) + ( # adds date division - Html('div', day, class_ = 'date',inline=True) + Html("div", day, class_ = "date", inline = True) ) # add table cell, , to table row, @@ -786,10 +789,10 @@ class WebCalReport(Report): if cal == "yg": # Fill up till we have 6 rows, so that the months align properly for i in range(nweeks, 6): - six_weeks = Html('tr', class_ = 'week%d' % (i + 1)) + ( + six_weeks = Html("tr", class_ = "week%d" % (i + 1)) + ( # create table cell, - Html('td', colspan=7,inline=True) + Html('td', colspan=7, inline = True) ) # add extra weeks to tbody if needed @@ -851,9 +854,9 @@ class WebCalReport(Report): note = note or " " # table foot section - cal_note = Html('tfoot') - tr = Html('tr') - td = Html('td', note, colspan=7,inline=True) + cal_note = Html("tfoot") + tr = Html("tr") + td = Html('td', note, colspan=7, inline = True) # add table cell to table row # add table row to table foot section @@ -867,7 +870,7 @@ class WebCalReport(Report): body += monthly_calendar # create blank line for stylesheets - body += Html('div', class_ = 'fullclear',inline=True) + body += Html("div", class_ = "fullclear", inline = True) # create footer division section footer = self.write_footer(nr_up) @@ -925,7 +928,7 @@ class WebCalReport(Report): 'that date, if there are any!\n')) # page description - descriptdiv = Html('div', class_ = 'content') + ( + descriptdiv = Html("div", class_ = "content") + ( # message line Html('p', msg, id='description') @@ -946,7 +949,7 @@ class WebCalReport(Report): self.progress.step() # create blank line for stylesheets - body += Html('div', class_ = 'fullclear',inline=True) + body += Html("div", class_ = "fullclear", inline = True) # write footer section footer = self.write_footer(nr_up) @@ -1007,19 +1010,19 @@ class WebCalReport(Report): # set date display as in user prevferences pg_date = _dd.display(event_date) - body += Html('h3', pg_date,inline=True) + body += Html('h3', pg_date, inline = True) # list the events ol = Html('ol') for nyears, date, text, event in day_list: - ol += Html('li', text,inline=False if event == 'Anniversary' + ol += Html("li", text, inline=False if event == 'Anniversary' else True) # add ordered list to body section body += ol # create blank line for stylesheets - body += Html('div', class_ = 'fullclear',inline=True) + body += Html("div", class_ = "fullclear", inline = True) # write footer section footer = self.write_footer(nr_up) @@ -1181,7 +1184,7 @@ class WebCalReport(Report): """ # begin calendar footer - footer = Html('div', id = 'footer') + footer = Html("div", id = 'footer') # Display date as user set in preferences msg = _('Generated by ' @@ -1753,7 +1756,7 @@ def get_day_list(event_date, holiday_list, bday_anniv_list): '%(couple)s, %(years)d' ' year anniversary', nyears) % {'couple' : text, 'years' : nyears}) - txt_str = Html('span', txt_str, class_ = 'yearsmarried') + txt_str = Html('span', txt_str, class_ = "yearsmarried") day_list.append((nyears, date, txt_str, event))