Editing a sandwich works fully.
[~kgodey/maayanwich.git] / templates / editsandwich.html
index 912b6bb..b90b5aa 100644 (file)
@@ -8,11 +8,17 @@
 <link rel="stylesheet" href="{{ media_url }}sandwiches/token-input.css" type="text/css" />
 <link rel="stylesheet" href="{{ media_url }}sandwiches/datePicker.css" type="text/css" />
 <script type="text/javascript">
+
 $(document).ready(function () {
   $("#id_ing").tokenInput("/ajaxfun/", {
        hintText: "Type an ingredient!",
        noResultsText: "No ingredients!",
-       searchingText: "Searching..."
+       searchingText: "Searching...",
+       prePopulate: [
+               {% for i in prepop %}
+                       {id: '{{i.pk}}', name: '{{i.name}}' },
+               {% endfor %}
+               ]
 });
 });
 </script>