Implement basic search

This commit is contained in:
Sascha Ißbrücker
2019-06-29 12:53:37 +02:00
parent 0177660cf6
commit 10b1570a64
4 changed files with 65 additions and 11 deletions

View File

@@ -1,10 +1,17 @@
{% extends "bookmarks/layout.html" %}
{% load shared %}
{% block content %}
<div>
<h2>Bookmarks</h2>
<a href="{% url 'bookmarks:new' %}">Add</a>
</div>
<div>
<form method="get">
<input type="search" name="q" placeholder="Search..." value="{{ query }}">
<input type="submit" value="Search">
</form>
</div>
<ul class="bookmark-list">
{% for bookmark in bookmarks %}
<li>
@@ -24,10 +31,10 @@
</ul>
<div class="pagination">
{% if bookmarks.has_next %}
<a href="?page={{ bookmarks.next_page_number }}">< Older</a>
<a href="?{% update_query_string page=bookmarks.next_page_number %}">< Older</a>
{% endif %}
{% if bookmarks.has_previous %}
<a href="?page={{ bookmarks.previous_page_number }}">Newer ></a>
<a href="?{% update_query_string page=bookmarks.previous_page_number %}">Newer ></a>
{% endif %}
</div>