Ingredients auto complete, adding ingredients works. Some template tweaks.
[~kgodey/maayanwich.git] / templates / sandwich.html
index 1d650ea..e2acdbc 100644 (file)
@@ -1,11 +1,25 @@
 {% extends "base.html" %}
-
+{% block extrahead %}
+<script type="text/javascript" src="http://127.0.0.1:8000/sandwiches/jquery-1.4.2.min.js"></script>
+<script type="text/javascript" src="http://127.0.0.1:8000/sandwiches/jquery.tokeninput.js"></script>
+<link rel="stylesheet" href="http://127.0.0.1:8000/sandwiches/token-input.css" type="text/css" />
+<script type="text/javascript">
+$(document).ready(function () {
+  $("#id_ing").tokenInput("/ajaxfun/", {
+       hintText: "Type an ingredient!",
+       noResultsText: "No ingredients!",
+       searchingText: "Searching..."
+});
+});
+</script>
+{% endblock %}
 {% block title %}Add a sandwich{% endblock %}
 {% block content %}
        <h1 class="pagetitle">Add a new sandwich</h1>
        <span class="formspan">
        <form enctype="multipart/form-data" action="{% url add_sandwich %}" method="post" class="cssform">
        {{ sform.as_p }}
+       <p><label for="id_ing">Ingredients:</label> <input id="id_ing" type="text" name="ing"/></p>
        <input type="submit" value="Submit" />
        </form>
        </span>