-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added search functions, but search results pagination not working
- Loading branch information
Your Name
committed
Jun 11, 2023
1 parent
de2db5f
commit 658b4e2
Showing
6 changed files
with
105 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{% extends "layout.html.twig" %} | ||
|
||
{% from 'macroses/_pagination.html.twig' import pagination %} | ||
|
||
{% block title %} | ||
Найденные статьи {{ posts.length }} | ||
{% endblock %} | ||
|
||
{% block style %} | ||
<style> | ||
.card\:hover:hover { | ||
background: var(--bs-primary); | ||
color: white; | ||
} | ||
</style> | ||
{% endblock %} | ||
|
||
|
||
{% block content %} | ||
<h2 class="mt-2 mb-4">Найденные статьи</h2> | ||
|
||
<div class="row row-cols-1 g-4"> | ||
{% if posts|length > 0 %} | ||
{% for post in posts %} | ||
<div class="col"> | ||
<a href="/post/{{ post.id }}"> | ||
<div class="card h-100 card:hover" title="Click to open post"> | ||
<!--<img src="..." class="card-img-top" alt="...">--> | ||
<div class="card-body"> | ||
<h5 class="card-title">{{ post.title }}</h5> | ||
<p class="card-text">{{ post.content }}</p> | ||
</div> | ||
<div class="card-footer d-flex justify-content-between"> | ||
<small class="text-muted">{{ post.created_at }}</small> | ||
<small class="text-muted">{{ post.vc }} views</small> | ||
</div> | ||
</div> | ||
</a> | ||
</div> | ||
{% endfor %} | ||
{% else %} | ||
<h4>No results</h4> | ||
{% endif %} | ||
</div> | ||
|
||
{% include 'parts/_paginator.html.twig' %} | ||
{% endblock %} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters