The news archives and searching news is now operational. Next up, flatpages.
This commit is contained in:
parent
aad1d3d0c4
commit
762e0f83bc
3 changed files with 16 additions and 14 deletions
|
|
@ -16,7 +16,7 @@ sidebar = """
|
||||||
<p class='doNotDisplay doNotPrint'>This page’s menu:</p>
|
<p class='doNotDisplay doNotPrint'>This page’s menu:</p>
|
||||||
<ul id='side-bar'>
|
<ul id='side-bar'>
|
||||||
<li><a href='/news/archive'>News Archive</a></li>
|
<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>
|
</ul>
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
@ -51,6 +51,7 @@ def news_archive(request):
|
||||||
|
|
||||||
pagevars = {
|
pagevars = {
|
||||||
"page_title": "News Archive",
|
"page_title": "News Archive",
|
||||||
|
"browse_url": "/news/archive",
|
||||||
"sidebar": sidebar
|
"sidebar": sidebar
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -96,7 +97,8 @@ def search_results(request):
|
||||||
|
|
||||||
pagevars = {
|
pagevars = {
|
||||||
"page_title": "Search Results",
|
"page_title": "Search Results",
|
||||||
"searchtext": "search_terms="+ cleaned_get['search_terms'],
|
"searchtext": cleaned_get['search_terms'],
|
||||||
|
"browse_url": "/news/search/results",
|
||||||
"sidebar": sidebar
|
"sidebar": sidebar
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,11 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% 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 %}
|
{% if has_previous %}
|
||||||
<a href="/news/archive/?page={{previous}}">Prev</a>
|
<a href="{{browse_url}}/?page={{previous}}&search_terms={{searchtext|urlencode}}">Prev</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
Prev
|
Prev
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
@ -20,11 +20,11 @@
|
||||||
| <em>{{page}}</em> of <em>{{pages}}</em> pages |
|
| <em>{{page}}</em> of <em>{{pages}}</em> pages |
|
||||||
|
|
||||||
{% if has_next %}
|
{% if has_next %}
|
||||||
<a href="/news/archive/?page={{next}}">Next</a>
|
<a href="{{browse_url}}/?page={{next}}&search_terms={{searchtext|urlencode}}">Next</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
Next
|
Next
|
||||||
{% endif %}
|
{% 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 %}
|
{% for entry in object_list %}
|
||||||
<a href="/news/show/{{entry.id}}" class="newsHeading">{{entry.topic.name}}: {{entry.title}}</a>
|
<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>
|
<p class="newsSummary">{{entry.body|truncatewords:80}}</p>
|
||||||
{% endfor %}
|
{% 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 %}
|
{% if has_previous %}
|
||||||
<a href="/news/archive/?page={{previous}}">Prev</a>
|
<a href="{{browse_url}}/?page={{previous}}&search_terms={{searchtext|urlencode}}">Prev</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
Prev
|
Prev
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
@ -42,10 +42,10 @@
|
||||||
| <em>{{page}}</em> of <em>{{pages}}</em> pages |
|
| <em>{{page}}</em> of <em>{{pages}}</em> pages |
|
||||||
|
|
||||||
{% if has_next %}
|
{% if has_next %}
|
||||||
<a href="/news/archive/?page={{next}}">Next</a>
|
<a href="{{browse_url}}/?page={{next}}&search_terms={{searchtext|urlencode}}">Next</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
Next
|
Next
|
||||||
{% endif %}
|
{% endif %}
|
||||||
| <a href="/news/archive/?page={{pages}}&{{searchtext|urlencode}}">Last</a>
|
| <a href="{{browse_url}}/?page={{pages}}&search_terms={{searchtext|urlencode}}">Last</a>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
@ -10,10 +10,10 @@
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1 id="alt-layout">Search News</h1>
|
<h1 id="alt-layout">Search News</h1>
|
||||||
<p>Enter a search term or phrase to search by. Matches will be made against
|
<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">
|
<form method="GET">
|
||||||
{{search_form.as_p}}
|
{{search_form.search_terms}}
|
||||||
<button type="Submit">Submit</button>
|
<button type="Submit">Submit</button>
|
||||||
</form>
|
</form>
|
||||||
{{debug}}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue