From 708c11a1ea66dd959497d1670142b6f00f1bcb6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80?= Date: Tue, 9 Oct 2012 19:13:54 +0300 Subject: [PATCH] added input type --- common/lib/capa/capa/inputtypes.py | 17 +++++++++++++++++ .../capa/capa/templates/crystallography.html | 11 +++++++++++ 2 files changed, 28 insertions(+) create mode 100644 common/lib/capa/capa/templates/crystallography.html diff --git a/common/lib/capa/capa/inputtypes.py b/common/lib/capa/capa/inputtypes.py index 466adcbf01..41b98eacae 100644 --- a/common/lib/capa/capa/inputtypes.py +++ b/common/lib/capa/capa/inputtypes.py @@ -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) \ No newline at end of file diff --git a/common/lib/capa/capa/templates/crystallography.html b/common/lib/capa/capa/templates/crystallography.html new file mode 100644 index 0000000000..104092a2ca --- /dev/null +++ b/common/lib/capa/capa/templates/crystallography.html @@ -0,0 +1,11 @@ + + +
+
+
+
+
+ + + +