diff --git a/src/data/templates/gramps-base.html b/src/data/templates/gramps-base.html index 31cd42bba..b9ea903a3 100644 --- a/src/data/templates/gramps-base.html +++ b/src/data/templates/gramps-base.html @@ -238,6 +238,22 @@ function unLite(theOption) { function optClick(theOption) { document.location.href=theOption; } + +function setHasData(classname, value) +{ + var elems = document.getElementsByTagName('*'), i; + for (i in elems) { + if((" " + elems[i].className + " ").indexOf(" " + classname + " ") > -1) { + if (value) { + elems[i].style.fontWeight = "bold"; + elems[i].style.fontStyle = "italic"; + } else { + elems[i].style.fontWeight = ""; + elems[i].style.fontStyle = ""; + } + } + } +} //--> diff --git a/src/data/templates/view_person_detail.html b/src/data/templates/view_person_detail.html index 752238544..66c07d75e 100644 --- a/src/data/templates/view_person_detail.html +++ b/src/data/templates/view_person_detail.html @@ -85,18 +85,18 @@
No such name order = %s
" % order @@ -427,10 +445,14 @@ def surname_table(obj, user, act, url=None, *args): retval += make_button(_("Add Surname"), (url % args)) else: retval += nbsp("") # to keep tabs same height + if has_data: + retval += """ \n""" % cssid return retval def citation_table(obj, user, act, url=None, *args): retval = "" + has_data = False + cssid = "tab-citations" table = Table("citation_table") table.columns("", _("ID"), @@ -453,6 +475,7 @@ def citation_table(obj, user, act, url=None, *args): str(citation.page), ) links.append(('URL', citation_ref.get_url())) + has_data = True count += 1 table.links(links) retval += table.get_html() @@ -468,10 +491,14 @@ def citation_table(obj, user, act, url=None, *args): retval += make_button(_("Add Existing Citation"), (url % args).replace("$act", "share")) else: retval += nbsp("") # to keep tabs same height + if has_data: + retval += """ \n""" % cssid return retval def repository_table(obj, user, act, url=None, *args): retval = "" + has_data = False + cssid = "tab-repositories" table = Table("repository_table") table.columns( _("ID"), @@ -480,15 +507,21 @@ def repository_table(obj, user, act, url=None, *args): if user.is_authenticated(): pass retval += table.get_html() + ## FIXME: missing table + ## has_data = True if user.is_superuser and url and act == "view": retval += make_button(_("Add New Repository"), (url % args).replace("$act", "add")) retval += make_button(_("Add Existing Repository"), (url % args).replace("$act", "share")) else: retval += nbsp("") # to keep tabs same height + if has_data: + retval += """ \n""" % cssid return retval def note_table(obj, user, act, url=None, *args): retval = "" + has_data = False + cssid = "tab-notes" table = Table("note_table") table.columns( _("ID"), @@ -504,31 +537,42 @@ def note_table(obj, user, act, url=None, *args): table.row(table.db.get_note_from_handle(note.handle), str(note_ref.ref_object.note_type), note_ref.ref_object.text[:50]) + has_data = True retval += table.get_html() if user.is_superuser and url and act == "view": retval += make_button(_("Add New Note"), (url % args).replace("$act", "add")) retval += make_button(_("Add Existing Note"), (url % args).replace("$act", "share")) else: retval += nbsp("") # to keep tabs same height + if has_data: + retval += """ \n""" % cssid return retval def data_table(obj, user, act, url=None, *args): retval = "" + has_data = False + cssid = "has_data" table = Table("data_table") table.columns(_("Type"), _("Value"), ) if user.is_authenticated(): pass + ## FIXME: missing table + ## has_data = True retval += table.get_html() if user.is_superuser and url and act == "view": retval += make_button(_("Add Data"), (url % args)) else: retval += nbsp("") # to keep tabs same height + if has_data: + retval += """ \n""" % cssid return retval def attribute_table(obj, user, act, url=None, *args): retval = "" + has_data = False + cssid = "tab-attributes" table = Table("attribute_table") table.columns(_("Type"), _("Value"), @@ -540,15 +584,20 @@ def attribute_table(obj, user, act, url=None, *args): for attribute in attributes: table.row(attribute.attribute_type.name, attribute.value) + has_data = True retval += table.get_html() if user.is_superuser and url and act == "view": retval += make_button(_("Add Attribute"), (url % args)) else: retval += nbsp("") # to keep tabs same height + if has_data: + retval += """ \n""" % cssid return retval def address_table(obj, user, act, url=None, *args): retval = "" + has_data = False + cssid = "tab-addresses" table = Table("address_table") table.columns(_("Date"), _("Address"), @@ -564,15 +613,20 @@ def address_table(obj, user, act, url=None, *args): location.city, location.state, location.country) + has_data = True retval += table.get_html() if user.is_superuser and url and act == "view": retval += make_button(_("Add Address"), (url % args)) else: retval += nbsp("") # to keep tabs same height + if has_data: + retval += """ \n""" % cssid return retval def location_table(obj, user, act, url=None, *args): retval = "" + has_data = False + cssid = "tab-locations" table = Table("location_table") table.columns(_("Date"), _("Address"), @@ -581,15 +635,21 @@ def location_table(obj, user, act, url=None, *args): _("Country")) if user.is_authenticated(): pass # FIXME + ## FIXME: missing table + ## has_data = True retval += table.get_html() if user.is_superuser and url and act == "view": retval += make_button(_("Add Address"), (url % args)) else: retval += nbsp("") # to keep tabs same height + if has_data: + retval += """ \n""" % cssid return retval def media_table(obj, user, act, url=None, *args): retval = "" + has_data = False + cssid = "tab-media" table = Table("media_table") table.columns(_("Description"), _("Type"), @@ -605,16 +665,21 @@ def media_table(obj, user, act, url=None, *args): table.row(table.db.get_object_from_handle(media.handle), str(media_ref.ref_object.desc), media_ref.ref_object.path) + has_data = True retval += table.get_html() if user.is_superuser and url and act == "view": retval += make_button(_("Add New Media"), (url % args).replace("$act", "add")) retval += make_button(_("Add Existing Media"), (url % args).replace("$act", "share")) else: retval += nbsp("") # to keep tabs same height + if has_data: + retval += """ \n""" % cssid return retval def internet_table(obj, user, act, url=None, *args): retval = "" + has_data = False + cssid = "tab-internet" table = Table("internet_table") table.columns(_("Type"), _("Path"), @@ -625,15 +690,20 @@ def internet_table(obj, user, act, url=None, *args): table.row(str(url_obj.url_type), url_obj.path, url_obj.desc) + has_data = True retval += table.get_html() if user.is_superuser and url and act == "view": retval += make_button(_("Add Internet"), (str(url) % args)) else: retval += nbsp("") # to keep tabs same height + if has_data: + retval += """ \n""" % cssid return retval def association_table(obj, user, act, url=None, *args): retval = "" + has_data = False + cssid = "tab-associations" table = Table("association_table") table.columns(_("Name"), _("ID"), @@ -643,16 +713,21 @@ def association_table(obj, user, act, url=None, *args): if gperson: associations = gperson.get_person_ref_list() for association in associations: - table.row() + table.row() # FIXME: missing table + has_data = True retval += table.get_html() if user.is_superuser and url and act == "view": retval += make_button(_("Add Association"), (url % args)) else: retval += nbsp("") # to keep tabs same height + if has_data: + retval += """ \n""" % cssid return retval def lds_table(obj, user, act, url=None, *args): retval = "" + has_data = False + cssid = "tab-lds" table = Table("lds_table") table.columns(_("Type"), _("Date"), @@ -668,15 +743,20 @@ def lds_table(obj, user, act, url=None, *args): str(lds.status), lds.temple, get_title(lds.place)) + has_data = True retval += table.get_html() if user.is_superuser and url and act == "view": retval += make_button(_("Add LDS"), (url % args)) else: retval += nbsp("") # to keep tabs same height + if has_data: + retval += """ \n""" % cssid return retval def reference_table(obj, user, act, url=None, *args): retval = "" + has_data = False + cssid = "tab-references" table = Table("reference_table") table.columns( _("Type"), @@ -686,12 +766,17 @@ def reference_table(obj, user, act, url=None, *args): pass retval += table.get_html() retval += nbsp("") # to keep tabs same height + if has_data: + retval += """ \n""" % cssid return retval def person_reference_table(obj, user, act): retval = """