Skip to content

Commit

Permalink
Added new template.
Browse files Browse the repository at this point in the history
  • Loading branch information
Scylidose committed Mar 13, 2023
1 parent 9de508c commit 922987d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 13 deletions.
4 changes: 0 additions & 4 deletions website/atlasfind/templates/home.html

This file was deleted.

37 changes: 37 additions & 0 deletions website/atlasfind/templates/search.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{% extends "base.html" %}
{% block content %}
<div class="search-container">
<form action="{% url 'home' %}" method="GET">
<input class="search-box" type="text" name="search" placeholder="Search...">
<button id="search-button" class="search-btn" type="submit">Search</button>
</form>
</div>
<div class="search-results">
{% if results %}
<ul>
{% for result in results %}
<li>{{ result }}</li>
{% endfor %}
</ul>
{% else %}
<p>No results found.</p>
{% endif %}
</div>
<script>
$('#search-button').click(function(event) {
event.preventDefault();
var query = $('#search-box').val();
$.ajax({
url: 'http://localhost:8000/search/',
data: {
'query': query
},
success: function(data) {
$('.search-results').html(data);
$('.search-results').addClass('search-results');
$('.search-results').show();
}
});
});
</script>
{% endblock %}
9 changes: 0 additions & 9 deletions website/atlasfind/templates/search_results.html

This file was deleted.

0 comments on commit 922987d

Please sign in to comment.