# HG changeset patch # User Sverre Rabbelier # Date 1237586382 0 # Node ID 96e45d34ee715d6ebf4c8ca797207922db11ac52 # Parent 81a5926b6109113578e9d555d3e975e0a8a4df3e Added an as_user template tag Patch by: Sverre Rabbelier diff -r 81a5926b6109 -r 96e45d34ee71 app/soc/templates/soc/templatetags/_as_user.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/templates/soc/templatetags/_as_user.html Fri Mar 20 21:59:42 2009 +0000 @@ -0,0 +1,15 @@ +{% comment %} +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +{% endcomment %} + +{{ user }} diff -r 81a5926b6109 -r 96e45d34ee71 app/soc/views/helper/templatetags/forms_helpers.py --- a/app/soc/views/helper/templatetags/forms_helpers.py Fri Mar 20 21:27:39 2009 +0000 +++ b/app/soc/views/helper/templatetags/forms_helpers.py Fri Mar 20 21:59:42 2009 +0000 @@ -40,6 +40,14 @@ register = template.Library() +@register.inclusion_tag('soc/templatetags/_as_user.html') +def as_user(user): + """Prints a user as a hyperlinked link_id. + """ + + return {'user': user} + + @register.inclusion_tag('soc/templatetags/_field_as_table_row.html') def field_as_table_row(field): """Prints a newforms field as a table row.