The news archives and searching news is now operational. Next up, flatpages.

This commit is contained in:
Greg Taylor 2007-07-31 14:59:00 +00:00
parent aad1d3d0c4
commit 762e0f83bc
3 changed files with 16 additions and 14 deletions

View file

@ -16,7 +16,7 @@ sidebar = """
<p class='doNotDisplay doNotPrint'>This page&rsquo;s menu:</p>
<ul id='side-bar'>
<li><a href='/news/archive'>News Archive</a></li>
<li><a href='/tbi'>Search News</a></li>
<li><a href='/news/search'>Search News</a></li>
</ul>
"""
@ -51,6 +51,7 @@ def news_archive(request):
pagevars = {
"page_title": "News Archive",
"browse_url": "/news/archive",
"sidebar": sidebar
}
@ -96,7 +97,8 @@ def search_results(request):
pagevars = {
"page_title": "Search Results",
"searchtext": "search_terms="+ cleaned_get['search_terms'],
"searchtext": cleaned_get['search_terms'],
"browse_url": "/news/search/results",
"sidebar": sidebar
}

View file

@ -8,11 +8,11 @@
{% endblock %}
{% block content %}
<h1 id="alt-layout">News Archive</h1>
<h1 id="alt-layout">{{page_title}}</h1>
<strong>Navigation:</strong> <a href="/news/archive/?page=1">First</a> |
<strong>Navigation:</strong> <a href="{{browse_url}}/?page=1&search_terms={{searchtext|urlencode}}">First</a> |
{% if has_previous %}
<a href="/news/archive/?page={{previous}}">Prev</a>
<a href="{{browse_url}}/?page={{previous}}&search_terms={{searchtext|urlencode}}">Prev</a>
{% else %}
Prev
{% endif %}
@ -20,11 +20,11 @@
| <em>{{page}}</em> of <em>{{pages}}</em> pages |
{% if has_next %}
<a href="/news/archive/?page={{next}}">Next</a>
<a href="{{browse_url}}/?page={{next}}&search_terms={{searchtext|urlencode}}">Next</a>
{% else %}
Next
{% endif %}
| <a href="/news/archive/?page={{pages}}">Last</a>
| <a href="{{browse_url}}/?page={{pages}}&search_terms={{searchtext|urlencode}}">Last</a>
{% for entry in object_list %}
<a href="/news/show/{{entry.id}}" class="newsHeading">{{entry.topic.name}}: {{entry.title}}</a>
@ -32,9 +32,9 @@
<p class="newsSummary">{{entry.body|truncatewords:80}}</p>
{% endfor %}
<strong>Navigation:</strong> <a href="/news/archive/?page=1">First</a> |
<strong>Navigation:</strong> <a href="{{browse_url}}/?page=1&search_terms={{searchtext|urlencode}}">First</a> |
{% if has_previous %}
<a href="/news/archive/?page={{previous}}">Prev</a>
<a href="{{browse_url}}/?page={{previous}}&search_terms={{searchtext|urlencode}}">Prev</a>
{% else %}
Prev
{% endif %}
@ -42,10 +42,10 @@
| <em>{{page}}</em> of <em>{{pages}}</em> pages |
{% if has_next %}
<a href="/news/archive/?page={{next}}">Next</a>
<a href="{{browse_url}}/?page={{next}}&search_terms={{searchtext|urlencode}}">Next</a>
{% else %}
Next
{% endif %}
| <a href="/news/archive/?page={{pages}}&{{searchtext|urlencode}}">Last</a>
| <a href="{{browse_url}}/?page={{pages}}&search_terms={{searchtext|urlencode}}">Last</a>
{% endblock %}

View file

@ -10,10 +10,10 @@
{% block content %}
<h1 id="alt-layout">Search News</h1>
<p>Enter a search term or phrase to search by. Matches will be made against
news titles and their contents.</p>
news titles and their contents. Searches must be at least three characters
long.</p>
<form method="GET">
{{search_form.as_p}}
{{search_form.search_terms}}
<button type="Submit">Submit</button>
</form>
{{debug}}
{% endblock %}