From 07942011c103ad27f6bfaec839431b374b7b5c03 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sun, 22 Jul 2012 17:30:44 +0000 Subject: [PATCH] Adjust links on each child row; fix typo on surname detail page svn: r20053 --- src/data/templates/view_surname_detail.html | 16 +++------------- src/webapp/utils.py | 13 ++++++++----- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/data/templates/view_surname_detail.html b/src/data/templates/view_surname_detail.html index 170c1cf41..35a0be701 100644 --- a/src/data/templates/view_surname_detail.html +++ b/src/data/templates/view_surname_detail.html @@ -19,7 +19,8 @@ {% format "/browse|Browse" %} || {% format "/person|People" %} || {% format "/person/%s|Person [%s]" object.handle object.gramps_id %} || - {% format "/person/%s/name/%s|Name #%s" object.handle order order %} + {% format "/person/%s/name/%s|Name #%s" object.handle order order %} || + {% format "/person/%s/name/%s/surname/%s|Surname #%s" object.handle order sorder sorder %} {% endfilter %}

{{person|make_name:user}} [{{person.gramps_id}}]

@@ -55,17 +56,6 @@ - - -
- - -
- {% if user.is_superuser %} {% if action == "edit" %} {% make_button "Cancel" "/person/%s/name/%s/surname/%s" person.handle order sorder args %} @@ -83,7 +73,7 @@ {% else %} {% make_button "Add Surname" "/person/%s/name/%s/surname/add" person.handle order args %} {% make_button "Edit Surname" "/person/%s/name/%s/surname/%s/edit" person.handle order sorder args %} - {% make_button "Add Surname" "/person/%s/name/%s/surname/%s/delete" person.handle order sorder args %} + {% make_button "Delete Surname" "/person/%s/name/%s/surname/%s/delete" person.handle order sorder args %} {% endif %} {% endif %} {% endif %} diff --git a/src/webapp/utils.py b/src/webapp/utils.py index b5eb10eaa..cf6ff76cd 100644 --- a/src/webapp/utils.py +++ b/src/webapp/utils.py @@ -848,7 +848,7 @@ def children_table(obj, user, act, url=None, *args): _("Maternal"), _("Birth Date"), ) - #table.column_widths = [3] + [98/6] * 6 + table.column_widths = [10, 3, 8, 30, 8, 8, 8, 25] family = obj obj_type = ContentType.objects.get_for_model(family) @@ -859,7 +859,7 @@ def children_table(obj, user, act, url=None, *args): for childref in childrefs: child = childref.ref_object if user.is_authenticated(): - table.row(Link("[[x]][[^]][[v]]"), + table.row(Link("[[x%d]][[^%d]][[v%d]]" % (count, count, count)), str(count), "[%s]" % child.gramps_id, render_name(child, user), @@ -886,9 +886,12 @@ def children_table(obj, user, act, url=None, *args): count += 1 table.links(links) retval += table.get_html() - retval = retval.replace("[[x]]", make_button("x", "/person/remove/family/%s" % family.handle)) - retval = retval.replace("[[^]]", make_button("^", "/person/up/family/%s" % family.handle)) - retval = retval.replace("[[v]]", make_button("v", "/person/down/family/%s" % family.handle)) + count = 1 + for childref in childrefs: + retval = retval.replace("[[x%d]]" % count, make_button("x", "/family/%s/remove/child/%d" % (family.handle, count))) + retval = retval.replace("[[^%d]]" % count, make_button("^", "/family/%s/up/child/%d" % (family.handle, count))) + retval = retval.replace("[[v%d]]" % count, make_button("v", "/family/%s/down/child/%d" % (family.handle, count))) + count += 1 if user.is_superuser and url and act == "view": retval += make_button(_("Add New Person as Child"), (url.replace("$act", "add") % args)) retval += make_button(_("Add Existing Person as Child"), (url.replace("$act", "share") % args))