blog-browse #40

Merged
PlexSheep merged 17 commits from blog-browse into devel 2023-10-08 14:46:09 +02:00
1 changed files with 86 additions and 95 deletions
Showing only changes of commit 8ef158c034 - Show all commits

View File

@ -14,51 +14,36 @@
{% include 'nav.html' %}
{% endblock nav %}
{% block main %}
<div class="container">
<div class="row pb-5">
<div class="col">
<!-- <div class="position-absolute top-50 start-50 translate-middle"> -->
<h1 class="">
Browse
<!-- TODO: tell the user what the filters are? -->
</h1>
<!-- </div> -->
<div class="container-fluid">
<div class="row mb-5">
<div class="col col-xxl mb-5">
{# TODO: center in mobile view #}
<h1 class="display-1">Browse</h1>
</div>
<div class="col">
<form class="d-flex" role="search" action="" method="GET" novalidate>
<div class="container overflow-hidden ">
<div class="row gy-5">
<div class="col">
<input class="tagify" name="keywords" placeholder="{% trans "Keywords" %}">
</div>
<div class="col position-relative">
<div class="row">
<div class="col">
<div class="col-sm-3">
<div class="container-fluid w-100 h-100 p-2">
<form class="w-100 h-100" role="search" action="" method="GET" novalidate>
<div class="py-2">
<input type="search"
name="search"
class="form-control me-2 flex-fill"
class="form-control flex-fill py-2"
aria-label="Search"
placeholder="{% trans "Search" %}"
required=""
id="id_search">
<div class="col">
<div class="row mt-2">
<div class="col col-xxl">
<select class="form-select" aria-label="Large select example" name="category">
</div>
<div class="py-2">
<select class="form-select py-2"
aria-label="Large select example"
name="category">
<option value="" selected>{% trans "select category" %}</option>
{% for category in categories %}<option value="{{ category.slug }}">{{ category.name }}</option>{% endfor %}
</select>
</div>
<div class="col-md-auto">
<button class="btn bg-primary fw-bold" type="submit">{% trans "Filter" %}</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="py-2">
<input class="tagify" name="keywords" placeholder="{% trans "Keywords" %}">
</div>
<button class="btn bg-primary fw-bold py-2" type="submit">{% trans "Filter" %}</button>
<script>
// The DOM element you wish to replace with Tagify
var input = document.querySelector('input[class=tagify]');
@ -68,9 +53,12 @@
</form>
</div>
</div>
<div class="row row-cols-6 gap-1">
</div>
<div class="row mb-5">
<div class="container-fluid p-0 w-100 h-100">
<div class="row gap-3">
{% for post in posts %}
<div class="card col mx-auto my-2">
<div class="card col mx-auto my-2" style="min-width: 200px;">
<a class="text-reset link-offset-2 link-underline link-underline-opacity-0"
href=" {% url 'blog:post' post.category.slug post.slug %}">
<img src="{{ post.thumbnail.url }}"
@ -123,4 +111,7 @@
</div>
{% endfor %}
</div>
</div>
</div>
</div>
{% endblock main %}