{% for family in page.object_list %}
- {{ forloop.counter|row_count:page }} |
+ {{ forloop.counter|row_count:page }} |
[{{family.gramps_id}}]
- | {{family.father.name_set|make_name:user}}
- | {{family.mother.name_set|make_name:user}}
+ | {{family.father.name_set|make_name:user}}
+ | {{family.mother.name_set|make_name:user}}
{% if user.is_authenticated %}
| {{family.family_rel_type|escape}}
{% else %}
diff --git a/src/data/templates/view_family_detail.html b/src/data/templates/view_family_detail.html
index cc48b16ad..a727f011d 100644
--- a/src/data/templates/view_family_detail.html
+++ b/src/data/templates/view_family_detail.html
@@ -27,12 +27,21 @@
| Name: |
{{family.mother.name_set|make_name:user}} [{{family.mother.gramps_id|escape}}] |
+{% if user.is_authenticated or not family.father.handle|probably_alive %}
Birth: |
{{family.father|person_get_birth_date}} |
Birth: |
{{family.mother|person_get_birth_date}} |
+{% else %}
+
+ Birth: |
+ [Private] |
+ Birth: |
+ [Private] |
+
+{% endif %}
Death: |
{{family.father|person_get_death_date}} |
diff --git a/src/data/templates/view_page.html b/src/data/templates/view_page.html
index cbb6beebf..818105c86 100644
--- a/src/data/templates/view_page.html
+++ b/src/data/templates/view_page.html
@@ -1,8 +1,8 @@
{% extends "gramps-base.html" %}
{% load my_tags %}
-{% block title %}Gramps-Connect - {{cview}} view {% endblock %}
-{% block heading %}Gramps Connect - {{cview}} view {% endblock %}
+{% block title %}Gramps-Connect: {{cview}} view {% endblock %}
+{% block heading %}Gramps Connect: {{cview}} view {% endblock %}
{% block content %}
diff --git a/src/data/templates/view_page_detail.html b/src/data/templates/view_page_detail.html
index d4e0518a6..8ba5442cf 100644
--- a/src/data/templates/view_page_detail.html
+++ b/src/data/templates/view_page_detail.html
@@ -1,8 +1,8 @@
{% extends "gramps-base.html" %}
{% load my_tags %}
-{% block title %}Gramps-Connect - {{cview}} detail {% endblock %}
-{% block heading %}Gramps-Connect - {{cview}} detail {% endblock %}
+{% block title %}Gramps-Connect: {{cview}} detail {% endblock %}
+{% block heading %}Gramps-Connect: {{cview}} detail {% endblock %}
{% block content %}
diff --git a/src/data/templates/view_people.html b/src/data/templates/view_people.html
index 69533fc5b..a50cf587f 100644
--- a/src/data/templates/view_people.html
+++ b/src/data/templates/view_people.html
@@ -3,10 +3,10 @@
{% block table_data %}
-
+
+
+{% endif %}
+
+
diff --git a/src/web/grampsdb/templatetags/my_tags.py b/src/web/grampsdb/templatetags/my_tags.py
index d63951436..734d20f2f 100644
--- a/src/web/grampsdb/templatetags/my_tags.py
+++ b/src/web/grampsdb/templatetags/my_tags.py
@@ -14,6 +14,9 @@ for filter_name in util_filters:
func.is_safe = True
register.filter(filter_name, func)
+probably_alive.is_safe = True
+register.filter('probably_alive', probably_alive)
+
person_get_birth_date.is_safe = True
register.filter('person_get_birth_date', person_get_birth_date)
diff --git a/src/web/urls.py b/src/web/urls.py
index 05f6caa6b..76dc4207d 100644
--- a/src/web/urls.py
+++ b/src/web/urls.py
@@ -33,5 +33,27 @@ urlpatterns += patterns('',
(r'^login/$', 'django.contrib.auth.views.login'),
(r'^logout/$', logout_page),
(r'^(?P(\w+))/$', view),
+ url(r'^person/(?P(\w+))/$', view_detail,
+ {"view": "person"}, name="view-person-detail"),
(r'^(?P(\w+))/(?P(\w+))/$', view_detail),
)
+
+# In urls:
+# urlpatterns = patterns('',
+# url(r'^archive/(\d{4})/$', archive, name="full-archive"),
+# url(r'^archive-summary/(\d{4})/$', archive, {'summary': True}, "arch-summary"),
+# )
+
+# In template:
+# {% url arch-summary 1945 %}
+# {% url full-archive 2007 %}
+#{% url path.to.view as the_url %}
+#{% if the_url %}
+# Link to optional stuff
+#{% endif %}
+
+# In code:
+#from django.core.urlresolvers import reverse
+#
+#def myview(request):
+# return HttpResponseRedirect(reverse('arch-summary', args=[1945]))
diff --git a/src/web/utils.py b/src/web/utils.py
index d7e188859..b10628e96 100644
--- a/src/web/utils.py
+++ b/src/web/utils.py
@@ -69,19 +69,20 @@ def person_event_table(djperson, user):
_("Date"),
_("Place"),
_("Role"))
- obj_type = ContentType.objects.get_for_model(djperson)
- event_ref_list = models.EventRef.objects.filter(
- object_id=djperson.id,
- object_type=obj_type).order_by("order")
- event_list = [(obj.ref_object, obj) for obj in event_ref_list]
- for (djevent, event_ref) in event_list:
- table.row(
- djevent.description,
- table.db.get_event_from_handle(djevent.handle),
- djevent.gramps_id,
- display_date(djevent),
- get_title(djevent.place),
- str(event_ref.role_type))
+ if user.is_authenticated():
+ obj_type = ContentType.objects.get_for_model(djperson)
+ event_ref_list = models.EventRef.objects.filter(
+ object_id=djperson.id,
+ object_type=obj_type).order_by("order")
+ event_list = [(obj.ref_object, obj) for obj in event_ref_list]
+ for (djevent, event_ref) in event_list:
+ table.row(
+ djevent.description,
+ table.db.get_event_from_handle(djevent.handle),
+ djevent.gramps_id,
+ display_date(djevent),
+ get_title(djevent.place),
+ str(event_ref.role_type))
return table.get_html()
def person_name_table(djperson, user):
@@ -91,20 +92,21 @@ def person_name_table(djperson, user):
_("Group As"),
_("Source"),
_("Note Preview"))
- for name in djperson.name_set.all():
- obj_type = ContentType.objects.get_for_model(name)
- sourceq = dji.SourceRef.filter(object_type=obj_type,
- object_id=name.id).count() > 0
- note_refs = dji.NoteRef.filter(object_type=obj_type,
- object_id=name.id)
- note = ""
- if note_refs.count() > 0:
- note = dji.Note.get(id=note_refs[0].object_id).text[:50]
- table.row(make_name(name, user),
- str(name.name_type),
- name.group_as,
- ["No", "Yes"][sourceq],
- note)
+ if user.is_authenticated():
+ for name in djperson.name_set.all():
+ obj_type = ContentType.objects.get_for_model(name)
+ sourceq = dji.SourceRef.filter(object_type=obj_type,
+ object_id=name.id).count() > 0
+ note_refs = dji.NoteRef.filter(object_type=obj_type,
+ object_id=name.id)
+ note = ""
+ if note_refs.count() > 0:
+ note = dji.Note.get(id=note_refs[0].object_id).text[:50]
+ table.row(make_name(name, user),
+ str(name.name_type),
+ name.group_as,
+ ["No", "Yes"][sourceq],
+ note)
return table.get_html()
def person_source_table(djperson, user):
@@ -113,16 +115,17 @@ def person_source_table(djperson, user):
_("Title"),
_("Author"),
_("Page"))
- obj_type = ContentType.objects.get_for_model(djperson)
- source_refs = dji.SourceRef.filter(object_type=obj_type,
- object_id=djperson.id)
- for source_ref in source_refs:
- source = table.db.get_source_from_handle(source_ref.ref_object.handle)
- table.row(source,
- source_ref.ref_object.title,
- source_ref.ref_object.author,
- source_ref.page,
- )
+ if user.is_authenticated():
+ obj_type = ContentType.objects.get_for_model(djperson)
+ source_refs = dji.SourceRef.filter(object_type=obj_type,
+ object_id=djperson.id)
+ for source_ref in source_refs:
+ source = table.db.get_source_from_handle(source_ref.ref_object.handle)
+ table.row(source,
+ source_ref.ref_object.title,
+ source_ref.ref_object.author,
+ source_ref.page,
+ )
return table.get_html()
def person_attribute_table(djperson, user):
@@ -130,12 +133,13 @@ def person_attribute_table(djperson, user):
table.columns(_("Type"),
_("Value"),
)
- obj_type = ContentType.objects.get_for_model(djperson)
- attributes = dji.Attribute.filter(object_type=obj_type,
- object_id=djperson.id)
- for attribute in attributes:
- table.row(attribute.attribute_type.name,
- attribute.value)
+ if user.is_authenticated():
+ obj_type = ContentType.objects.get_for_model(djperson)
+ attributes = dji.Attribute.filter(object_type=obj_type,
+ object_id=djperson.id)
+ for attribute in attributes:
+ table.row(attribute.attribute_type.name,
+ attribute.value)
return table.get_html()
def person_address_table(djperson, user):
@@ -145,14 +149,15 @@ def person_address_table(djperson, user):
_("City"),
_("State"),
_("Country"))
- for address in djperson.address_set.all().order_by("order"):
- locations = address.location_set.all().order_by("order")
- for location in locations:
- table.row(display_date(address),
- location.street,
- location.city,
- location.state,
- location.country)
+ if user.is_authenticated():
+ for address in djperson.address_set.all().order_by("order"):
+ locations = address.location_set.all().order_by("order")
+ for location in locations:
+ table.row(display_date(address),
+ location.street,
+ location.city,
+ location.state,
+ location.country)
return table.get_html()
def person_note_table(djperson, user):
@@ -161,15 +166,16 @@ def person_note_table(djperson, user):
_("ID"),
_("Type"),
_("Note"))
- obj_type = ContentType.objects.get_for_model(djperson)
- note_refs = dji.NoteRef.filter(object_type=obj_type,
- object_id=djperson.id)
- for note_ref in note_refs:
- note = table.db.get_note_from_handle(
- note_ref.ref_object.handle)
- table.row(table.db.get_note_from_handle(note.handle),
- str(note_ref.ref_object.note_type),
- note_ref.ref_object.text[:50])
+ if user.is_authenticated():
+ obj_type = ContentType.objects.get_for_model(djperson)
+ note_refs = dji.NoteRef.filter(object_type=obj_type,
+ object_id=djperson.id)
+ for note_ref in note_refs:
+ note = table.db.get_note_from_handle(
+ note_ref.ref_object.handle)
+ table.row(table.db.get_note_from_handle(note.handle),
+ str(note_ref.ref_object.note_type),
+ note_ref.ref_object.text[:50])
return table.get_html()
def person_gallery_table(djperson, user):
@@ -184,11 +190,12 @@ def person_internet_table(djperson, user):
table.columns(_("Type"),
_("Path"),
_("Description"))
- urls = dji.Url.filter(person=djperson)
- for url in urls:
- table.row(str(url.url_type),
- url.path,
- url.desc)
+ if user.is_authenticated():
+ urls = dji.Url.filter(person=djperson)
+ for url in urls:
+ table.row(str(url.url_type),
+ url.path,
+ url.desc)
return table.get_html()
def person_association_table(djperson, user):
@@ -196,10 +203,11 @@ def person_association_table(djperson, user):
table.columns(_("Name"),
_("ID"),
_("Association"))
- gperson = table.db.get_person_from_handle(djperson.handle)
- associations = gperson.get_person_ref_list()
- for association in associations:
- table.row()
+ if user.is_authenticated():
+ gperson = table.db.get_person_from_handle(djperson.handle)
+ associations = gperson.get_person_ref_list()
+ for association in associations:
+ table.row()
return table.get_html()
def person_lds_table(djperson, user):
@@ -209,14 +217,15 @@ def person_lds_table(djperson, user):
_("Status"),
_("Temple"),
_("Place"))
- obj_type = ContentType.objects.get_for_model(djperson)
- ldss = djperson.lds_set.all().order_by("order")
- for lds in ldss:
- table.row(str(lds.lds_type),
- display_date(lds),
- str(lds.status),
- lds.temple,
- get_title(lds.place))
+ if user.is_authenticated():
+ obj_type = ContentType.objects.get_for_model(djperson)
+ ldss = djperson.lds_set.all().order_by("order")
+ for lds in ldss:
+ table.row(str(lds.lds_type),
+ display_date(lds),
+ str(lds.status),
+ lds.temple,
+ get_title(lds.place))
return table.get_html()
def person_reference_table(djperson, user):
@@ -224,11 +233,12 @@ def person_reference_table(djperson, user):
table.columns(_("Type"),
_("ID"),
_("Name"))
- references = dji.PersonRef.filter(ref_object=djperson)
- for reference in references:
- table.row(str(reference.ref_object),
- reference.ref_object.gramps_id,
- make_name(reference.ref_object.name_set, user))
+ if user.is_authenticated():
+ references = dji.PersonRef.filter(ref_object=djperson)
+ for reference in references:
+ table.row(str(reference.ref_object),
+ reference.ref_object.gramps_id,
+ make_name(reference.ref_object.name_set, user))
return table.get_html()
def family_children_table(djfamily, user):
@@ -242,6 +252,7 @@ def family_children_table(djfamily, user):
_("Maternal"),
_("Birth Date"),
)
+ #if user.is_authenticated():
#for djfamily:
# table.row("test")
return table.get_html()