ittech/w12/views/search.twig
2022-05-16 01:28:21 +07:00

50 lines
No EOL
1.5 KiB
Twig
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
#imageDrop {
display: flex;
align-content: center;
justify-content: center;
align-items: center;
height: 5rem;
border: 0.2rem dashed gray;
border-radius: 1rem;
}
</style>
</head>
<body>
<b>{{user.login}}</b> что-то ищет 🤔 <a href="/">На главную</a>
<hr>
<form action="/search" method="get">
<input type="text" name="search" placeholder="Поиск..." value="{{search}}">
<select name="author">
<option value="-1">Все авторы</option>
{% for item in authors %}
<option value="{{item.id}}" {% if item.id == author %}selected{% endif %}>{{item.login}}</option>
{% endfor %}
</select>
<input type="submit" value="Найти">
</form>
{% if images %}
<b>Результаты поиска:</b>
<div class="images">
{% for image in images %}
<a href="image/{{image.id}}">
<img src="/images?filename={{image.filename}}" alt="{{image.filename}}">
</a>
{% else %}
<p>Пусто</p>
{% endfor %}
{% else %}
<p>Пусто</p>
{% endif %}
</div>
</body>
</html>