Incremental updates for css tweaks, showing validated info, family details and attempts for proper url handling

svn: r13631
This commit is contained in:
Doug Blank 2009-11-19 02:41:37 +00:00
parent 1846c513cf
commit f3d85ec0f4
13 changed files with 218 additions and 109 deletions

View File

@ -200,6 +200,17 @@ a:visited {
#data {
background-color: white;
border-style: solid;
border-color: #7D5925;
border-width:1px 1px 1px 1px;
}
table tr.even {
background-color: #FFF2C5;
}
table tr.odd {
background-color: #ffffe7;
}
/* Navigation

View File

@ -53,9 +53,9 @@
<div id="footer">
{% block footer %}
<p id="createdate">
Gramps-Connect
Gramps Connect, tools for genealogy collaborations
</p>
<p id="copyright">&copy; 2009 <a href="http://www.gramps-project.org/">www.gramps-project.net</a>
<p id="copyright">&copy; 2009 <a href="http://www.gramps-project.org/">www.gramps-project.org</a>
</p>
{% endblock %}
</div>

View File

@ -18,13 +18,14 @@
<p id="description">
Database information:</p>
<table class="infolist">
<table class="infolist surname">
<tr>
<th>Item</th>
<th>Count</th>
</tr>
{% for view in views %}
<tr><td align="left"><a href="/{{view.1}}">{{view.0}}</a></td>
<tr class="{% cycle odd,even %}">
<td align="left"><a href="/{{view.1}}">{{view.0}}</a></td>
<td align="right"><a href="/{{view.1}}">{{view.2.objects.count}}</td>
</tr>
{% endfor %}

View File

@ -1,6 +1,6 @@
{% extends "gramps-base.html" %}
{% 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 %}

View File

@ -6,7 +6,7 @@
<table cellspacing="0" class="infolist surname">
<thead>
<tr>
<th>Family #</th>
<th>#</th>
<th>ID</th>
<th>Father</th>
<th>Mother</th>
@ -16,10 +16,10 @@
<tbody>
{% for family in page.object_list %}
<tr class="{% cycle odd,even %}">
<td>{{ forloop.counter|row_count:page }}</td>
<td><a href="/{{view}}/{{family.handle|escape}}" class="noThumb">{{ forloop.counter|row_count:page }}</a></td>
<td><a href="/{{view}}/{{family.handle|escape}}" class="noThumb"><span class="grampsid">[{{family.gramps_id}}]</span></a>
<td><a href="/person/{{family.father.handle|escape}}">{{family.father.name_set|make_name:user}}</a>
<td><a href="/person/{{family.mother.handle|escape}}">{{family.mother.name_set|make_name:user}}</a>
<td><a href="/{{view}}/{{family.handle|escape}}">{{family.father.name_set|make_name:user}}</a>
<td><a href="/{{view}}/{{family.handle|escape}}">{{family.mother.name_set|make_name:user}}</a>
{% if user.is_authenticated %}
<td><a href="/{{view}}/{{family.handle|escape}}">{{family.family_rel_type|escape}}</a>
{% else %}

View File

@ -27,12 +27,21 @@
<td class="ColumnAttribute">Name:</td>
<td class="ColumnValue" id="data"><a href="/person/{{family.mother.handle}}">{{family.mother.name_set|make_name:user}} [{{family.mother.gramps_id|escape}}]</a></td>
</tr>
{% if user.is_authenticated or not family.father.handle|probably_alive %}
<tr>
<td class="ColumnAttribute">Birth:</td>
<td class="ColumnValue" id="data">{{family.father|person_get_birth_date}}</td>
<td class="ColumnAttribute">Birth:</td>
<td class="ColumnValue" id="data">{{family.mother|person_get_birth_date}}</td>
</tr>
{% else %}
<tr>
<td class="ColumnAttribute">Birth:</td>
<td class="ColumnValue" id="data">[Private]</td>
<td class="ColumnAttribute">Birth:</td>
<td class="ColumnValue" id="data">[Private]</td>
</tr>
{% endif %}
<tr>
<td class="ColumnAttribute">Death:</td>
<td class="ColumnValue" id="data">{{family.father|person_get_death_date}}</td>

View File

@ -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 %}

View File

@ -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 %}

View File

@ -3,10 +3,10 @@
{% block table_data %}
<table cellspacing="0" class="infolist IndividualList">
<table cellspacing="0" class="infolist surname">
<thead>
<tr>
<th>Person #</th>
<th>#</th>
<th>Name</th>
<th>ID</th>
<th>Gender</th>
@ -20,17 +20,18 @@
<tbody>
{% for name in page.object_list %}
<tr class="{% cycle odd,even %}">
<td>{{ forloop.counter|row_count:page }}</td>
<td><a href="/{{view}}/{{name.person.handle|escape}}/" class="noThumb">{{name|make_name:user}}</a>
<td><a href="{{name.person.handle|escape}}/" class="noThumb">{{ forloop.counter|row_count:page }}</a>
</td>
<td><a href="/{{view}}/{{name.person.handle|escape}}" class="grampsid">[{{name.person.gramps_id|escape}}]</a></td>
<td><a href="/{{view}}/{{name.person.handle|escape}}" class="noThumb">{{name.person.gender_type|escape}}</a></td>
<td><a href="{{name.person.handle|escape}}/" class="noThumb">{{name|make_name:user}}</a>
</td>
<td><a href="{{name.person.handle|escape}}/" class="grampsid">[{{name.person.gramps_id|escape}}]</a></td>
<td><a href="{{name.person.handle|escape}}/" class="noThumb">{{name.person.gender_type|escape}}</a></td>
{% if user.is_authenticated %}
<td><a href="/{{view}}/{{name.person.handle|escape}}" class="noThumb">{{name.person|person_get_birth_date}}</a></td>
<td><a href="/{{view}}/{{name.person.handle|escape}}" class="noThumb">{{name.person|person_get_death_date}}</a></td>
<td><a href="{{name.person.handle|escape}}/" class="noThumb">{{name.person|person_get_birth_date}}</a></td>
<td><a href="{{name.person.handle|escape}}/" class="noThumb">{{name.person|person_get_death_date}}</a></td>
{% else %}
<td><a href="/{{view}}/{{name.person.handle|escape}}/" class="noThumb">[Private]</a>
<td><a href="/{{view}}/{{name.person.handle|escape}}/" class="noThumb">[Private]</a>
<td><a href="{{name.person.handle|escape}}/" class="noThumb">[Private]</a>
<td><a href="{{name.person.handle|escape}}/" class="noThumb">[Private]</a>
{% endif %}
</tr>
{% endfor %}

View File

@ -15,13 +15,18 @@
<div id="summaryarea">
<table class="infolist"> {% comment %} 5 cols {% endcomment %}
<tbody>
{% if user.is_authenticated %}
<tr>
<td class="ColumnAttribute">Family:</td>
<td class="ColumnValue" id="data">{{person.name_set|preferred:"surname"}}</td>
<td class="ColumnAttribute">Prefix:</td>
<td class="ColumnValue" id="data">{{person.name_set|preferred:"prefix"}}</td>
<td rowspan="3" colspan="2" style="border:solid 2px #7D5925;">Image:</td>
<td rowspan="5" colspan="2" style="border:solid 2px #7D5925;">Image:</td>
</tr>
<td class="ColumnAttribute" colspan="2"></td>
<td class="ColumnAttribute">Suffix:</td>
<td class="ColumnValue" id="data">{{person.name_set|preferred:"suffix"}}</td>
<tr>
<td class="ColumnAttribute">Given:</td>
<td class="ColumnValue" id="data">{{person.name_set|preferred:"first_name"}}</td>
@ -34,6 +39,11 @@
<td class="ColumnAttribute">Patronymic:</td>
<td class="ColumnValue" id="data">{{person.name_set|preferred:"patronymic"}}</td>
</tr>
</tr>
<td class="ColumnAttribute" colspan="2"></td>
<td class="ColumnAttribute">Title:</td>
<td class="ColumnValue" id="data">{{person.name_set|preferred:"title"}}</td>
<tr>
<tr>
<td class="ColumnAttribute">Gender:</td>
<td class="ColumnValue" id="data">{{person.gender_type|escape}}</td>
@ -44,9 +54,50 @@
</tr>
</tbody>
</table>
</div>
</div>
{% else %}
<tr>
<td class="ColumnAttribute">Family:</td>
<td class="ColumnValue" id="data">{{person.name_set|preferred:"surname"}}</td>
<td class="ColumnAttribute">Prefix:</td>
<td class="ColumnValue" id="data">[Private]</td>
<td rowspan="5" colspan="2" style="border:solid 2px #7D5925;">Image:</td>
</tr>
<td class="ColumnAttribute" colspan="2"></td>
<td class="ColumnAttribute">Suffix:</td>
<td class="ColumnValue" id="data">[Private]</td>
<tr>
<td class="ColumnAttribute">Given:</td>
<td class="ColumnValue" id="data">[Private]</td>
<td class="ColumnAttribute">Call Name:</td>
<td class="ColumnValue" id="data">[Private]</td>
</tr>
<tr>
<td class="ColumnAttribute">Type:</td>
<td class="ColumnValue" id="data">{{person.name_set|preferred:"name_type"}}</td>
<td class="ColumnAttribute">Patronymic:</td>
<td class="ColumnValue" id="data">[Private]</td>
</tr>
</tr>
<td class="ColumnAttribute" colspan="2"></td>
<td class="ColumnAttribute">Title:</td>
<td class="ColumnValue" id="data">[Private]</td>
<tr>
<tr>
<td class="ColumnAttribute">Gender:</td>
<td class="ColumnValue" id="data">{{person.gender_type|escape}}</td>
<td class="ColumnAttribute">ID:</td>
<td class="ColumnValue" id="data">{{person.gramps_id|escape}}</td>
<td class="ColumnAttribute">Marker:</td>
<td class="ColumnValue" id="data"></td>
</tr>
</tbody>
</table>
{% endif %}
</div>
</div>
<!-- Tabs -->
<h2 class="demoHeaders">Tabs</h2>

View File

@ -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)

View File

@ -33,5 +33,27 @@ urlpatterns += patterns('',
(r'^login/$', 'django.contrib.auth.views.login'),
(r'^logout/$', logout_page),
(r'^(?P<view>(\w+))/$', view),
url(r'^person/(?P<handle>(\w+))/$', view_detail,
{"view": "person"}, name="view-person-detail"),
(r'^(?P<view>(\w+))/(?P<handle>(\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 %}
# <a href="{{ the_url }}">Link to optional stuff</a>
#{% endif %}
# In code:
#from django.core.urlresolvers import reverse
#
#def myview(request):
# return HttpResponseRedirect(reverse('arch-summary', args=[1945]))

View File

@ -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()