summaryrefslogtreecommitdiff
path: root/ishtar_common/templates
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2013-09-02 17:50:39 +0200
committerÉtienne Loks <etienne.loks@peacefrogs.net>2013-09-02 17:50:39 +0200
commit0ab4b22639c1c513f3cbe9e5d5d5cabf8bd9e58d (patch)
treebfa150ec22bc3ecb0232345de8b51c139555a305 /ishtar_common/templates
parent1018402b846572b2bc348c0e6e0865527915afdb (diff)
downloadIshtar-0ab4b22639c1c513f3cbe9e5d5d5cabf8bd9e58d.tar.bz2
Ishtar-0ab4b22639c1c513f3cbe9e5d5d5cabf8bd9e58d.zip
Widget: use a template for SquareMeterWidget
Diffstat (limited to 'ishtar_common/templates')
-rw-r--r--ishtar_common/templates/blocks/SquareMeterWidget.html14
1 files changed, 14 insertions, 0 deletions
diff --git a/ishtar_common/templates/blocks/SquareMeterWidget.html b/ishtar_common/templates/blocks/SquareMeterWidget.html
new file mode 100644
index 000000000..4302ee234
--- /dev/null
+++ b/ishtar_common/templates/blocks/SquareMeterWidget.html
@@ -0,0 +1,14 @@
+<input class="area_widget" type="text"{{final_attrs}}> {{unit}} (<span id="ha_{{id}}">0</span> ha)
+<script type="text/javascript"><!--//
+ function evaluate_{{safe_id}}(){
+ value = parseFloat($("#{{id}}").val());
+ if(!isNaN(value)){
+ value = value/10000;
+ } else {
+ value = 0;
+ }
+ $("#ha_{{id}}").html(value);
+ }
+ $("#{{id}}").keyup(evaluate_{{safe_id}});
+ $(document).ready(evaluate_{{safe_id}}());
+//--></script>