{% extends "base.html" %}

{% block title %}
{% if search %}
	Results for "{{ search }}"
{% else %}
	Search
{% endif %}
{% endblock title %}

{% block content %}
<div class="row">
	<div class="span8 offset1">
		<form class="form-inline well" method="POST">
			{{ form.hidden_tag() }}
			{{ form.term(placeholder='Search for.. (regex accepted)', autocomplete="off") }}
            {{ form.ignore_case() }} Ignore Case
			<input type="submit" class="btn btn-success pull-right" value="Search!">
		</form>
	</div>
</div>

{% if search %}
	{% if results %}
		<ul>
			{% for result in results %}
				<li><a href="{{ url_for('wiki.display', url=result.url) }}">{{ result.title }}</a></li>
			{% endfor %}
		</ul>
	{% else %}
		<p>No results for your search.</p>
	{% endif %}
{% endif %}
{% endblock content %}
