WhisperMaPhone/templates/search/search.html

67 lines
2.4 KiB
HTML

{% extends "thoughts/page.html" %}
{% block title %}Search{% if query %} "{{ query }}"{% endif %}{% endblock %}
{% block navigation %}
<a class="text" href="/">Thoughts</a>
<a class="text" href="/about">About</a>{% if authenticated %}
<a class="text" href="/post">Post</a>{% endif %}
<h1 class="text" aria-current="page">Search</h1>
{% endblock %}
{% block main %}
<form method="get" action="search">
<table>
{{ form.as_table }}
<tr>
<td>&nbsp;</td>
<td>
<input type="submit" value="Search">
</td>
</tr>
</table>
{% if query %}
{% load tz %}
<h3>Results</h3>
{% for thought in page.object_list %}
<div class="thought" id="{{ thought.uuid }}">
<div class="main">
<span class="main-text text">{{ thought.object.text|urlize }}</span>
<a href="/?show={{thought.object.uuid}}" class="button show-more">Show</a>
</div>
<div class="thought-end">
<span class="timestamp">
{% timezone thought.object.get_timezone %}
{{ thought.object.posted|time:"g:i a" }}
{{ thought.object.posted|date:"M d, Y" }},
UTC{{ thought.object.get_offset_hours }}
{{ thought.object.get_season }}
{% endtimezone %}
</span>
</div>
<hr>
</div>
{% empty %}
<p>No results found.</p>
{% endfor %}
<!-- {% if page.has_previous or page.has_next %}
<div>
{% if page.has_previous %}<a href="?q={{ query }}&amp;page={{ page.previous_page_number }}">{% endif %}&laquo; Previous{% if page.has_previous %}</a>{% endif %}
|
{% if page.has_next %}<a href="?q={{ query }}&amp;page={{ page.next_page_number }}">{% endif %}Next &raquo;{% if page.has_next %}</a>{% endif %}
</div>
{% endif %} -->
{% else %}
{# Show some example queries to run, maybe query syntax, something else? #}
{% endif %}
</form>
{% endblock %}