Permalink
Browse files

start of search frontend

  • Loading branch information...
1 parent f022e70 commit 6dcc8d04e6bb5c1c7cb0017a19050f9abc365999 @seanmonstar seanmonstar committed Apr 8, 2011
View
11 apps/search/templates/_package_result.html
@@ -0,0 +1,11 @@
+<div class="result package">
+ <h3>
+ {{ package.full_name }}
+ <span>by {{ package.author }}</span>
+ </h3>
+ <p>{{ package.description }}</p>
+ <div class="actions">
+
+ <a href="#">Source</a>
+ </div>
+</div>
View
8 apps/search/templates/_search_form.html
@@ -0,0 +1,8 @@
+<form id="Search" method="get" action="{% url search_results %}">
+ <fieldset>
+ <label>
+ <span>Search for</span>
+ <input type="search" name="q" placeholder="Search term" />
+ </label>
+ </fieldset>
+</form>
View
13 apps/search/templates/results.html
@@ -0,0 +1,13 @@
+{% extends "base.html" %}
+{% block head %}
+<link rel="stylesheet" type="text/css" href="/media/search/css/Search.css" />
+{% endblock %}
+{% block app_body %}
+ {% include "_search_form.html" %}
+{% endblock %}
+{% block app_content %}
+<h2 class="UI_Heading">Results</h2>
+{# for package in results %}
+
+{% endfor #}
+{% endblock %}
View
5 apps/search/urls.py
@@ -0,0 +1,5 @@
+from django.conf.urls.defaults import url, patterns
+
+urlpatterns = patterns('search.views',
+ url(r'^$', 'results', name='search_results')
+)
View
12 apps/search/views.py
@@ -0,0 +1,12 @@
+from django.shortcuts import render_to_response
+from django.template import RequestContext
+
+def results(r):
+ search_term = r.GET.get('q')
+ results = []
+ if search_term:
+ pass
+
+ return render_to_response('results.html', {
+ 'results': results,
+ }, context_instance=RequestContext(r))
View
15 media/search/css/Search.css
@@ -0,0 +1,15 @@
+#Search {
+ padding:5px;
+}
+ #Search input {
+ display:block;
+ border:1px solid #ccc;
+ width:60%;
+ height:20px;
+ }
+
+ #Search label span {
+ float:left;
+ display:block;
+ padding:5px;
+ }
View
3 urls.py
@@ -36,6 +36,9 @@
# Person
(r'^user/', include('person.urls')),
+ # Search
+ (r'^search/', include('search.urls')),
+
# Jetpack
(r'', include('jetpack.urls')),

0 comments on commit 6dcc8d0

Please sign in to comment.