add "msg" output to textline

This commit is contained in:
ichuang
2012-05-27 21:12:54 -04:00
parent b487003de7
commit 7a27a97899
2 changed files with 4 additions and 1 deletions

View File

@@ -208,7 +208,7 @@ def textline(element, value, state, msg=""):
eid=element.get('id')
count = int(eid.split('_')[-2])-1 # HACK
size = element.get('size')
context = {'id':eid, 'value':value, 'state':state, 'count':count, 'size': size}
context = {'id':eid, 'value':value, 'state':state, 'count':count, 'size': size, 'msg': msg}
html=render_to_string("textinput.html", context)
return etree.XML(html)

View File

@@ -16,4 +16,7 @@
% elif state == 'incomplete':
<span class="incorrect" id="status_${id}"></span>
% endif
% if msg:
<span class="message">${msg|n}</span>
% endif
</section>