Pass search and page throughout, for going back from what you were doing

svn: r19758
This commit is contained in:
Doug Blank 2012-06-05 01:48:39 +00:00
parent c2de30e2de
commit 9496e097d8
22 changed files with 155 additions and 126 deletions

View File

@ -140,18 +140,22 @@
{% if user.is_superuser %}
{% if action == "edit" %}
{% make_button "Cancel" "/citation/%s" citation.handle %}
{% make_button "Cancel" "/citation/%s" citation.handle args %}
<input type="hidden" name="action" value="save"/>
<input type="hidden" name="search" value="{{search}}"/>
<input type="hidden" name="page" value="{{page}}"/>
<input type="submit" value="Save"/>
{% else %}
{% ifequal action "add" %}
{% make_button "Cancel" "/citation/" %}
{% make_button "Cancel" "/citation/" args %}
<input type="hidden" name="action" value="create"/>
<input type="hidden" name="search" value="{{search}}"/>
<input type="hidden" name="page" value="{{page}}"/>
<input type="submit" value="Create"/>
{% else %}
{% make_button "Add Citation" "/citation/add" %}
{% make_button "Edit Citation" "/citation/%s/edit" citation.handle %}
{% make_button "Delete Citation" "/citation/%s/delete" citation.handle %}
{% make_button "Add Citation" "/citation/add" args %}
{% make_button "Edit Citation" "/citation/%s/edit" citation.handle args %}
{% make_button "Delete Citation" "/citation/%s/delete" citation.handle args %}
{% endifequal %}
{% endif %}
{% else %}

View File

@ -17,12 +17,12 @@
{% for source in page.object_list %}
<tr class="{% cycle odd,even %}">
<td>{{ forloop.counter|row_count:page }}</td>
<td><a href="/{{view}}/{{source.handle|escape}}" class="browsecell">
<td><a href="/{{view}}/{{source.handle|escape}}{{args}}" class="browsecell">
<span class="grampsid">[{{source.gramps_id}}]</span></a>
{% if user.is_authenticated %}
<td><a href="/{{view}}/{{source.handle|escape}}" class="browsecell">{{source.title|escape|nbsp}}</a>
<td><a href="/{{view}}/{{source.handle|escape}}" class="browsecell">{{source.pubinfo|nbsp}}</a>
<td><a href="/{{view}}/{{source.handle|escape}}" class="browsecell">{{source.author|nbsp}}</a>
<td><a href="/{{view}}/{{source.handle|escape}}{{args}}" class="browsecell">{{source.title|escape|nbsp}}</a>
<td><a href="/{{view}}/{{source.handle|escape}}{{args}}" class="browsecell">{{source.pubinfo|nbsp}}</a>
<td><a href="/{{view}}/{{source.handle|escape}}{{args}}" class="browsecell">{{source.author|nbsp}}</a>
{% else %}
<td></td>
<td></td>
@ -34,7 +34,7 @@
</table>
{% if user.is_superuser %}
{% make_button "Add Citation" "/citation/add" %}
{% make_button "Add Citation" "/citation/add" args %}
{% endif %}
{% endblock %}

View File

@ -77,18 +77,22 @@
{% if user.is_superuser %}
{% if action == "edit" %}
{% make_button "Cancel" "/event/%s" event.handle %}
{% make_button "Cancel" "/event/%s" event.handle args %}
<input type="hidden" name="action" value="save"/>
<input type="hidden" name="search" value="{{search}}"/>
<input type="hidden" name="page" value="{{page}}"/>
<input type="submit" value="Save"/>
{% else %}
{% ifequal action "add" %}
{% make_button "Cancel" "/event/" %}
{% make_button "Cancel" "/event/" args %}
<input type="hidden" name="action" value="create"/>
<input type="hidden" name="search" value="{{search}}"/>
<input type="hidden" name="page" value="{{page}}"/>
<input type="submit" value="Create"/>
{% else %}
{% make_button "Add Event" "/event/add" %}
{% make_button "Edit Event" "/event/%s/edit" event.handle %}
{% make_button "Delete Event" "/event/%s/delete" event.handle %}
{% make_button "Add Event" "/event/add" args %}
{% make_button "Edit Event" "/event/%s/edit" event.handle args %}
{% make_button "Delete Event" "/event/%s/delete" event.handle args %}
{% endifequal %}
{% endif %}
{% else %}

View File

@ -18,15 +18,15 @@
{% for event in page.object_list %}
<tr class="{% cycle odd,even %}">
<td>{{ forloop.counter|row_count:page }}</td>
<td><a href="/{{view}}/{{event.handle|escape}}" class="noThumb browsecell">
<td><a href="/{{view}}/{{event.handle|escape}}{{args}}" class="noThumb browsecell">
<span class="grampsid">[{{event.gramps_id}}]</span></a>
{% if user.is_authenticated %}
<td><a href="/{{view}}/{{event.handle|escape}}" class="browsecell">{{event.event_type|nbsp}}</a>
<td><a href="/{{view}}/{{event.handle|escape}}" class="browsecell">{{event.description|nbsp}}</a>
<td><a href="/{{view}}/{{event.handle|escape}}" class="browsecell">{{event|date_as_text:user}}</a>
<td><a href="/{{view}}/{{event.handle|escape}}" class="browsecell">{{event.place.title|nbsp}}</a>
<td><a href="/{{view}}/{{event.handle|escape}}{{args}}" class="browsecell">{{event.event_type|nbsp}}</a>
<td><a href="/{{view}}/{{event.handle|escape}}{{args}}" class="browsecell">{{event.description|nbsp}}</a>
<td><a href="/{{view}}/{{event.handle|escape}}{{args}}" class="browsecell">{{event|date_as_text:user}}</a>
<td><a href="/{{view}}/{{event.handle|escape}}{{args}}" class="browsecell">{{event.place.title|nbsp}}</a>
{% else %}
<td>[Private]</td>
@ -41,7 +41,7 @@
</table>
{% if user.is_superuser %}
{% make_button "Add Event" "/event/add" %}
{% make_button "Add Event" "/event/add" args %}
{% endif %}
{% endblock %}

View File

@ -16,14 +16,14 @@
<tbody>
{% for family in page.object_list %}
<tr class="{% cycle odd,even %}">
<td><a href="/{{view}}/{{family.handle|escape}}" class="browsecell">{{ forloop.counter|row_count:page }}</a></td>
<td><a href="/{{view}}/{{family.handle|escape}}" class="browsecell"><span class="grampsid">[{{family.gramps_id}}]</span></a>
<td><a href="/{{view}}/{{family.handle|escape}}" class="browsecell">{{family.father|make_name:user|nbsp}}</a>
<td><a href="/{{view}}/{{family.handle|escape}}" class="browsecell">{{family.mother|make_name:user|nbsp}}</a>
<td><a href="/{{view}}/{{family.handle|escape}}{{args}}" class="browsecell">{{ forloop.counter|row_count:page }}</a></td>
<td><a href="/{{view}}/{{family.handle|escape}}{{args}}" class="browsecell"><span class="grampsid">[{{family.gramps_id}}]</span></a>
<td><a href="/{{view}}/{{family.handle|escape}}{{args}}" class="browsecell">{{family.father|make_name:user|nbsp}}</a>
<td><a href="/{{view}}/{{family.handle|escape}}{{args}}" class="browsecell">{{family.mother|make_name:user|nbsp}}</a>
{% if user.is_authenticated %}
<td><a href="/{{view}}/{{family.handle|escape}}" class="browsecell">{{family.family_rel_type|escape|nbsp}}</a>
<td><a href="/{{view}}/{{family.handle|escape}}{{args}}" class="browsecell">{{family.family_rel_type|escape|nbsp}}</a>
{% else %}
<td><a href="/{{view}}/{{family.handle|escape}}" class="browsecell">[Private]</a>
<td><a href="/{{view}}/{{family.handle|escape}}{{args}}" class="browsecell">[Private]</a>
{% endif %}
</tr>
{% endfor %}
@ -31,7 +31,7 @@
</table>
{% if user.is_superuser %}
{% make_button "Add Family" "/family/add" %}
{% make_button "Add Family" "/family/add" args %}
{% endif %}
{% endblock %}

View File

@ -122,18 +122,22 @@
{% if user.is_superuser %}
{% if action == "edit" %}
{% make_button "Cancel" "/family/%s" family.handle %}
{% make_button "Cancel" "/family/%s" family.handle args %}
<input type="hidden" name="action" value="save"/>
<input type="hidden" name="search" value="{{search}}"/>
<input type="hidden" name="page" value="{{page}}"/>
<input type="submit" value="Save"/>
{% else %}
{% ifequal action "add" %}
{% make_button "Cancel" "/family/" %}
{% make_button "Cancel" "/family/" args %}
<input type="hidden" name="action" value="create"/>
<input type="hidden" name="search" value="{{search}}"/>
<input type="hidden" name="page" value="{{page}}"/>
<input type="submit" value="Create"/>
{% else %}
{% make_button "Add Family" "/family/add" %}
{% make_button "Edit Family" "/family/%s/edit" family.handle %}
{% make_button "Delete Family" "/family/%s/delete" family.handle %}
{% make_button "Add Family" "/family/add" args %}
{% make_button "Edit Family" "/family/%s/edit" family.handle args %}
{% make_button "Delete Family" "/family/%s/delete" family.handle args %}
{% endifequal %}
{% endif %}
{% else %}

View File

@ -17,12 +17,12 @@
{% for media in page.object_list %}
<tr class="{% cycle odd,even %}">
<td>{{ forloop.counter|row_count:page }}</td>
<td><a href="/{{view}}/{{media.handle|escape}}" class="noThumb browsecell">
<td><a href="/{{view}}/{{media.handle|escape}}{{args}}" class="noThumb browsecell">
<span class="grampsid">[{{media.gramps_id}}]</span></a>
{% if user.is_authenticated %}
<td><a href="/{{view}}/{{media.handle|escape}}" class="browsecell">{{media.mime|escape}}</a>
<td><a href="/{{view}}/{{media.handle|escape}}" class="browsecell">{{media|display_date|nbsp}}</a>
<td><a href="/{{view}}/{{media.handle|escape}}" class="browsecell">{{media.path|escape}}</a>
<td><a href="/{{view}}/{{media.handle|escape}}{{args}}" class="browsecell">{{media.mime|escape}}</a>
<td><a href="/{{view}}/{{media.handle|escape}}{{args}}" class="browsecell">{{media|display_date|nbsp}}</a>
<td><a href="/{{view}}/{{media.handle|escape}}{{args}}" class="browsecell">{{media.path|escape}}</a>
{% else %}
<td></td>
<td></td>
@ -34,7 +34,7 @@
</table>
{% if user.is_superuser %}
{% make_button "Add Media" "/media/add" %}
{% make_button "Add Media" "/media/add" args %}
{% endif %}
{% endblock %}

View File

@ -77,18 +77,22 @@
{% if user.is_superuser %}
{% if action == "edit" %}
{% make_button "Cancel" "/media/%s" media.handle %}
{% make_button "Cancel" "/media/%s" media.handle args %}
<input type="hidden" name="action" value="save"/>
<input type="hidden" name="search" value="{{search}}"/>
<input type="hidden" name="page" value="{{page}}"/>
<input type="submit" value="Save"/>
{% else %}
{% ifequal action "add" %}
{% make_button "Cancel" "/media/" %}
{% make_button "Cancel" "/media/" args %}
<input type="hidden" name="action" value="create"/>
<input type="hidden" name="search" value="{{search}}"/>
<input type="hidden" name="page" value="{{page}}"/>
<input type="submit" value="Create"/>
{% else %}
{% make_button "Add Media" "/media/add" %}
{% make_button "Edit Media" "/media/%s/edit" media.handle %}
{% make_button "Delete Media" "/media/%s/delete" media.handle %}
{% make_button "Add Media" "/media/add" args %}
{% make_button "Edit Media" "/media/%s/edit" media.handle args %}
{% make_button "Delete Media" "/media/%s/delete" media.handle args %}
{% endifequal %}
{% endif %}
{% else %}

View File

@ -116,30 +116,24 @@
{% if user.is_authenticated %}
{% ifequal action "add" %}
<input type="button"
value="Cancel"
onclick="document.location.href='/person/{{person.handle}}#tab-names'"/>
{% make_button "Cancel" "/person/%s" person.handle args "#tab-names" %}
<input type="hidden" name="action" value="create"/>
<input type="hidden" name="search" value="{{search}}"/>
<input type="hidden" name="page" value="{{page}}"/>
<input type="submit" value="Create"/>
{% else %}
{% ifequal action "edit" %}
<input type="button"
value="Cancel"
onclick="document.location.href='/person/'"/>
{% make_button "Cancel" "/person/" args "#tab-names" %}
<input type="hidden" name="action" value="save"/>
<input type="hidden" name="search" value="{{search}}"/>
<input type="hidden" name="page" value="{{page}}"/>
<input type="submit" value="Save"/>
{% else %}
<input type="button"
value="Add Name"
onclick="document.location.href='/person/{{person.handle}}/name/add'"/>
<input type="button"
value="Edit Name"
onclick="document.location.href='/person/{{person.handle}}/name/{{order}}/edit'"/>
<input type="button"
value="Delete Name"
onclick="document.location.href='/person/{{person.handle}}/name/{{order}}/delete'"/>
{% endifequal %}
{% make_button "Add Name" "/person/%s/name/add" person.handle args %}
{% make_button "Edit Name" "/person/%s/name/%s/edit" person.handle order args %}
{% make_button "Delete Name" "/person/%s/name/%s/delete" person.handle order args %}
{% endifequal %}
{% endifequal %}
{% else %}
{% endif %}
</form>

View File

@ -85,18 +85,22 @@
{% if user.is_superuser %}
{% if action == "edit" %}
{% make_button "Cancel" "/note/%s" note.handle %}
{% make_button "Cancel" "/note/%s" note.handle args %}
<input type="hidden" name="action" value="save"/>
<input type="hidden" name="search" value="{{search}}"/>
<input type="hidden" name="page" value="{{page}}"/>
<input type="submit" value="Save"/>
{% else %}
{% ifequal action "add" %}
{% make_button "Cancel" "/note/" %}
{% make_button "Cancel" "/note/" args %}
<input type="hidden" name="action" value="create"/>
<input type="hidden" name="search" value="{{search}}"/>
<input type="hidden" name="page" value="{{page}}"/>
<input type="submit" value="Create"/>
{% else %}
{% make_button "Add Note" "/note/add" %}
{% make_button "Edit Note" "/note/%s/edit" note.handle %}
{% make_button "Delete Note" "/note/%s/delete" note.handle %}
{% make_button "Add Note" "/note/add" args %}
{% make_button "Edit Note" "/note/%s/edit" note.handle args %}
{% make_button "Delete Note" "/note/%s/delete" note.handle args %}
{% endifequal %}
{% endif %}
{% else %}

View File

@ -16,11 +16,11 @@
{% for note in page.object_list %}
<tr class="{% cycle odd,even %}">
<td>{{ forloop.counter|row_count:page }}</td>
<td><a href="/{{view}}/{{note.handle|escape}}" class="noThumb browsecell">
<td><a href="/{{view}}/{{note.handle|escape}}{{args}}" class="noThumb browsecell">
<span class="grampsid">[{{note.gramps_id}}]</span></a>
{% if user.is_authenticated %}
<td><a href="/{{view}}/{{note.handle|escape}}" class="browsecell">{{note.note_type|escape|nbsp}}</a>
<td><a href="/{{view}}/{{note.handle|escape}}" class="browsecell">{{note.text|preview:70|nbsp}}</a>
<td><a href="/{{view}}/{{note.handle|escape}}{{args}}" class="browsecell">{{note.note_type|escape|nbsp}}</a>
<td><a href="/{{view}}/{{note.handle|escape}}{{args}}" class="browsecell">{{note.text|preview:70|nbsp}}</a>
{% else %}
<td></td>
<td></td>
@ -31,7 +31,7 @@
</table>
{% if user.is_superuser %}
{% make_button "Add Note" "/note/add" %}
{% make_button "Add Note" "/note/add" args %}
{% endif %}
{% endblock %}

View File

@ -140,7 +140,7 @@
<input type="submit" value="Save"/>
{% else %}
{% ifequal action "add" %}
{% make_button "Cancel" "/person/" %}
{% make_button "Cancel" "/person/" args %}
<input type="hidden" name="action" value="create"/>
<input type="hidden" name="search" value="{{search}}"/>
<input type="hidden" name="page" value="{{page}}"/>

View File

@ -85,18 +85,22 @@
{% if user.is_superuser %}
{% if action == "edit" %}
{% make_button "Cancel" "/place/%s" place.handle %}
{% make_button "Cancel" "/place/%s" place.handle args %}
<input type="hidden" name="action" value="save"/>
<input type="hidden" name="search" value="{{search}}"/>
<input type="hidden" name="page" value="{{page}}"/>
<input type="submit" value="Save"/>
{% else %}
{% ifequal action "add" %}
{% make_button "Cancel" "/place/" %}
{% make_button "Cancel" "/place/" args %}
<input type="hidden" name="action" value="create"/>
<input type="hidden" name="search" value="{{search}}"/>
<input type="hidden" name="page" value="{{page}}"/>
<input type="submit" value="Create"/>
{% else %}
{% make_button "Add Place" "/place/add" %}
{% make_button "Edit Place" "/place/%s/edit" place.handle %}
{% make_button "Delete Place" "/place/%s/delete" place.handle %}
{% make_button "Add Place" "/place/add" args %}
{% make_button "Edit Place" "/place/%s/edit" place.handle args %}
{% make_button "Delete Place" "/place/%s/delete" place.handle args %}
{% endifequal %}
{% endif %}
{% else %}

View File

@ -15,10 +15,10 @@
{% for place in page.object_list %}
<tr class="{% cycle odd,even %}">
<td>{{ forloop.counter|row_count:page }}</td>
<td><a href="/{{view}}/{{place.handle|escape}}" class="noThumb browsecell">
<td><a href="/{{view}}/{{place.handle|escape}}{{args}}" class="noThumb browsecell">
<span class="grampsid">[{{place.gramps_id}}]</span></a>
{% if user.is_authenticated %}
<td><a href="/{{view}}/{{place.handle|escape}}" class="browsecell">{{place.title|escape|nbsp}}</a>
<td><a href="/{{view}}/{{place.handle|escape}}{{args}}" class="browsecell">{{place.title|escape|nbsp}}</a>
{% else %}
<td></td>
{% endif %}
@ -28,7 +28,7 @@
</table>
{% if user.is_superuser %}
{% make_button "Add Places" "/place/add" %}
{% make_button "Add Places" "/place/add" args %}
{% endif %}
{% endblock %}

View File

@ -17,11 +17,11 @@
{% for repository in page.object_list %}
<tr class="{% cycle odd,even %}">
<td>{{ forloop.counter|row_count:page }}</td>
<td><a href="/{{view}}/{{repository.handle|escape}}" class="noThumb browsecell">
<td><a href="/{{view}}/{{repository.handle|escape}}{{args}}" class="noThumb browsecell">
<span class="grampsid">[{{repository.gramps_id}}]</span></a>
{% if user.is_authenticated %}
<td><a href="/{{view}}/{{repository.handle|escape}}" class="browsecell">{{repository.repository_type|escape|nbsp}}</a>
<td><a href="/{{view}}/{{repository.handle|escape}}" class="browsecell">{{repository.name|escape|nbsp}}</a>
<td><a href="/{{view}}/{{repository.handle|escape}}{{args}}" class="browsecell">{{repository.repository_type|escape|nbsp}}</a>
<td><a href="/{{view}}/{{repository.handle|escape}}{{args}}" class="browsecell">{{repository.name|escape|nbsp}}</a>
{% else %}
<td></td>
<td></td>
@ -32,7 +32,7 @@
</table>
{% if user.is_superuser %}
{% make_button "Add Repository" "/repository/add" %}
{% make_button "Add Repository" "/repository/add" args %}
{% endif %}
{% endblock %}

View File

@ -69,18 +69,22 @@
{% if user.is_superuser %}
{% if action == "edit" %}
{% make_button "Cancel" "/repository/%s" repository.handle %}
{% make_button "Cancel" "/repository/%s" repository.handle args %}
<input type="hidden" name="action" value="save"/>
<input type="hidden" name="search" value="{{search}}"/>
<input type="hidden" name="page" value="{{page}}"/>
<input type="submit" value="Save"/>
{% else %}
{% ifequal action "add" %}
{% make_button "Cancel" "/repository/" %}
{% make_button "Cancel" "/repository/" args %}
<input type="hidden" name="action" value="create"/>
<input type="hidden" name="search" value="{{search}}"/>
<input type="hidden" name="page" value="{{page}}"/>
<input type="submit" value="Create"/>
{% else %}
{% make_button "Add Repository" "/repository/add" %}
{% make_button "Edit Repository" "/repository/%s/edit" repository.handle %}
{% make_button "Delete Repository" "/repository/%s/delete" repository.handle %}
{% make_button "Add Repository" "/repository/add" args %}
{% make_button "Edit Repository" "/repository/%s/edit" repository.handle args %}
{% make_button "Delete Repository" "/repository/%s/delete" repository.handle args %}
{% endifequal %}
{% endif %}
{% else %}

View File

@ -78,18 +78,22 @@
{% if user.is_superuser %}
{% if action == "edit" %}
{% make_button "Cancel" "/source/%s" source.handle %}
{% make_button "Cancel" "/source/%s" source.handle args %}
<input type="hidden" name="action" value="save"/>
<input type="hidden" name="search" value="{{search}}"/>
<input type="hidden" name="page" value="{{page}}"/>
<input type="submit" value="Save"/>
{% else %}
{% ifequal action "add" %}
{% make_button "Cancel" "/source/" %}
{% make_button "Cancel" "/source/" args %}
<input type="hidden" name="action" value="create"/>
<input type="hidden" name="search" value="{{search}}"/>
<input type="hidden" name="page" value="{{page}}"/>
<input type="submit" value="Create"/>
{% else %}
{% make_button "Add Source" "/source/add" %}
{% make_button "Edit Source" "/source/%s/edit" source.handle %}
{% make_button "Delete Source" "/source/%s/delete" source.handle %}
{% make_button "Add Source" "/source/add" args %}
{% make_button "Edit Source" "/source/%s/edit" source.handle args %}
{% make_button "Delete Source" "/source/%s/delete" source.handle args %}
{% endifequal %}
{% endif %}
{% else %}

View File

@ -17,12 +17,12 @@
{% for source in page.object_list %}
<tr class="{% cycle odd,even %}">
<td>{{ forloop.counter|row_count:page }}</td>
<td><a href="/{{view}}/{{source.handle|escape}}" class="noThumb browsecell">
<td><a href="/{{view}}/{{source.handle|escape}}{{args}}" class="noThumb browsecell">
<span class="grampsid">[{{source.gramps_id}}]</span></a>
{% if user.is_authenticated %}
<td><a href="/{{view}}/{{source.handle|escape}}" class="browsecell">{{source.title|escape|nbsp}}</a>
<td><a href="/{{view}}/{{source.handle|escape}}" class="browsecell">{{source.pubinfo|nbsp}}</a>
<td><a href="/{{view}}/{{source.handle|escape}}" class="browsecell">{{source.author|nbsp}}</a>
<td><a href="/{{view}}/{{source.handle|escape}}{{args}}" class="browsecell">{{source.title|escape|nbsp}}</a>
<td><a href="/{{view}}/{{source.handle|escape}}{{args}}" class="browsecell">{{source.pubinfo|nbsp}}</a>
<td><a href="/{{view}}/{{source.handle|escape}}{{args}}" class="browsecell">{{source.author|nbsp}}</a>
{% else %}
<td></td>
<td></td>
@ -34,7 +34,7 @@
</table>
{% if user.is_superuser %}
{% make_button "Add Source" "/source/add" %}
{% make_button "Add Source" "/source/add" args %}
{% endif %}
{% endblock %}

View File

@ -68,28 +68,22 @@
{% if user.is_authenticated %}
{% if action == "edit" %}
<input type="button"
value="Cancel"
onclick="document.location.href='/person/{{person.handle}}/name/{{order}}/surname/{{sorder}}'"/>
{% make_button "Cancel" "/person/%s/name/%s/surname/%s" person.handle order sorder args %}
<input type="hidden" name="action" value="save"/>
<input type="hidden" name="search" value="{{search}}"/>
<input type="hidden" name="page" value="{{page}}"/>
<input type="submit" value="Save">
{% else %}
{% if action == "add" %}
<input type="button"
value="Cancel"
onclick="document.location.href='/person/{{person.handle}}/name/{{order}}'"/>
<input type="hidden" name="action" value="create"/>
<input type="submit" value="Save">
{% if action == "add" %}
{% make_button "Cancel" "/person/%s/name/%s" person.handle order args %}
<input type="hidden" name="action" value="create"/>
<input type="hidden" name="search" value="{{search}}"/>
<input type="hidden" name="page" value="{{page}}"/>
<input type="submit" value="Save">
{% else %}
<input type="button"
value="Add Surname"
onclick="document.location.href='/person/{{person.handle}}/name/{{order}}/surname/add'"/>
<input type="button"
value="Edit Surname"
onclick="document.location.href='/person/{{person.handle}}/name/{{order}}/surname/{{sorder}}/edit'"/>
<input type="button"
value="Delete Surname"
onclick="document.location.href='/person/{{person.handle}}/name/{{order}}/surname/{{sorder}}/delete'"/>
{% 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 %}
{% endif %}
{% endif %}
{% endif %}

View File

@ -53,18 +53,22 @@
{% if user.is_superuser %}
{% if action == "edit" %}
{% make_button "Cancel" "/tag/%s" tag.handle %}
{% make_button "Cancel" "/tag/%s" tag.handle args %}
<input type="hidden" name="action" value="save"/>
<input type="hidden" name="search" value="{{search}}"/>
<input type="hidden" name="page" value="{{page}}"/>
<input type="submit" value="Save"/>
{% else %}
{% ifequal action "add" %}
{% make_button "Cancel" "/tag/" %}
{% make_button "Cancel" "/tag/" args %}
<input type="hidden" name="action" value="create"/>
<input type="hidden" name="search" value="{{search}}"/>
<input type="hidden" name="page" value="{{page}}"/>
<input type="submit" value="Create"/>
{% else %}
{% make_button "Add Tag" "/tag/add" %}
{% make_button "Edit Tag" "/tag/%s/edit" tag.handle %}
{% make_button "Delete Tag" "/tag/%s/delete" tag.handle %}
{% make_button "Add Tag" "/tag/add" args %}
{% make_button "Edit Tag" "/tag/%s/edit" tag.handle args %}
{% make_button "Delete Tag" "/tag/%s/delete" tag.handle args %}
{% endifequal %}
{% endif %}
{% else %}

View File

@ -17,11 +17,11 @@
{% for tag in page.object_list %}
<tr class="{% cycle odd,even %}">
<td>{{ forloop.counter|row_count:page }}</td>
<td><a href="/{{view}}/{{tag.handle|escape}}" class="noThumb browsecell">
<td><a href="/{{view}}/{{tag.handle|escape}}{{args}}" class="noThumb browsecell">
<span class="grampsid">[{{tag.name}}]</span></a>
{% if user.is_authenticated %}
<td><a href="/{{view}}/{{tag.handle}}" class="browsecell">{{tag.color|nbsp}}</a></td>
<td><a href="/{{view}}/{{tag.handle}}" class="browsecell">{{tag.priority|nbsp}}</a></td>
<td><a href="/{{view}}/{{tag.handle}}{{args}}" class="browsecell">{{tag.color|nbsp}}</a></td>
<td><a href="/{{view}}/{{tag.handle}}{{args}}" class="browsecell">{{tag.priority|nbsp}}</a></td>
{% else %}
<td></td>
<td></td>
@ -32,7 +32,7 @@
</table>
{% if user.is_superuser %}
{% make_button "Add Tag" "/tag/add" %}
{% make_button "Add Tag" "/tag/add" args %}
{% endif %}
{% endblock %}

View File

@ -248,15 +248,20 @@ def build_search(request):
def make_button(text, url, *args):
newargs = []
kwargs = ""
last = ""
for arg in args:
if arg.startswith("?"):
if isinstance(arg, (str, unicode)) and arg.startswith("?"):
kwargs = arg
elif isinstance(arg, (str, unicode)) and arg.startswith("#"):
last = arg
elif arg == "":
pass
else:
newargs.append(arg)
url = url % tuple(newargs)
return mark_safe("""<input type="button" value="%s" onclick="document.location.href='%s%s'"/>""" % (text, url, kwargs))
if newargs:
url = url % tuple(newargs)
return mark_safe("""<input type="button" value="%s" onclick="document.location.href='%s%s%s'"/>""" %
(text, url, kwargs, last))
def event_table(obj, user, action, url, args):
retval = ""