diff --git a/src/data/templates/gramps-base.html b/src/data/templates/gramps-base.html index a9db18a46..07711ab19 100644 --- a/src/data/templates/gramps-base.html +++ b/src/data/templates/gramps-base.html @@ -34,7 +34,11 @@
  • {{view.0}}
  • {% endfor %} {% if user.is_authenticated %} + {% if next %} +
  • Logout
  • + {% else %}
  • Logout
  • + {% endif %} {% if user.is_superuser %}
  • Admin
  • {% endif %} diff --git a/src/data/templates/view_events.html b/src/data/templates/view_events.html index fa8eb82a7..3da9a9936 100644 --- a/src/data/templates/view_events.html +++ b/src/data/templates/view_events.html @@ -20,17 +20,21 @@ {{ forloop.counter|row_count:page }} [{{event.gramps_id}}] + {% if user.is_authenticated %} - {{event.event_type|escape}} + + {{event.event_type|nbsp}} {{event.description|nbsp}} - {{event|display_date|nbsp}} + {{event|render_date:user}} {{event.place.title|nbsp}} + {% else %} - - - - + [Private] + [Private] + [Private] + [Private] {% endif %} + {% endfor %} diff --git a/src/data/templates/view_family_detail.html b/src/data/templates/view_family_detail.html index 1752d8f2c..853df8df2 100644 --- a/src/data/templates/view_family_detail.html +++ b/src/data/templates/view_family_detail.html @@ -23,16 +23,16 @@ Name: - {{family.father|make_name:user}} [{{family.father.gramps_id|escape}}] + {{family.father|render_name:user}} [{{family.father.gramps_id}}] Name: - {{family.mother|make_name:user}} [{{family.mother.gramps_id|escape}}] + {{family.mother|render_name:user}} [{{family.mother.gramps_id}}] -{% if user.is_authenticated or not family.father.handle|probably_alive %} +{% if user.is_authenticated or not family.father.probably_alive %} Birth: - {{family.father|person_get_birth_date}} + {{family.father.birth|render_date:user}} Birth: - {{family.mother|person_get_birth_date}} + {{family.mother.birth|render_date:user}} {% else %} @@ -44,24 +44,28 @@ {% endif %} Death: - {{family.father|person_get_death_date}} + {{family.father.death|render_date:user}} Death: - {{family.mother|person_get_death_date}} + {{family.mother.death|render_date:user}} - {% comment %} 6 cols {% endcomment %} +
    - + - + + + - + + +
    Relationship informationRelationship information
    ID:{{family.gramps_id|escape}}{{family.gramps_id}} Type: RELTYPE
    Marker:{{family.marker_type|escape}}{{family.marker_type}}Private:{{family.private}}
    diff --git a/src/data/templates/view_people.html b/src/data/templates/view_people.html index 1e3b174d9..acac5234d 100644 --- a/src/data/templates/view_people.html +++ b/src/data/templates/view_people.html @@ -34,7 +34,7 @@ {% if user.is_authenticated %} -{% make_button "Add a new Person" "/person/add" %} +{% make_button "Add Person" "/person/add" %} {% endif %} diff --git a/src/data/templates/view_person_detail.html b/src/data/templates/view_person_detail.html index 93a3c9777..cea34333d 100644 --- a/src/data/templates/view_person_detail.html +++ b/src/data/templates/view_person_detail.html @@ -33,7 +33,7 @@ {% render nameform.surname user action %} {{nameform.prefix.label}} {% render nameform.prefix user action %} - Image: + Image: @@ -68,7 +68,6 @@ {% render personform.marker_type user action %} {{personform.private.label}} {% render personform.private user action %} - diff --git a/src/web/grampsdb/views.py b/src/web/grampsdb/views.py index 2721318cf..670d0ab9a 100644 --- a/src/web/grampsdb/views.py +++ b/src/web/grampsdb/views.py @@ -97,6 +97,9 @@ def logout_page(request): context["view"] = 'home' context["tview"] = _('Home') logout(request) + # TODO: allow this once we have an error page + #if request.GET.has_key("next"): + # return redirect(request.GET.get("next"), context) return HttpResponseRedirect('/') def user_page(request, username): @@ -626,7 +629,7 @@ def view(request, view): context["search"] = search context["total"] = total context["object_list"] = object_list - context["next"] = "/person/" + context["next"] = "/%s/" % view if search: context["search_query"] = ("&search=%s" % search) else: diff --git a/src/web/utils.py b/src/web/utils.py index d4f8401a5..94a43bafe 100644 --- a/src/web/utils.py +++ b/src/web/utils.py @@ -449,11 +449,40 @@ def children_table(obj, user, action, url=None, *args): _("Maternal"), _("Birth Date"), ) - #if user.is_authenticated(): - #for djfamily: - # table.row("test") + + family = obj + obj_type = ContentType.objects.get_for_model(family) + childrefs = dji.ChildRef.filter(object_id=family.id, + object_type=obj_type).order_by("order") + links = [] + count = 1 + for childref in childrefs: + child = childref.ref_object + if user.is_authenticated(): + table.row(str(count), + "[%s]" % child.gramps_id, + render_name(child, user), + child.gender_type, + childref.father_rel_type, + childref.mother_rel_type, + render_date(child.birth, user), + ) + links.append(('URL', ("/person/%s" % child.handle))) + else: + table.row(str(count), + "[%s]" % child.gramps_id, + render_name(child, user), + child.gender_type, + "[Private]", + "[Private]", + "[Private]", + ) + links.append(('URL', ("/person/%s" % child.handle))) + count += 1 + table.links(links) + retval += table.get_html() retval += nbsp("") # to keep tabs same height - return table.get_html() + return retval ## FIXME: these dji function wrappers just use the functions ## written for the import/export. Can be done much more directly.