Edit sandwich method added - not completely working yet. Adds a new sandwich instead...
[~kgodey/maayanwich.git] / templates / editsandwich.html
diff --git a/templates/editsandwich.html b/templates/editsandwich.html
new file mode 100644 (file)
index 0000000..f70bc85
--- /dev/null
@@ -0,0 +1,41 @@
+{% extends "base.html" %}
+{% block extrahead %}
+<script type="text/javascript" src="{{ media_url }}sandwiches/jquery-1.4.2.min.js"></script>
+<script type="text/javascript" src="{{ media_url }}sandwiches/jquery.tokeninput.js"></script>
+<script type="text/javascript" src="{{ media_url }}sandwiches/date.js"></script>
+<!--[if IE]><script type="text/javascript" src="http://127.0.0.1:8000/sandwiches/jquery.bgiframe.js"></script><![endif]-->
+<script type="text/javascript" src="{{ media_url }}sandwiches/jquery.datePicker.js"></script>
+<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..."
+});
+});
+</script>
+<script type="text/javascript">
+Date.firstDayOfWeek = 0;
+Date.format = 'yyyy-mm-dd';
+$(function()
+{
+       $('#id_date_made').datePicker({startDate:'1996-01-01'}).val(new Date().asString()).trigger('change');
+});
+</script>
+{% endblock %}
+{% block title %}Edit sandwich{% endblock %}
+{% block content %}
+       <h1 class="pagetitle">Edit sandwich</h1>
+       <span class="formspan">
+       <form enctype="multipart/form-data" action="{% url add_sandwich %}" method="post" class="cssform">
+       {{ sform.as_p }}
+       {% if s.picture %}
+               <img src="{{ s.picture.url }}" width=400px vspace=10px>
+       {% endif %}
+       <p><label for="id_ing">Ingredients:</label> <input id="id_ing" type="text" name="ing"/></p>
+       <input type="submit" value="Submit" />
+       </form>
+       </span>
+{% endblock %}
\ No newline at end of file