merged
This commit is contained in:
commit
da64b246d6
|
@ -2,3 +2,4 @@
|
||||||
-e bzr+http://code.0xdb.org/python-ox/#egg=python-ox
|
-e bzr+http://code.0xdb.org/python-ox/#egg=python-ox
|
||||||
django_extensions
|
django_extensions
|
||||||
South
|
South
|
||||||
|
pYsearch
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
# Create your views here.
|
# Create your views here.
|
||||||
from django.shortcuts import render_to_response
|
from django.shortcuts import render_to_response
|
||||||
|
from ox.django.shortcuts import render_to_json_response
|
||||||
|
|
||||||
def index(request):
|
def index(request):
|
||||||
return render_to_response("home.html", {})
|
return render_to_response("home.html", {})
|
||||||
|
|
||||||
|
def search(request):
|
||||||
|
d = {}
|
||||||
|
return render_to_json_response(d)
|
||||||
|
|
|
@ -103,6 +103,8 @@ INSTALLED_APPS = (
|
||||||
# 'django.contrib.admindocs',
|
# 'django.contrib.admindocs',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
YAHOO_APP_ID = 'kLiikCPV34F1hM9x12wGnAzgjAFYXHzb89Tf4_kIirXZDPRa3WwfRGkZsA3TfG3ohw--'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from local_settings import *
|
from local_settings import *
|
||||||
except:
|
except:
|
||||||
|
|
9
trubox/static/js/home.js
Normal file
9
trubox/static/js/home.js
Normal 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);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -22,7 +22,7 @@
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<a href="#">
|
<a href="#">
|
||||||
<img src="/static/images/truboxx-logo.png" alt="trubox-logo" width="280" height="78" id="logo"></a>
|
<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"/>
|
<input type="text" placeholder="search for a gadget" name="field" id="search"/>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
{% block extra_head %}
|
{% block extra_head %}
|
||||||
<link rel="stylesheet" href="/static/css/slider.css" type="text/css" />
|
<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/jquery.tinycarousel.min.js"></script>
|
||||||
|
<script type="text/javascript" src="/static/js/home.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ urlpatterns = patterns('',
|
||||||
# Example:
|
# Example:
|
||||||
# (r'^trubox/', include('trubox.foo.urls')),
|
# (r'^trubox/', include('trubox.foo.urls')),
|
||||||
(r'^$', 'deals.views.index'),
|
(r'^$', 'deals.views.index'),
|
||||||
|
(r'^search/$', 'deals.views.search'),
|
||||||
# Uncomment the admin/doc line below to enable admin documentation:
|
# Uncomment the admin/doc line below to enable admin documentation:
|
||||||
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
|
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user