Fixed some issues with navigation menu. More refactoring in WebCal. Alphabetized the Makefile.

svn: r12139
This commit is contained in:
Rob G. Healey 2009-02-26 19:16:02 +00:00
parent 86ed7e29c2
commit a238e7448f
3 changed files with 44 additions and 40 deletions

View File

@ -7,18 +7,18 @@ pkgdatadir = $(datadir)/@PACKAGE@/DataViews
pkgdata_PYTHON = \
__init__.py\
EventView.py\
FamilyList.py\
GeoView.py\
GrampletView.py\
MediaView.py\
NoteView.py\
PedigreeView.py\
PersonView.py\
PlaceView.py\
RelationView.py\
FamilyList.py\
PedigreeView.py\
EventView.py\
SourceView.py\
PlaceView.py\
MediaView.py\
NoteView.py\
RepositoryView.py
RepositoryView.py\
SourceView.py
# _MapView.py

View File

@ -202,6 +202,7 @@ span.preposition {
color:#FFF;
margin:0;
padding:.5em 0 0 20px;
font-style:italic;
}
p#user_header {
font-size:1.3em;
@ -224,8 +225,8 @@ p#user_header {
height:32px;
margin:0;
padding:0 0 0 9px;
background-color:#6AF364;
border-bottom:solid 2px #453619;
background-color:#228A22;
border-bottom:solid 2px #D8F3D6;
}
#navigation ul li, #subnavigation ul li {
margin:0;
@ -235,10 +236,10 @@ p#user_header {
display:block;
float:left;
font:normal 16px/100% serif;
color:#542;
color:#FFF;
text-decoration:none;
margin:0;
padding:8px 13px;
padding:5px 5px;
}
#navigation ul li a:hover, #subnavigation ul li a:hover {
@ -247,7 +248,7 @@ p#user_header {
}
#navigation ul li#CurrentSection a, #subnavigation ul li#CurrentSection a {
font-weight:bold;
font-size:19px;
font-size:16px;
margin-top:-6px;
padding-top:11px;
padding-bottom:8px;
@ -255,6 +256,7 @@ p#user_header {
border-left:solid 1px #453619;
border-bottom:solid 1px #000;
background-color:#FFF;
color:#000;
}
#navigation ul li#CurrentSection a:hover {
background-color:#FFF;

View File

@ -179,40 +179,40 @@ class WebCalReport(Report):
"""
def __init__(self, database, options):
Report.__init__(self, database, options)
menu = options.menu
mgobn = menu.get_option_by_name
mgobn = lambda name:options.menu.get_option_by_name(name).get_value()
self.database = database
self.options = options
self.html_dir = mgobn('target').get_value()
self.title_text = mgobn('title').get_value()
filter_option = mgobn('filter')
self.html_dir = mgobn('target')
self.title_text = mgobn('title')
filter_option = options.menu.get_option_by_name('filter')
self.filter = filter_option.get_filter()
self.ext = mgobn('ext').get_value()
self.copy = mgobn('cright').get_value()
self.encoding = mgobn('encoding').get_value()
self.css = mgobn('css').get_value()
self.ext = mgobn('ext')
self.copy = mgobn('cright')
self.encoding = mgobn('encoding')
self.css = mgobn('css')
self.country = mgobn('country').get_value()
self.start_dow = mgobn('start_dow').get_value()
self.country = mgobn('country')
self.start_dow = mgobn('start_dow')
self.multiyear = mgobn('multiyear').get_value()
self.multiyear = mgobn('multiyear')
self.start_year = mgobn('start_year').get_value()
self.end_year = mgobn('end_year').get_value()
self.start_year = mgobn('start_year')
self.end_year = mgobn('end_year')
self.fullyear = mgobn('fullyear').get_value()
self.fullyear = mgobn('fullyear')
self.maiden_name = mgobn('maiden_name').get_value()
self.maiden_name = mgobn('maiden_name')
self.alive = mgobn('alive').get_value()
self.birthday = mgobn('birthdays').get_value()
self.anniv = mgobn('anniversaries').get_value()
self.home_link = mgobn('home_link').get_value()
self.alive = mgobn('alive')
self.birthday = mgobn('birthdays')
self.anniv = mgobn('anniversaries')
self.home_link = mgobn('home_link')
self.month_notes = [mgobn('note_' + month).get_value() \
for month in ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec']]
self.month_notes = [mgobn('note_' + month) \
for month in ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul',
'aug', 'sep', 'oct', 'nov', 'dec']]
# identify researcher name and e-mail address
# as NarrativeWeb already does
@ -1327,7 +1327,7 @@ def _get_regular_surname(sex, name):
Returns a name string built from the components of the Name instance.
"""
surname = name.surname
surname = name.get_surname()
prefix = name.get_surname_prefix()
if prefix:
surname = prefix + " " + surname
@ -1344,6 +1344,7 @@ def _get_short_name(person, maiden_name=None):
primary_name = person.primary_name
sex = person.gender
call_name = None
married_name = None
names = [primary_name] + person.get_alternate_names()
for name in names:
@ -1351,8 +1352,8 @@ def _get_short_name(person, maiden_name=None):
married_name = name
# Now, decide which to use:
if maiden_name is not None:
if married_name is not None:
if maiden_name:
if married_name:
first_name, family_name = married_name.get_first_name(), _get_regular_surname(sex, married_name)
call_name = married_name.get_call_name()
else:
@ -1362,14 +1363,15 @@ def _get_short_name(person, maiden_name=None):
first_name, family_name = primary_name.get_first_name(), _get_regular_surname(sex, primary_name)
call_name = primary_name.get_call_name()
# If they have a nickname use it
if call_name is not None and call_name.strip() is not "":
# If they have a nickname, use it?
if call_name:
first_name = call_name.strip()
else: # else just get the first name:
first_name = first_name.strip()
if " " in first_name:
# just one split max
first_name, rest = first_name.split(" ", 1)
print first_name, family_name
return ("%s %s" % (first_name, family_name)).strip()
# Simple utility list to convert Gramps day-of-week numbering