testappproj/templates/code.html
changeset 0 0b061d58aea3
child 1 0eda880b3d25
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testappproj/templates/code.html	Mon May 17 22:33:59 2010 +0530
@@ -0,0 +1,42 @@
+{# {%extends "base.html"%} #}
+{%block body%}
+<h2>{{ problem.name }}</h2>
+
+ 
+{% comment %}
+{% load pykata_extras %}
+{% autoescape off %}
+<p>
+{{problem.description|force_escape|spacify_code|linebreaksbr}}
+</p>
+{% endautoescape %}
+{% endcomment %}
+
+<h3>Examples</h3>
+<pre>
+{{ problem.examples }}
+</pre>
+
+  <form method="post" action="/run/">
+    <p><strong>Enter your solution here:</strong></p>
+    <p><textarea id="code-area" name="user_code" rows="22" cols="80">
+{% ifequal pu.classname "ProblemUser" %}{{ pu.solution }}{% else %}{{ problem.skeleton }}{% endifequal %}
+
+    </textarea></p>
+    <input type="hidden" name="problem_id" value="{{ problem.key.id }}" />
+    <p><input type="submit" name="submit" value="Run" /></p>
+  </form>
+
+  <script language="javascript" type="text/javascript" src="/static/edit_area_full.js"></script>
+  <script language="javascript" type="text/javascript">
+    editAreaLoader.init({
+      id: "code-area",
+      syntax: "python",
+      start_highlight: true,
+      allow_resize: "both",
+      font_size: 14,
+      toolbar: "new_document, select_font, |, help",
+      replace_tab_by_spaces: 4
+    });
+  </script>
+{%endblock%}