Added date picker to "date made" on "add sandwich" template.
[~kgodey/maayanwich.git] / templates / sandwich.html
index 32a85ed..1b2b2fc 100644 (file)
@@ -1,11 +1,38 @@
-<html>
-       <head>
-               <title>Add a sandwich!</title></head>
-       <body>
-               <h1>Add a new sandwich</h1>
-               <form enctype="multipart/form-data" action="/addsandwich/" method="post">
-               {{ sform.as_p }}
-               <input type="submit" value="Submit" />
-               </form>
-       </body>
-</html>
\ No newline at end of file
+{% 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>
+<script type="text/javascript" src="http://127.0.0.1:8000/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="http://127.0.0.1:8000/sandwiches/jquery.datePicker.js"></script>
+<link rel="stylesheet" href="http://127.0.0.1:8000/sandwiches/token-input.css" type="text/css" />
+<link rel="stylesheet" href="http://127.0.0.1:8000/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 %}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>
+{% endblock %}
\ No newline at end of file