# HG changeset patch # User Sverre Rabbelier # Date 1229172529 0 # Node ID 602c2b2f4d8b73ed597f000081e16b0326eec2c3 # Parent ddf44af087a08445839def09aaadf239ae847faa Added a readonly_multiline_field_as_table_row tag This is useful when a field is allowed to include newlines. Patch by: Sverre Rabbelier diff -r ddf44af087a0 -r 602c2b2f4d8b app/soc/templates/soc/templatetags/_readonly_multiline_field_as_table_row.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/templates/soc/templatetags/_readonly_multiline_field_as_table_row.html Sat Dec 13 12:48:49 2008 +0000 @@ -0,0 +1,21 @@ +{% 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 %} + + + {{ field_label }}: + + + {{ field_value|linebreaks }} + + diff -r ddf44af087a0 -r 602c2b2f4d8b app/soc/views/helper/templatetags/forms_helpers.py --- a/app/soc/views/helper/templatetags/forms_helpers.py Sat Dec 13 11:02:08 2008 +0000 +++ b/app/soc/views/helper/templatetags/forms_helpers.py Sat Dec 13 12:48:49 2008 +0000 @@ -90,3 +90,10 @@ return {'field_label': field_label, 'field_value': field_value} + +@register.inclusion_tag('soc/templatetags/_readonly_multiline_field_as_table_row.html') +def readonly_multiline_field_as_table_row(field_label, field_value): + """See readonly_field_as_table_row, but with a different template tag + """ + return {'field_label': field_label, + 'field_value': field_value}