add a template for a new input type class

This commit is contained in:
Victor Shnayder
2012-10-24 17:14:57 -04:00
parent d0a9b231a4
commit 0c6f6f873b

View File

@@ -1,3 +1,29 @@
# template:
'''
class ClassName(InputTypeBase):
"""
"""
template = "tagname.html"
tags = ['tagname']
def __init__(self, system, xml, state):
super(ClassName, self).__init__(system, xml, state)
def _get_render_context(self):
context = {'id': self.id,
}
return context
register_input_class(ClassName)
'''
#
# File: courseware/capa/inputtypes.py
#
@@ -366,6 +392,8 @@ class JavascriptInput(InputTypeBase):
register_input_class(JavascriptInput)
#-----------------------------------------------------------------------------
def textline(element, value, status, render_template, msg=""):
'''
Simple text line input, with optional size specification.
@@ -677,8 +705,8 @@ def imageinput(element, value, status, render_template, msg=''):
'src': src,
'gx': gx,
'gy': gy,
'state': status, # to change
'msg': msg, # to change
'state': status, # to change
'msg': msg, # to change
}
html = render_template("imageinput.html", context)
return etree.XML(html)