mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-06 09:57:57 +00:00
Allow the use of HTML in form field help texts
Also make the help text show under the field itself for regular fields, and in the left column only for textarea fields. This makes it possible to use longer help texts without making things look really bad...
This commit is contained in:
@ -7,3 +7,7 @@ register = template.Library()
|
||||
def hidemail(value):
|
||||
return value.replace('@', ' at ')
|
||||
|
||||
@register.filter(name='class_name')
|
||||
def class_name(ob):
|
||||
return ob.__class__.__name__
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
{%extends "base/page.html"%}
|
||||
{%load pgfilters%}
|
||||
{%block title%}{{operation|default:"Edit"}} {{formitemtype}}{%endblock%}
|
||||
{%block contents%}
|
||||
<h1>{{operation|default:"Edit"}} {{formitemtype}}</h1>
|
||||
@ -22,10 +23,17 @@
|
||||
</tr>
|
||||
{%endif%}
|
||||
<tr {%if field.errors%}class="errorinfo"{%endif%}>
|
||||
<th>{{field.label_tag}}{%if field.help_text %}<br/>
|
||||
<span class="formfieldhelp">{{field.help_text}}</span>{%endif%}</th>
|
||||
<th>{{field.label_tag}}{%if field.help_text%}{%if field.field.widget|class_name == "Textarea"%}<br/>
|
||||
<span class="formfieldhelp">{{field.help_text|safe}}</span>{%endif%}{%endif%}
|
||||
</th>
|
||||
<td>{{field}}</td>
|
||||
</tr>
|
||||
{%if field.help_text %}{%if field.field.widget|class_name != "Textarea"%}
|
||||
<tr>
|
||||
<th></th>
|
||||
<td><span class="formfieldhelp">{{field.help_text|safe}}</span></td>
|
||||
</tr>
|
||||
{%endif%}{%endif%}
|
||||
{%endfor%}
|
||||
</table>
|
||||
<input type="submit" value="{{savebutton|default:"Save"}}" />
|
||||
|
Reference in New Issue
Block a user