Refinements on gramps-connect editing people, families, and events
svn: r13957
This commit is contained in:
		@@ -34,7 +34,11 @@
 | 
			
		||||
         <li class="{{tview|currentSection:view.1 }}"><a href="/{{view.1}}/">{{view.0}}</a></li>
 | 
			
		||||
    {% endfor %}
 | 
			
		||||
    {% if user.is_authenticated %}
 | 
			
		||||
	 {% if next %}
 | 
			
		||||
         <li><a href="/logout/?next={{next}}">Logout</a></li>
 | 
			
		||||
	 {% else %}
 | 
			
		||||
         <li><a href="/logout">Logout</a></li>
 | 
			
		||||
	 {% endif %}
 | 
			
		||||
       {% if user.is_superuser %}
 | 
			
		||||
         <li><a href="/admin">Admin</a></li>
 | 
			
		||||
       {% endif %}
 | 
			
		||||
 
 | 
			
		||||
@@ -20,17 +20,21 @@
 | 
			
		||||
    <td>{{ forloop.counter|row_count:page }}</td>
 | 
			
		||||
    <td><a href="/{{view}}/{{event.handle|escape}}" class="noThumb">
 | 
			
		||||
           <span class="grampsid">[{{event.gramps_id}}]</span></a>
 | 
			
		||||
 | 
			
		||||
    {% if user.is_authenticated %}
 | 
			
		||||
    <td><a href="/{{view}}/{{event.handle|escape}}">{{event.event_type|escape}}</a>
 | 
			
		||||
 | 
			
		||||
    <td><a href="/{{view}}/{{event.handle|escape}}">{{event.event_type|nbsp}}</a>
 | 
			
		||||
    <td><a href="/{{view}}/{{event.handle|escape}}">{{event.description|nbsp}}</a>
 | 
			
		||||
    <td><a href="/{{view}}/{{event.handle|escape}}">{{event|display_date|nbsp}}</a>
 | 
			
		||||
    <td><a href="/{{view}}/{{event.handle|escape}}">{{event|render_date:user}}</a>
 | 
			
		||||
    <td><a href="/{{view}}/{{event.handle|escape}}">{{event.place.title|nbsp}}</a>
 | 
			
		||||
 | 
			
		||||
    {% else %}
 | 
			
		||||
      <td></td>
 | 
			
		||||
      <td></td>
 | 
			
		||||
      <td></td>
 | 
			
		||||
      <td></td>
 | 
			
		||||
      <td>[Private]</td>
 | 
			
		||||
      <td>[Private]</td>
 | 
			
		||||
      <td>[Private]</td>
 | 
			
		||||
      <td>[Private]</td>
 | 
			
		||||
    {% endif %}
 | 
			
		||||
 | 
			
		||||
  </tr>
 | 
			
		||||
  {% endfor %}
 | 
			
		||||
</tbody>
 | 
			
		||||
 
 | 
			
		||||
@@ -23,16 +23,16 @@
 | 
			
		||||
</tr>
 | 
			
		||||
<tr>
 | 
			
		||||
 <td class="ColumnAttribute">Name:</td>
 | 
			
		||||
 <td class="ColumnValue" id="data"><a href="/person/{{family.father.handle}}">{{family.father|make_name:user}} [{{family.father.gramps_id|escape}}]</a></td>
 | 
			
		||||
 <td class="ColumnValue" id="data"><a href="/person/{{family.father.handle}}">{{family.father|render_name:user}} [{{family.father.gramps_id}}]</a></td>
 | 
			
		||||
 <td class="ColumnAttribute">Name:</td>
 | 
			
		||||
 <td class="ColumnValue" id="data"><a href="/person/{{family.mother.handle}}">{{family.mother|make_name:user}} [{{family.mother.gramps_id|escape}}]</a></td>
 | 
			
		||||
 <td class="ColumnValue" id="data"><a href="/person/{{family.mother.handle}}">{{family.mother|render_name:user}} [{{family.mother.gramps_id}}]</a></td>
 | 
			
		||||
</tr>
 | 
			
		||||
{% if user.is_authenticated or not family.father.handle|probably_alive %}
 | 
			
		||||
{% if user.is_authenticated or not family.father.probably_alive %}
 | 
			
		||||
<tr>
 | 
			
		||||
 <td class="ColumnAttribute">Birth:</td>
 | 
			
		||||
 <td class="ColumnValue" id="data">{{family.father|person_get_birth_date}}</td>
 | 
			
		||||
 <td class="ColumnValue" id="data">{{family.father.birth|render_date:user}}</td>
 | 
			
		||||
 <td class="ColumnAttribute">Birth:</td>
 | 
			
		||||
 <td class="ColumnValue" id="data">{{family.mother|person_get_birth_date}}</td>
 | 
			
		||||
 <td class="ColumnValue" id="data">{{family.mother.birth|render_date:user}}</td>
 | 
			
		||||
</tr>
 | 
			
		||||
{% else %}
 | 
			
		||||
<tr>
 | 
			
		||||
@@ -44,24 +44,28 @@
 | 
			
		||||
{% endif %}
 | 
			
		||||
<tr>
 | 
			
		||||
 <td class="ColumnAttribute">Death:</td>
 | 
			
		||||
 <td class="ColumnValue" id="data">{{family.father|person_get_death_date}}</td>
 | 
			
		||||
 <td class="ColumnValue" id="data">{{family.father.death|render_date:user}}</td>
 | 
			
		||||
 <td class="ColumnAttribute">Death:</td>
 | 
			
		||||
 <td class="ColumnValue" id="data">{{family.mother|person_get_death_date}}</td>
 | 
			
		||||
 <td class="ColumnValue" id="data">{{family.mother.death|render_date:user}}</td>
 | 
			
		||||
</tr>
 | 
			
		||||
</tbody>
 | 
			
		||||
</table>
 | 
			
		||||
<table class="infolist"> {% comment %} 6 cols {% endcomment %}
 | 
			
		||||
<table class="infolist"> 
 | 
			
		||||
<tbody>
 | 
			
		||||
<tr>
 | 
			
		||||
  <th colspan="6">Relationship information</th>
 | 
			
		||||
  <th colspan="4">Relationship information</th>
 | 
			
		||||
</tr>
 | 
			
		||||
<tr>
 | 
			
		||||
 <td class="ColumnAttribute">ID:</td>
 | 
			
		||||
 <td class="ColumnValue" id="data">{{family.gramps_id|escape}}</td>
 | 
			
		||||
 <td class="ColumnValue" id="data">{{family.gramps_id}}</td>
 | 
			
		||||
 <td class="ColumnAttribute">Type:</td>
 | 
			
		||||
 <td class="ColumnValue" id="data">RELTYPE</td>
 | 
			
		||||
</tr>
 | 
			
		||||
<tr>
 | 
			
		||||
 <td class="ColumnAttribute">Marker:</td>
 | 
			
		||||
 <td class="ColumnValue" id="data">{{family.marker_type|escape}}</td>
 | 
			
		||||
 <td class="ColumnValue" id="data">{{family.marker_type}}</td>
 | 
			
		||||
 <td class="ColumnAttribute">Private:</td>
 | 
			
		||||
 <td class="ColumnValue" id="data">{{family.private}}</td>
 | 
			
		||||
</tr>
 | 
			
		||||
</tbody>
 | 
			
		||||
</table>
 | 
			
		||||
 
 | 
			
		||||
@@ -34,7 +34,7 @@
 | 
			
		||||
 | 
			
		||||
{% if user.is_authenticated %}
 | 
			
		||||
 | 
			
		||||
{% make_button "Add a new Person" "/person/add" %}
 | 
			
		||||
{% make_button "Add Person" "/person/add" %}
 | 
			
		||||
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -33,7 +33,7 @@
 | 
			
		||||
 <td class="ColumnValue" id="data">{% render nameform.surname user action %}</td>
 | 
			
		||||
 <td class="ColumnAttribute">{{nameform.prefix.label}}</td>
 | 
			
		||||
 <td class="ColumnValue" id="data">{% render nameform.prefix user action %}</td>
 | 
			
		||||
 <td rowspan="6" colspan="2" style="border:solid 2px #7D5925;">Image:</td>
 | 
			
		||||
 <td rowspan="7" colspan="2" style="border:solid 2px #7D5925;">Image:</td>
 | 
			
		||||
</tr>
 | 
			
		||||
<tr>
 | 
			
		||||
 <td class="ColumnAttribute" colspan="2"></td>
 | 
			
		||||
@@ -68,7 +68,6 @@
 | 
			
		||||
 <td class="ColumnValue" id="data">{% render personform.marker_type user action %}</td>
 | 
			
		||||
 <td class="ColumnAttribute">{{personform.private.label}}</td>
 | 
			
		||||
 <td class="ColumnValue" id="data">{% render personform.private user action %}</td>
 | 
			
		||||
 <td class="ColumnAttribute" colspan="1"></td>
 | 
			
		||||
</tr>
 | 
			
		||||
</tbody>
 | 
			
		||||
</table>
 | 
			
		||||
 
 | 
			
		||||
@@ -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:
 | 
			
		||||
 
 | 
			
		||||
@@ -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.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user