Editing a sandwich works fully.
[~kgodey/maayanwich.git] / templates / editsandwich.html
1 {% extends "base.html" %}
2 {% block extrahead %}
3 <script type="text/javascript" src="{{ media_url }}sandwiches/jquery-1.4.2.min.js"></script>
4 <script type="text/javascript" src="{{ media_url }}sandwiches/jquery.tokeninput.js"></script>
5 <script type="text/javascript" src="{{ media_url }}sandwiches/date.js"></script>
6 <!--[if IE]><script type="text/javascript" src="http://127.0.0.1:8000/sandwiches/jquery.bgiframe.js"></script><![endif]-->
7 <script type="text/javascript" src="{{ media_url }}sandwiches/jquery.datePicker.js"></script>
8 <link rel="stylesheet" href="{{ media_url }}sandwiches/token-input.css" type="text/css" />
9 <link rel="stylesheet" href="{{ media_url }}sandwiches/datePicker.css" type="text/css" />
10 <script type="text/javascript">
11
12 $(document).ready(function () {
13   $("#id_ing").tokenInput("/ajaxfun/", {
14         hintText: "Type an ingredient!",
15         noResultsText: "No ingredients!",
16         searchingText: "Searching...",
17         prePopulate: [
18                 {% for i in prepop %}
19                         {id: '{{i.pk}}', name: '{{i.name}}' },
20                 {% endfor %}
21                 ]
22 });
23 });
24 </script>
25 <script type="text/javascript">
26 Date.firstDayOfWeek = 0;
27 Date.format = 'yyyy-mm-dd';
28 $(function()
29 {
30         $('#id_date_made').datePicker({startDate:'1996-01-01'}).val(new Date().asString()).trigger('change');
31 });
32 </script>
33 {% endblock %}
34 {% block title %}Edit sandwich{% endblock %}
35 {% block content %}
36         <h1 class="pagetitle">Edit sandwich</h1>
37         <span class="formspan">
38         <form enctype="multipart/form-data" action="{% url edit_sandwich slug=s.slug %}" method="post" class="cssform">
39         {{ sform.as_p }}
40         {% if s.picture %}
41                 <img src="{{ s.picture.url }}" width=400px vspace=10px>
42         {% endif %}
43         <p><label for="id_ing">Ingredients:</label> <input id="id_ing" type="text" name="ing"/></p>
44         <input type="submit" value="Submit" />
45         </form>
46         </span>
47 {% endblock %}