added input type
This commit is contained in:
@@ -624,3 +624,20 @@ def imageinput(element, value, status, render_template, msg=''):
|
||||
}
|
||||
html = render_template("imageinput.html", context)
|
||||
return etree.XML(html)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
@register_render_function
|
||||
def crystallography(element, value, status, render_template, msg=''):
|
||||
eid = element.get('id')
|
||||
height = element.get('height')
|
||||
width = element.get('width')
|
||||
display_file = element.get('display_file')
|
||||
context = {
|
||||
'id': eid,
|
||||
'width': width,
|
||||
'height': height,
|
||||
'display_file': display_file,
|
||||
}
|
||||
html = render_template("crystallography.html", context)
|
||||
return etree.XML(html)
|
||||
11
common/lib/capa/capa/templates/crystallography.html
Normal file
11
common/lib/capa/capa/templates/crystallography.html
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
|
||||
<section id="cryst_${id}" class="cryst" >
|
||||
<div id="holder" style="width:${width};height:${height}"></div>
|
||||
<div class="script_placeholder" data-src="/static/js/jquery.js"></div>
|
||||
<div class="script_placeholder" data-src="/static/js/raphael.js"></div><div class="script_placeholder" data-src="/static/js/sylvester.js"></div><div class="script_placeholder" data-src="/static/js/underscore-min.js"></div>
|
||||
<div class="script_placeholder" data-src="/static/js/${display_file}"></div>
|
||||
|
||||
<input type="hidden" name="answer_${id}" id="answer_${id}" class="asnwer"/>
|
||||
|
||||
</section>
|
||||
Reference in New Issue
Block a user