This commit is contained in:
unknown 2011-10-05 07:54:37 -04:00
commit da64b246d6
7 changed files with 20 additions and 2 deletions

View File

@ -2,3 +2,4 @@
-e bzr+http://code.0xdb.org/python-ox/#egg=python-ox
django_extensions
South
pYsearch

View File

@ -1,5 +1,10 @@
# Create your views here.
from django.shortcuts import render_to_response
from ox.django.shortcuts import render_to_json_response
def index(request):
return render_to_response("home.html", {})
def search(request):
d = {}
return render_to_json_response(d)

View File

@ -103,6 +103,8 @@ INSTALLED_APPS = (
# 'django.contrib.admindocs',
)
YAHOO_APP_ID = 'kLiikCPV34F1hM9x12wGnAzgjAFYXHzb89Tf4_kIirXZDPRa3WwfRGkZsA3TfG3ohw--'
try:
from local_settings import *
except:

9
trubox/static/js/home.js Normal file
View File

@ -0,0 +1,9 @@
$(function() {
$('#searchForm').submit(function(e) {
e.preventDefault();
var q = $('#search').val();
$.getJSON("/search/", {'q': q}, function(data) {
console.log(data);
});
});
});

View File

@ -22,7 +22,7 @@
<div class="header">
<a href="#">
<img src="/static/images/truboxx-logo.png" alt="trubox-logo" width="280" height="78" id="logo"></a>
<form action="" method="get">
<form action="" id="searchForm" method="get">
<input type="text" placeholder="search for a gadget" name="field" id="search"/>
</form>

View File

@ -5,7 +5,7 @@
{% block extra_head %}
<link rel="stylesheet" href="/static/css/slider.css" type="text/css" />
<script type="text/javascript" src="/static/js/jquery.tinycarousel.min.js"></script>
<script type="text/javascript" src="/static/js/home.js"></script>
<script type="text/javascript">
$(document).ready(function(){

View File

@ -12,6 +12,7 @@ urlpatterns = patterns('',
# Example:
# (r'^trubox/', include('trubox.foo.urls')),
(r'^$', 'deals.views.index'),
(r'^search/$', 'deals.views.search'),
# Uncomment the admin/doc line below to enable admin documentation:
(r'^admin/doc/', include('django.contrib.admindocs.urls')),