fixed issues regarding to the other style sheet's navigation menu.

svn: r18996
This commit is contained in:
Rob G. Healey 2012-03-02 23:42:20 +00:00
parent 0427db85d6
commit 26bbb654d0

View File

@ -1602,22 +1602,23 @@ class BasePage(object):
header_note = self.report.options['headernote'] header_note = self.report.options['headernote']
if header_note: if header_note:
note = self.get_note_format( note = self.get_note_format(
self.report.database.get_note_from_gramps_id(header_note), self.report.database.get_note_from_gramps_id(header_note), False)
False
)
user_header = Html("div", id = 'user_header') user_header = Html("div", id = 'user_header')
headerdiv += user_header headerdiv += user_header
# attach note # attach note
user_header += note user_header += note
# Begin Navigation Menu # Begin Navigation Menu--
if self.report.navigation == "DropDown": # is the style sheet either Blue or Visually, and menu layout is Drop Down?
body += self.display_drop_menu() if (self.report.css == "Blue" or self.report.css == "Visually"):
if self.report.navigation == "dropdown":
body += self.display_drop_menu()
else: else:
body += self.display_nav_links(title) body += self.display_nav_links(title)
# return page, head, and body # return page, head, and body to its classes...
return page, head, body return page, head, body
def display_nav_links(self, currentsection): def display_nav_links(self, currentsection):
@ -1655,7 +1656,8 @@ class BasePage(object):
('thumbnails', _("Thumbnails"), True), ('thumbnails', _("Thumbnails"), True),
('download', _("Download"), self.report.inc_download), ('download', _("Download"), self.report.inc_download),
("addressbook", _("Address Book"), self.report.inc_addressbook), ("addressbook", _("Address Book"), self.report.inc_addressbook),
('contact', _("Contact"), self.report.use_contact)] ('contact', _("Contact"), self.report.use_contact)
]
# Remove menu sections if they are not being created? # Remove menu sections if they are not being created?
navs = ((url_text, nav_text) for url_text, nav_text, cond in navs if cond) navs = ((url_text, nav_text) for url_text, nav_text, cond in navs if cond)
@ -1663,14 +1665,15 @@ class BasePage(object):
number_items = len(menu_items) number_items = len(menu_items)
num_cols = 10 num_cols = 10
num_rows = (number_items // num_cols) + 1 num_rows = ((number_items // num_cols) + 1)
# begin navigation menu division... # begin navigation menu division...
with Html("div", class_ = "wrapper", id = "nav", role = "navigation") as navigation: with Html("div", class_ = "wrapper", id = "nav", role = "navigation") as navigation:
with Html("div", class_ = "container") as container: with Html("div", class_ = "container") as container:
index = 0 index = 0
for rows in range(num_rows): for rows in range(num_rows):
unordered = Html("ul", class_ = "menu", id = "dropmenu") unordered = Html("ul", class_ = "menu")
cols = 0 cols = 0
while (cols <= num_cols and index < number_items): while (cols <= num_cols and index < number_items):
@ -4516,19 +4519,20 @@ class SourcePage(BasePage):
if citation_referents_list: if citation_referents_list:
# Drop Down is being used, add Style sheet and javascript file... # Drop Down is being used, add Style sheet and javascript file...
if self.navigation == "DropDown": if (report.css == "Blue" or report.css == "Visually"):
if self.navigation == "dropdown":
# link- in Animated Drop Down style sheet # link- in Animated Drop Down style sheet
fname = "/".join(["css", "narrative-dropdown.css"]) fname = "/".join(["css", "narrative-dropdown.css"])
url = self.report.build_url_fname(fname, None, self.up) url = self.report.build_url_fname(fname, None, self.up)
head += Html("link", type = "text/css", href = url, media = "screen", head += Html("link", type = "text/css", href = url, media = "screen",
rel = "stylesheet", inline = True) rel = "stylesheet", inline = True)
# javascript if the user's browser is IE6? # javascript if the user's browser is IE6?
fname = "/".join(["scripts", "jquery-1.7.1.min.js"]) fname = "/".join(["scripts", "jquery-1.7.1.min.js"])
url = self.report.build_url_fname(fname, None, self.up) url = self.report.build_url_fname(fname, None, self.up)
head += Html("script", type = "text/javascript", href = url, head += Html("script", type = "text/javascript", href = url,
language ="javascript", inline = True) language ="javascript", inline = True)
with Html("script", type = "text/javascript", language = "javascript") as jsc: with Html("script", type = "text/javascript", language = "javascript") as jsc:
head += jsc head += jsc
@ -4769,7 +4773,11 @@ class SourcePage(BasePage):
def display_citation_refs_list(self, unordered2, citations_dict, citation_type): def display_citation_refs_list(self, unordered2, citations_dict, citation_type):
""" """
displays the citations referents list displays the citations referents list for People and Event subsections
@param: unordered2 -- unordered list element for proper styling of section output
@param: citations_dict -- dictionary containing data to be displayed
@param: citation_type -- can either be People or Events...
""" """
keys = sorted(citations_dict, key = locale.strxfrm) keys = sorted(citations_dict, key = locale.strxfrm)
max_per_column = 5 max_per_column = 5
@ -4807,8 +4815,9 @@ class SourcePage(BasePage):
list5 = Html("li") list5 = Html("li")
list5.extend( list5.extend(
self.get_citation_ref_link(obj_handle, citation_type) self.citation_referents_link(obj_handle, citation_type)
) )
unordered5 += list5 unordered5 += list5
list4 += unordered5 list4 += unordered5
unordered4 += list4 unordered4 += list4
@ -4821,20 +4830,22 @@ class SourcePage(BasePage):
list4 = Html("li") list4 = Html("li")
list4.extend( list4.extend(
self.get_citation_ref_link(obj_handle, citation_type) self.citation_referents_link(obj_handle, citation_type)
) )
unordered4 += list4 unordered4 += list4
list3 += unordered4 list3 += unordered4
unordered3 += list3 unordered3 += list3
list2 += unordered3 list2 += unordered3
unordered2 += list2 unordered2 += list2
def get_citation_ref_link(self, obj_handle, citation_type): def citation_referents_link(self, obj_handle, citation_type):
""" """
returns the hyper link for the handle that was passed to it returns the hyper link for the handle that was passed to it
"""
hyper = None
@param: obj_handle -- object handle for either Person or Event
@param: citation_type -- can be either People or Events
"""
if citation_type == "People": if citation_type == "People":
obj_ = self.dbase_.get_person_from_handle(obj_handle) obj_ = self.dbase_.get_person_from_handle(obj_handle)
url = self.report.build_url_fname_html(obj_handle, "ppl", up = self.up) url = self.report.build_url_fname_html(obj_handle, "ppl", up = self.up)
@ -7134,8 +7145,8 @@ class NavWebReport(Report):
fname = CSS["Vertical-Menus"]["filename"] fname = CSS["Vertical-Menus"]["filename"]
elif self.navigation == "Fade": elif self.navigation == "Fade":
fname = CSS["Fade-Menus"]["filename"] fname = CSS["Fade-Menus"]["filename"]
elif self.navigation == "DropDown": elif self.navigation == "dropdown":
fname = CSS["DropDown-Menus"]["filename"] fname = CSS["dropdown-Menus"]["filename"]
self.copy_file(fname, "narrative-menus.css", "css") self.copy_file(fname, "narrative-menus.css", "css")
# copy narrative-maps Style Sheet if Place or Family Map pages are being created? # copy narrative-maps Style Sheet if Place or Family Map pages are being created?
@ -7144,12 +7155,13 @@ class NavWebReport(Report):
self.copy_file(fname, "narrative-maps.css", "css") self.copy_file(fname, "narrative-maps.css", "css")
# if Drop Down Navigation is being used, copy its style sheet and its javascript file... # if Drop Down Navigation is being used, copy its style sheet and its javascript file...
if self.navigation == "DropDown": if (self.css == "Blue" or self.css == "Visually"):
fname = CSS["Animated Dropdown"]["filename"] if self.navigation == "dropdown":
self.copy_file(fname, "narrative-dropdown.css", "css") fname = CSS["Animated Dropdown"]["filename"]
self.copy_file(fname, "narrative-dropdown.css", "css")
fname = CSS["Animated Dropdown"]["javascript"] fname = CSS["Animated Dropdown"]["javascript"]
self.copy_file(fname, "jquery-1.7.1.min.js", "scripts") self.copy_file(fname, "jquery-1.7.1.min.js", "scripts")
# Copy the Creative Commons icon if the Creative Commons # Copy the Creative Commons icon if the Creative Commons
# license is requested # license is requested
@ -7796,7 +7808,7 @@ class NavWebOptions(MenuReportOptions):
(_("Horizontal -- Default"), "Horizontal"), (_("Horizontal -- Default"), "Horizontal"),
(_("Vertical -- Left Side"), "Vertical"), (_("Vertical -- Left Side"), "Vertical"),
(_("Fade -- WebKit Browsers Only"), "Fade"), (_("Fade -- WebKit Browsers Only"), "Fade"),
(_("Drop-Down -- WebKit Browsers Only"), "DropDown") (_("Drop-Down -- WebKit Browsers Only"), "dropdown")
] ]
self.__navigation = EnumeratedListOption(_("Navigation Menu Layout"), _nav_opts[0][1]) self.__navigation = EnumeratedListOption(_("Navigation Menu Layout"), _nav_opts[0][1])
for layout in _nav_opts: for layout in _nav_opts: