{% extends 'base.html' %}

{% block content %}
	<h1 align="center">Scruffy Search Engine<h1>
	<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2" crossorigin="anonymous"></script>
	<div class="d-flex justify-content-center">
		<form method="post" action="/">

			<button align="center" type="submit" value ="start" name="start-index" class="btn btn-outline-primary">Run Indexer</button>
	</div>
	<div class="d-flex justify-content-center">
		<img src="https://theinfosphere.org/images/9/96/Scruffy_promo.jpg" class="img-fluid">

	</div>
	<div class="d-flex justify-content-center input-group mb-3">
		<form method='POST' action=" {{ url_for('index') }} " enctype="multipart/form-data">
			<input type="text" class="form-control" placeholder="Search Query" aria-label="Search Query" aria-describedby="basic-addon1" name='search_query'>
			<button type="submit" name="start-index" class="btn btn-primary">Search</button>
		</form>
	</div>

	{% for result in results %}
		<p>{{result[0]}} at <a href="{{result[1]}}">{{result[1]}}</a></p>
	{% endfor %}
{% endblock %}