diff --git a/src/data/templates/view_citation_detail.html b/src/data/templates/view_citation_detail.html index c16effc80..7588eb47a 100644 --- a/src/data/templates/view_citation_detail.html +++ b/src/data/templates/view_citation_detail.html @@ -136,7 +136,7 @@ {% if user.is_superuser %} {% if action == "edit" %} - {% make_button "Back to Citation" "/citation/%s" citation.handle %} + {% make_button "Cancel" "/citation/%s" citation.handle %} {% else %} @@ -145,7 +145,6 @@ {% else %} - {% make_button "Back to Citations" "/citation" %} {% make_button "Add Citation" "/citation/add" %} {% make_button "Edit Citation" "/citation/%s/edit" citation.handle %} {% make_button "Delete Citation" "/citation/%s/delete" citation.handle %} diff --git a/src/data/templates/view_event_detail.html b/src/data/templates/view_event_detail.html index 393b30ee7..a31544117 100644 --- a/src/data/templates/view_event_detail.html +++ b/src/data/templates/view_event_detail.html @@ -70,7 +70,7 @@ {% if user.is_superuser %} {% if action == "edit" %} - {% make_button "Back to Event" "/event/%s" event.handle %} + {% make_button "Cancel" "/event/%s" event.handle %} {% else %} @@ -79,7 +79,6 @@ {% else %} - {% make_button "Back to Events" "/event" %} {% make_button "Add Event" "/event/add" %} {% make_button "Edit Event" "/event/%s/edit" event.handle %} {% make_button "Delete Event" "/event/%s/delete" event.handle %} diff --git a/src/data/templates/view_family_detail.html b/src/data/templates/view_family_detail.html index 1a5cc9dda..d7f0b5d8c 100644 --- a/src/data/templates/view_family_detail.html +++ b/src/data/templates/view_family_detail.html @@ -119,7 +119,7 @@ {% if user.is_superuser %} {% if action == "edit" %} - {% make_button "Back to Family" "/family/%s" family.handle %} + {% make_button "Cancel" "/family/%s" family.handle %} {% else %} @@ -128,7 +128,6 @@ {% else %} - {% make_button "Back to Families" "/family" %} {% make_button "Add Family" "/family/add" %} {% make_button "Edit Family" "/family/%s/edit" family.handle %} {% make_button "Delete Family" "/family/%s/delete" family.handle %} diff --git a/src/data/templates/view_media_detail.html b/src/data/templates/view_media_detail.html index 8031b6df2..c9f8a6ba1 100644 --- a/src/data/templates/view_media_detail.html +++ b/src/data/templates/view_media_detail.html @@ -76,7 +76,7 @@ {% if user.is_superuser %} {% if action == "edit" %} - {% make_button "Back to Media" "/media/%s" media.handle %} + {% make_button "Cancel" "/media/%s" media.handle %} {% else %} @@ -85,7 +85,6 @@ {% else %} - {% make_button "Back to Media" "/media" %} {% make_button "Add Media" "/media/add" %} {% make_button "Edit Media" "/media/%s/edit" media.handle %} {% make_button "Delete Media" "/media/%s/delete" media.handle %} diff --git a/src/data/templates/view_name_detail.html b/src/data/templates/view_name_detail.html index 401f44b7b..c88d5cd30 100644 --- a/src/data/templates/view_name_detail.html +++ b/src/data/templates/view_name_detail.html @@ -95,7 +95,7 @@  
- {% surname_table person user action "/person/%s/name/%s/surname" person.handle nameform.model.order %} + {% surname_table person user action "/person/%s/name/%s/surname/add" person.handle nameform.model.order %}
{% name_table person user action "/person/%s/name" person.handle %} @@ -109,24 +109,27 @@
- {% if user.is_authenticated %} {% ifequal action "add" %} + {% else %} {% ifequal action "edit" %} + {% else %} - + diff --git a/src/data/templates/view_note_detail.html b/src/data/templates/view_note_detail.html index 64e3f1488..d9cd4ab4e 100644 --- a/src/data/templates/view_note_detail.html +++ b/src/data/templates/view_note_detail.html @@ -81,7 +81,7 @@ {% if user.is_superuser %} {% if action == "edit" %} - {% make_button "Back to Note" "/note/%s" note.handle %} + {% make_button "Cancel" "/note/%s" note.handle %} {% else %} @@ -90,7 +90,6 @@ {% else %} - {% make_button "Back to Notes" "/note" %} {% make_button "Add Note" "/note/add" %} {% make_button "Edit Note" "/note/%s/edit" note.handle %} {% make_button "Delete Note" "/note/%s/delete" note.handle %} diff --git a/src/data/templates/view_person_detail.html b/src/data/templates/view_person_detail.html index 40e50ab74..e2a06fac5 100644 --- a/src/data/templates/view_person_detail.html +++ b/src/data/templates/view_person_detail.html @@ -130,7 +130,7 @@ {% if user.is_superuser %} {% if action == "edit" %} - {% make_button "Back to Person" "/person/%s" person.handle %} + {% make_button "Cancel" "/person/%s" person.handle %} {% else %} @@ -139,7 +139,6 @@ {% else %} - {% make_button "Back to People" "/person" %} {% make_button "Add Person" "/person/add" %} {% make_button "Edit Person" "/person/%s/edit" person.handle %} {% make_button "Delete Person" "/person/%s/delete" person.handle %} diff --git a/src/data/templates/view_place_detail.html b/src/data/templates/view_place_detail.html index 63a5260fa..338e81bd9 100644 --- a/src/data/templates/view_place_detail.html +++ b/src/data/templates/view_place_detail.html @@ -75,7 +75,7 @@ {% if user.is_superuser %} {% if action == "edit" %} - {% make_button "Back to Place" "/place/%s" place.handle %} + {% make_button "Cancel" "/place/%s" place.handle %} {% else %} @@ -84,7 +84,6 @@ {% else %} - {% make_button "Back to Places" "/place" %} {% make_button "Add Place" "/place/add" %} {% make_button "Edit Place" "/place/%s/edit" place.handle %} {% make_button "Delete Place" "/place/%s/delete" place.handle %} diff --git a/src/data/templates/view_repository_detail.html b/src/data/templates/view_repository_detail.html index 7d62ec385..cf39e9e2f 100644 --- a/src/data/templates/view_repository_detail.html +++ b/src/data/templates/view_repository_detail.html @@ -63,7 +63,7 @@ {% if user.is_superuser %} {% if action == "edit" %} - {% make_button "Back to Repository" "/repository/%s" repository.handle %} + {% make_button "Cancel" "/repository/%s" repository.handle %} {% else %} @@ -72,7 +72,6 @@ {% else %} - {% make_button "Back to Repositories" "/repository" %} {% make_button "Add Repository" "/repository/add" %} {% make_button "Edit Repository" "/repository/%s/edit" repository.handle %} {% make_button "Delete Repository" "/repository/%s/delete" repository.handle %} diff --git a/src/data/templates/view_source_detail.html b/src/data/templates/view_source_detail.html index 6a3ef242d..ba014ece9 100644 --- a/src/data/templates/view_source_detail.html +++ b/src/data/templates/view_source_detail.html @@ -71,7 +71,7 @@ {% if user.is_superuser %} {% if action == "edit" %} - {% make_button "Back to Source" "/source/%s" source.handle %} + {% make_button "Cancel" "/source/%s" source.handle %} {% else %} @@ -80,7 +80,6 @@ {% else %} - {% make_button "Back to Sources" "/source" %} {% make_button "Add Source" "/source/add" %} {% make_button "Edit Source" "/source/%s/edit" source.handle %} {% make_button "Delete Source" "/source/%s/delete" source.handle %} diff --git a/src/data/templates/view_surname_detail.html b/src/data/templates/view_surname_detail.html index f407191a1..496370d9a 100644 --- a/src/data/templates/view_surname_detail.html +++ b/src/data/templates/view_surname_detail.html @@ -76,12 +76,9 @@ {% else %} - - + @@ -90,13 +87,6 @@ onclick="document.location.href='/person/{{person.handle}}/name/{{order}}/surname/{{sorder}}/delete'"/> {% endif %} {% endif %} -{% else %} - - {% endif %} {% endblock %} diff --git a/src/data/templates/view_tag_detail.html b/src/data/templates/view_tag_detail.html index 6f5b29080..95dbdcfbd 100644 --- a/src/data/templates/view_tag_detail.html +++ b/src/data/templates/view_tag_detail.html @@ -50,7 +50,7 @@ {% if user.is_superuser %} {% if action == "edit" %} - {% make_button "Back to Tag" "/tag/%s" tag.handle %} + {% make_button "Cancel" "/tag/%s" tag.handle %} {% else %} @@ -59,7 +59,6 @@ {% else %} - {% make_button "Back to Tags" "/tag" %} {% make_button "Add Tag" "/tag/add" %} {% make_button "Edit Tag" "/tag/%s/edit" tag.handle %} {% make_button "Delete Tag" "/tag/%s/delete" tag.handle %} diff --git a/src/webapp/utils.py b/src/webapp/utils.py index c1e5b6765..ba072366b 100644 --- a/src/webapp/utils.py +++ b/src/webapp/utils.py @@ -198,7 +198,6 @@ class Table(object): # None is paperstyle, which is ignored: self.doc = Doc(HtmlDoc.HtmlDoc(make_basic_stylesheet(Table={"set_width":95}), None)) self.doc.doc._backend = HtmlBackend() - self.doc.doc._backend.ADDITIONAL_LINK_TAGS = "class='browsecell'" # You can set elements id, class, etc: self.doc.doc.htmllist += [Html('div', class_="content", id="Gallery", style="overflow: auto; height:150px; background-color: #261803;")] @@ -254,8 +253,8 @@ def event_table(obj, user, action, url, args): str(event_ref.role_type)) retval += table.get_html() if user.is_superuser and action == "view": - retval += make_button(_("Add event"), (url % args).replace("$act", "add")) - retval += make_button(_("Share event"), (url % args).replace("$act", "share")) + retval += make_button(_("Add Event"), (url % args).replace("$act", "add")) + retval += make_button(_("Share Event"), (url % args).replace("$act", "share")) else: retval += nbsp("") # to keep tabs same height return retval @@ -293,7 +292,7 @@ def name_table(obj, user, action, url=None, *args): table.links(links) retval += table.get_html() if user.is_superuser and url and action == "view": - retval += make_button(_("Add name"), (url % args)) + retval += make_button(_("Add Name"), (url % args)) else: retval += nbsp("") # to keep tabs same height return retval @@ -321,7 +320,7 @@ def surname_table(obj, user, action, url=None, *args): else: retval += "

No such name order = %s

" % order if user.is_superuser and url and action == "view": - retval += make_button(_("Add surname"), (url % args)) + retval += make_button(_("Add Surname"), (url % args)) else: retval += nbsp("") # to keep tabs same height return retval @@ -348,8 +347,8 @@ def source_table(obj, user, action, url=None, *args): ) retval += table.get_html() if user.is_superuser and url and action == "view": - retval += make_button(_("Add source"), (url % args).replace("$act", "add")) - retval += make_button(_("Share source"), (url % args).replace("$act", "share")) + retval += make_button(_("Add Source"), (url % args).replace("$act", "add")) + retval += make_button(_("Share Source"), (url % args).replace("$act", "share")) else: retval += nbsp("") # to keep tabs same height return retval @@ -374,8 +373,8 @@ def citation_table(obj, user, action, url=None, *args): ) retval += table.get_html() if user.is_superuser and url and action == "view": - retval += make_button(_("Add citation"), (url % args).replace("$act", "add")) - retval += make_button(_("Share citation"), (url % args).replace("$act", "share")) + retval += make_button(_("Add Citation"), (url % args).replace("$act", "add")) + retval += make_button(_("Share Citation"), (url % args).replace("$act", "share")) else: retval += nbsp("") # to keep tabs same height return retval @@ -399,8 +398,8 @@ def note_table(obj, user, action, url=None, *args): note_ref.ref_object.text[:50]) retval += table.get_html() if user.is_superuser and url and action == "view": - retval += make_button(_("Add note"), (url % args).replace("$act", "add")) - retval += make_button(_("Share note"), (url % args).replace("$act", "share")) + retval += make_button(_("Add Note"), (url % args).replace("$act", "add")) + retval += make_button(_("Share Note"), (url % args).replace("$act", "share")) else: retval += nbsp("") # to keep tabs same height return retval @@ -420,7 +419,7 @@ def attribute_table(obj, user, action, url=None, *args): attribute.value) retval += table.get_html() if user.is_superuser and url and action == "view": - retval += make_button(_("Add attribute"), (url % args)) + retval += make_button(_("Add Attribute"), (url % args)) else: retval += nbsp("") # to keep tabs same height return retval @@ -444,7 +443,7 @@ def address_table(obj, user, action, url=None, *args): location.country) retval += table.get_html() if user.is_superuser and url and action == "view": - retval += make_button(_("Add address"), (url % args)) + retval += make_button(_("Add Address"), (url % args)) else: retval += nbsp("") # to keep tabs same height return retval @@ -467,8 +466,8 @@ def gallery_table(obj, user, action, url=None, *args): media_ref.ref_object.path) retval += table.get_html() if user.is_superuser and url and action == "view": - retval += make_button(_("Add media"), (url % args).replace("$act", "add")) - retval += make_button(_("Share media"), (url % args).replace("$act", "share")) + retval += make_button(_("Add Media"), (url % args).replace("$act", "add")) + retval += make_button(_("Share Media"), (url % args).replace("$act", "share")) else: retval += nbsp("") # to keep tabs same height return retval @@ -487,7 +486,7 @@ def internet_table(obj, user, action, url=None, *args): url_obj.desc) retval += table.get_html() if user.is_superuser and url and action == "view": - retval += make_button(_("Add internet"), (str(url) % args)) + retval += make_button(_("Add Internet"), (str(url) % args)) else: retval += nbsp("") # to keep tabs same height return retval @@ -506,7 +505,7 @@ def association_table(obj, user, action, url=None, *args): table.row() retval += table.get_html() if user.is_superuser and url and action == "view": - retval += make_button(_("Add association"), (url % args)) + retval += make_button(_("Add Association"), (url % args)) else: retval += nbsp("") # to keep tabs same height return retval @@ -729,7 +728,7 @@ def children_table(obj, user, action, url=None, *args): table.links(links) retval += table.get_html() if user.is_superuser and url and action == "view": - retval += make_button(_("Add child"), (url % args)) + retval += make_button(_("Add Child"), (url % args)) else: retval += nbsp("") # to keep tabs same height return retval @@ -907,6 +906,7 @@ class WebAppBackend(HtmlBackend): DocBackend.FONTFACE, DocBackend.FONTSIZE, DocBackend.FONTCOLOR, + DocBackend.HIGHLIGHT, DocBackend.SUPERSCRIPT, DocBackend.LINK, ] @@ -961,7 +961,7 @@ class WebAppParser(HTMLParser): FONTFACE = 3 FONTSIZE = 4 FONTCOLOR = 5 - HIGHLIGHT = 6 + HIGHLIGHT = 6 # background color SUPERSCRIPT = 7 LINK = 8 @@ -1015,6 +1015,13 @@ class WebAppParser(HTMLParser): arg = match.groups()[0] else: print "Unhandled color tag: '%s'" % style + elif 'background-color' in style: + tagtype = self.HIGHLIGHT + match = re.match("background-color:([^;]*);", style) + if match: + arg = match.groups()[0] + else: + print "Unhandled background-color tag: '%s'" % style elif "font-family" in style: tagtype = self.FONTFACE match = re.match("font-family:'([^;]*)';", style)