Fixed download page table being oversized. Removed download page note from download page. Bug#3795 should be resolved.

svn: r15002
This commit is contained in:
Rob G. Healey 2010-04-03 01:22:40 +00:00
parent 8ba3e7fbe5
commit a6dd3e861d
2 changed files with 79 additions and 86 deletions

View File

@ -177,7 +177,7 @@ a:visited {
/* Header /* Header
----------------------------------------------------- */ ----------------------------------------------------- */
#header { #header {
width:965px; width: 100%;
margin:0 auto; margin:0 auto;
padding:5em 0 2px 0; padding:5em 0 2px 0;
background:url(../images/Web_Mainz_Header.png) repeat-x top left; background:url(../images/Web_Mainz_Header.png) repeat-x top left;
@ -214,7 +214,7 @@ table tr.odd {
----------------------------------------------------- */ ----------------------------------------------------- */
#navigation, #subnavigation { #navigation, #subnavigation {
font-family:sans-serif; font-family:sans-serif;
width:965px; width: 100%;
margin:0 auto; margin:0 auto;
padding:0; padding:0;
background:url(../images/Web_Mainz_MidLight.png) #FFF2C6; background:url(../images/Web_Mainz_MidLight.png) #FFF2C6;
@ -757,12 +757,12 @@ div#EventDetail table.eventlist tbody tr td.ColumnEvent {
/* Download /* Download
----------------------------------------------------- */ ----------------------------------------------------- */
#Download { #Download {
padding:1cm; padding: 0;
height:396px; width: 100%;
height: 350px;
} }
table.download { table.download {
border:solid 2px #000; border:solid 2px #000;
width:100%;
} }
table.download img { table.download img {
text-align: center; text-align: center;
@ -1205,7 +1205,7 @@ table.weblinks tr td.ColumnDescription {
----------------------------------------------------- */ ----------------------------------------------------- */
#footer { #footer {
clear:both; clear:both;
width:965px; width: 100%;
height: 60px; height: 60px;
font-size:12px; font-size:12px;
line-height:130%; line-height:130%;

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python #
# -*- coding: utf-8 -*- # encoding: utf-8
# #
# Gramps - a GTK+/GNOME based genealogy program # Gramps - a GTK+/GNOME based genealogy program
# #
@ -792,7 +792,8 @@ class BasePage(object):
return text return text
def get_name(self, person, maiden_name = None): def get_name(self, person, maiden_name = None):
""" """ I5118
Return person's name, unless maiden_name given, unless married_name Return person's name, unless maiden_name given, unless married_name
listed. listed.
@ -800,7 +801,7 @@ class BasePage(object):
@param: maiden_name = Female's family surname @param: maiden_name = Female's family surname
""" """
# name_format is the name format that you set in options # get name format for displaying names
name_format = self.report.options['name_format'] name_format = self.report.options['name_format']
# Get all of a person's names # Get all of a person's names
@ -3355,7 +3356,6 @@ class DownloadPage(BasePage):
# menu options for class # menu options for class
# download and description #1 # download and description #1
downloadnote = self.report.downloadnote
dlfname1 = self.report.dl_fname1 dlfname1 = self.report.dl_fname1
dldescr1 = self.report.dl_descr1 dldescr1 = self.report.dl_descr1
@ -3378,90 +3378,90 @@ class DownloadPage(BasePage):
with Html("div", class_ = "content", id = "Download") as download: with Html("div", class_ = "content", id = "Download") as download:
body += download body += download
# download page note msg = _("This page is for the user/ creator of this Family Tree/ "
if downloadnote: "Narrative website to share a couple of files with you "
note = db.get_note_from_gramps_id(downloadnote) "regarding their family. If there are any files listed "
note_text = self.get_note_format(note) "below, clicking on them will allow you to download them.")
download += Html("p", note_text, id = "description") download += Html("p", msg, id = "description")
# begin download table and table head if dlfname1 or dlfname2:
with Html("table", class_ = "infolist download") as table: # begin download table and table head
download += table with Html("table", class_ = "infolist download") as table:
download += table
thead = Html("thead") thead = Html("thead")
table += thead table += thead
trow = Html("tr") trow = Html("tr")
thead += trow thead += trow
header_row = [ trow.extend(
(_("File Name"), "Filename"), Html("th", label, class_ = colclass, inline = True)
(DESCRHEAD, "Description"), for (label, colclass) in [
(_("License"), "License"), (_("File Name"), "Filename"),
(_("Last Modified"), "Modified") ] (DESCRHEAD, "Description"),
(_("License"), "License"),
(_("Last Modified"), "Modified") ]
)
trow.extend( # if dlfname1 is not None, show it???
Html("th", label, class_ = colclass, inline = True) if dlfname1:
for (label, colclass) in header_row)
# if dlfname1 is not None, show it??? # table body
if dlfname1: tbody = Html("tbody")
table += tbody
# table body trow = Html("tr", id = 'Row01')
tbody = Html("tbody") tbody += trow
table += tbody
trow = Html("tr", id = 'Row01') fname = os.path.basename(dlfname1)
tbody += trow tcell = ( Html("td", class_ = "Filename") +
Html("a", fname, href = dlfname1, alt = dldescr1)
)
trow += tcell
fname = os.path.basename(dlfname1) dldescr1 = dldescr1 or " "
tcell = ( Html("td", class_ = "Filename") + trow += Html("td", dldescr1, class_ = "Description", inline = True)
Html("a", fname, href = dlfname1, alt = dldescr1)
)
trow += tcell
dldescr1 = dldescr1 or " " copyright = self.get_copyright_license(dlcopy) or " "
trow += Html("td", dldescr1, class_ = "Description", inline = True) trow += Html("td", copyright, class_ = "License")
copyright = self.get_copyright_license(dlcopy) or " " tcell = Html("td", class_ = "Modified", inline = True)
trow += Html("td", copyright, class_ = "License") trow += tcell
if os.path.exists(dlfname1):
modified = os.stat(dlfname1).st_mtime
last_mod = datetime.datetime.fromtimestamp(modified)
tcell += last_mod
else:
tcell += " "
tcell = Html("td", class_ = "Modified", inline = True) # if download filename #2, show it???
trow += tcell if dlfname2:
if os.path.exists(dlfname1):
modified = os.stat(dlfname1).st_mtime
last_mod = datetime.datetime.fromtimestamp(modified)
tcell += last_mod
else:
tcell += " "
# if download filename #2, show it??? # begin row #2
if dlfname2: trow = Html("tr", id = 'Row02')
tbody += trow
# begin row #2 fname = os.path.basename(dlfname2)
trow = Html("tr", id = 'Row02') tcell = ( Html("td", class_ = "Filename") +
tbody += trow Html("a", fname, href = dlfname2, alt = dldescr2)
)
trow += tcell
fname = os.path.basename(dlfname2) dldescr2 = dldescr2 or " "
tcell = ( Html("td", class_ = "Filename") + trow += Html("td", dldescr2, class_ = "Description", inline = True)
Html("a", fname, href = dlfname2, alt = dldescr2)
)
trow += tcell
dldescr2 = dldescr2 or " " copyright = self.get_copyright_license(dlcopy) or " "
trow += Html("td", dldescr2, class_ = "Description", inline = True) trow += Html("td", copyright, class_ = "License", inline = True)
copyright = self.get_copyright_license(dlcopy) or " " tcell = Html("td", id = 'Col04', class_ = "Modified", inline = True)
trow += Html("td", copyright, class_ = "License", inline = True) trow += tcell
if os.path.exists(dlfname2):
tcell = Html("td", id = 'Col04', class_ = "Modified", inline = True) modified = os.stat(dlfname2).st_mtime
trow += tcell last_mod = datetime.datetime.fromtimestamp(modified)
if os.path.exists(dlfname2): tcell += last_mod
modified = os.stat(dlfname2).st_mtime else:
last_mod = datetime.datetime.fromtimestamp(modified) tcell += " "
tcell += last_mod
else:
tcell += " "
# clear line for proper styling # clear line for proper styling
# create footer section # create footer section
@ -4951,7 +4951,7 @@ class NavWebReport(Report):
self.inc_contact = self.options['contactnote'] or \ self.inc_contact = self.options['contactnote'] or \
self.options['contactimg'] self.options['contactimg']
# name format option # name format options
self.name_format = self.options['name_format'] self.name_format = self.options['name_format']
# create an event pages or not? # create an event pages or not?
@ -4965,7 +4965,6 @@ class NavWebReport(Report):
# Download Options Tab # Download Options Tab
self.inc_download = self.options['incdownload'] self.inc_download = self.options['incdownload']
self.downloadnote = self.options['downloadnote']
self.dl_fname1 = self.options['down_fname1'] self.dl_fname1 = self.options['down_fname1']
self.dl_descr1 = self.options['dl_descr1'] self.dl_descr1 = self.options['dl_descr1']
self.dl_fname2 = self.options['down_fname2'] self.dl_fname2 = self.options['down_fname2']
@ -5853,10 +5852,6 @@ class NavWebOptions(MenuReportOptions):
menu.add_option(category_name, 'incdownload', self.__incdownload) menu.add_option(category_name, 'incdownload', self.__incdownload)
self.__incdownload.connect('value-changed', self.__download_changed) self.__incdownload.connect('value-changed', self.__download_changed)
self.__downloadnote = NoteOption(_('Download page note'))
self.__downloadnote.set_help( _("A note to be used on the download page"))
menu.add_option(category_name, "downloadnote", self.__downloadnote)
self.__down_fname1 = DestinationOption(_("Download Filename"), self.__down_fname1 = DestinationOption(_("Download Filename"),
os.path.join(const.USER_HOME, "")) os.path.join(const.USER_HOME, ""))
self.__down_fname1.set_help(_("File to be used for downloading of database")) self.__down_fname1.set_help(_("File to be used for downloading of database"))
@ -6021,14 +6016,12 @@ class NavWebOptions(MenuReportOptions):
""" """
if self.__incdownload.get_value(): if self.__incdownload.get_value():
self.__downloadnote.set_available(True)
self.__down_fname1.set_available(True) self.__down_fname1.set_available(True)
self.__dl_descr1.set_available(True) self.__dl_descr1.set_available(True)
self.__down_fname2.set_available(True) self.__down_fname2.set_available(True)
self.__dl_descr2.set_available(True) self.__dl_descr2.set_available(True)
self.__dl_cright.set_available(True) self.__dl_cright.set_available(True)
else: else:
self.__downloadnote.set_available(False)
self.__down_fname1.set_available(False) self.__down_fname1.set_available(False)
self.__dl_descr1.set_available(False) self.__dl_descr1.set_available(False)
self.__down_fname2.set_available(False) self.__down_fname2.set_available(False)