Use key.id_or_name in templates rather than key.name
This is to allow for usage of auto-id's.
Patch by: Sverre Rabbelier
--- a/app/soc/templates/soc/group_app/review.html Sat Apr 11 17:40:41 2009 +0000
+++ b/app/soc/templates/soc/group_app/review.html Sat Apr 11 22:57:23 2009 +0000
@@ -37,10 +37,10 @@
<tr>
<td>
{% block buttons %}
- <input type="button" onclick="location.href='/{{ entity_type_url|lower }}/review/{{ entity.key.name }}?status=accepted'" value="Accept"/>
- <input type="button" onclick="location.href='/{{ entity_type_url|lower }}/review/{{ entity.key.name }}?status=rejected'" value="Reject"/>
- <input type="button" onclick="location.href='/{{ entity_type_url|lower }}/review/{{ entity.key.name }}?status=ignored'" value="Ignore"/>
- <input type="button" onclick="location.href='/{{ entity_type_url|lower }}/delete/{{ entity.key.name }}'" value="Delete"/>
+ <input type="button" onclick="location.href='/{{ entity_type_url|lower }}/review/{{ entity.key.id_or_name }}?status=accepted'" value="Accept"/>
+ <input type="button" onclick="location.href='/{{ entity_type_url|lower }}/review/{{ entity.key.id_or_name }}?status=rejected'" value="Reject"/>
+ <input type="button" onclick="location.href='/{{ entity_type_url|lower }}/review/{{ entity.key.id_or_name }}?status=ignored'" value="Ignore"/>
+ <input type="button" onclick="location.href='/{{ entity_type_url|lower }}/delete/{{ entity.key.id_or_name }}'" value="Delete"/>
{% endblock buttons %}
</td>
</tr>
--- a/app/soc/templates/soc/models/admin.html Sat Apr 11 17:40:41 2009 +0000
+++ b/app/soc/templates/soc/models/admin.html Sat Apr 11 22:57:23 2009 +0000
@@ -25,7 +25,7 @@
<td colspan="4"> </td>
</tr>
<td>
- <input type="button" onclick="location.href='/{{ entity_type_url|lower }}/export/{{ entity.key.name }}'" value="Export"/>
+ <input type="button" onclick="location.href='/{{ entity_type_url|lower }}/export/{{ entity.key.id_or_name }}'" value="Export"/>
</td>
</tr>
</table>
--- a/app/soc/templates/soc/models/edit.html Sat Apr 11 17:40:41 2009 +0000
+++ b/app/soc/templates/soc/models/edit.html Sat Apr 11 22:57:23 2009 +0000
@@ -17,7 +17,7 @@
{% block header_title %}
{{ page_name }}
{% if entity %}
- <a href="/{{ entity_type_url|lower }}/show/{{ entity.key.name }}"
+ <a href="/{{ entity_type_url|lower }}/show/{{ entity.key.id_or_name }}"
>{% if entity.name %}{{ entity.name }} {% endif %}(public view)</a>
{% endif %}
{% endblock %}
--- a/app/soc/templates/soc/org_app/review.html Sat Apr 11 17:40:41 2009 +0000
+++ b/app/soc/templates/soc/org_app/review.html Sat Apr 11 22:57:23 2009 +0000
@@ -33,7 +33,7 @@
{% endblock %}
{% block buttons %}
- <input type="button" onclick="location.href='/{{ entity_type_url|lower }}/review/{{ entity.key.name }}?status=pre-accepted'" value="Pre-Accept"/>
- <input type="button" onclick="location.href='/{{ entity_type_url|lower }}/review/{{ entity.key.name }}?status=pre-rejected'" value="Pre-Reject"/>
+ <input type="button" onclick="location.href='/{{ entity_type_url|lower }}/review/{{ entity.key.id_or_name }}?status=pre-accepted'" value="Pre-Accept"/>
+ <input type="button" onclick="location.href='/{{ entity_type_url|lower }}/review/{{ entity.key.id_or_name }}?status=pre-rejected'" value="Pre-Reject"/>
{{ block.super }}
{% endblock buttons %}
--- a/app/soc/templates/soc/organization/public.html Sat Apr 11 17:40:41 2009 +0000
+++ b/app/soc/templates/soc/organization/public.html Sat Apr 11 22:57:23 2009 +0000
@@ -17,7 +17,7 @@
{% block header_title %}
{{ page_name }} for {{ entity.name }}
{% if entity.home %}
-<a href="/{{ entity_type_url }}/home/{{ entity.key.name }}">(Home Page)</a>
+<a href="/{{ entity_type_url }}/home/{{ entity.key.id_or_name }}">(Home Page)</a>
{% endif %}
{% endblock %}
--- a/app/soc/templates/soc/presence/home.html Sat Apr 11 17:40:41 2009 +0000
+++ b/app/soc/templates/soc/presence/home.html Sat Apr 11 22:57:23 2009 +0000
@@ -52,7 +52,7 @@
{{ home_document.content|safe }}
{% else %}
{% block missing_doc %}
-This is the default home page, it can be edited via <a href="/{{ entity_type_url|lower }}/edit/{{ entity.key.name }}">Edit {{ entity_type }} Settings</a>.<br />
+This is the default home page, it can be edited via <a href="/{{ entity_type_url|lower }}/edit/{{ entity.key.id_or_name }}">Edit {{ entity_type }} Settings</a>.<br />
{% endblock %}
{% endif %}
{% if entity.feed_url %}
--- a/app/soc/templates/soc/presence/public.html Sat Apr 11 17:40:41 2009 +0000
+++ b/app/soc/templates/soc/presence/public.html Sat Apr 11 22:57:23 2009 +0000
@@ -23,11 +23,11 @@
<table>
{% readonly_field_as_table_row entity.fields.link_id.label entity.link_id %}
{% if entity.home %}
- {% readonly_field_as_table_row entity.fields.home.label entity.home.key.name %}
+ {% readonly_field_as_table_row entity.fields.home.label entity.home.key.id_or_name %}
{% endif %}
{% readonly_url_field_as_table_row entity.fields.feed_url.label entity.feed_url %}
{% if entity.tos %}
- {% readonly_field_as_table_row entity.fields.tos.label entity.tos.key.name %}
+ {% readonly_field_as_table_row entity.fields.tos.label entity.tos.key.id_or_name %}
{% endif %}
<!-- TODO(pawel.solyga) make this generic -->
</table>
--- a/app/soc/templates/soc/site/public.html Sat Apr 11 17:40:41 2009 +0000
+++ b/app/soc/templates/soc/site/public.html Sat Apr 11 22:57:23 2009 +0000
@@ -23,11 +23,11 @@
<table>
{% readonly_field_as_table_row entity.fields.link_id.label entity.link_id %}
{% if entity.home %}
- {% readonly_field_as_table_row entity.fields.home.label entity.home.key.name %}
+ {% readonly_field_as_table_row entity.fields.home.label entity.home.key.id_or_name %}
{% endif %}
{% readonly_field_as_table_row entity.fields.feed_url.label entity.feed_url %}
{% if entity.tos %}
- {% readonly_field_as_table_row entity.fields.tos.label entity.tos.key.name %}
+ {% readonly_field_as_table_row entity.fields.tos.label entity.tos.key.id_or_name %}
{% endif %}
{% readonly_field_as_table_row entity.fields.ga_tracking_num.label entity.ga_tracking_num %}
{% readonly_field_as_table_row entity.fields.gmaps_api_key.label entity.gmaps_api_key %}