2019-02-09 11:32:08 +01:00
|
|
|
{% extends "base/base.html" %}
|
2023-08-09 18:26:38 +02:00
|
|
|
{% import "widgets/pagination.html" as widget_pagination with context %}
|
2019-02-03 14:57:30 +01:00
|
|
|
|
2023-06-06 22:27:17 +02:00
|
|
|
{% set tabtitle = "Recherche avancée" %}
|
|
|
|
|
2019-02-03 14:57:30 +01:00
|
|
|
{% block content %}
|
2023-09-05 21:46:57 +02:00
|
|
|
<section class="search-page">
|
2019-02-03 16:20:05 +01:00
|
|
|
<h1>Recherche avancée</h1>
|
2019-02-03 14:57:30 +01:00
|
|
|
|
2023-09-21 14:49:44 +02:00
|
|
|
<form class="form" action="{{ url_for('search') }}" method="get">
|
2023-06-27 23:15:12 +02:00
|
|
|
{{ form.csrf_token }}
|
2023-06-13 22:18:17 +02:00
|
|
|
<div class="query">
|
2019-02-03 14:57:30 +01:00
|
|
|
{{ form.q.label }}
|
|
|
|
{{ form.q(value=request.args.get('q')) }}
|
2023-09-05 21:51:25 +02:00
|
|
|
{% for error in form.q.errors %}
|
|
|
|
<span class="msgerror">{{ error }}</span>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
<div class="submit">
|
|
|
|
{{ form.submit(class_="bg-ok") }}
|
|
|
|
{% for error in form.submit.errors %}
|
|
|
|
<span class="msgerror">{{ error }}</span>
|
|
|
|
{% endfor %}
|
2019-02-03 14:57:30 +01:00
|
|
|
</div>
|
2023-06-13 22:18:17 +02:00
|
|
|
<div class="date">
|
2019-02-03 14:57:30 +01:00
|
|
|
{{ form.date.label }}
|
2023-06-13 22:18:17 +02:00
|
|
|
{{ form.date(value=request.args.get('date')) }}
|
2023-09-05 21:51:25 +02:00
|
|
|
{% for error in form.date.errors %}
|
|
|
|
<span class="msgerror">{{ error }}</span>
|
|
|
|
{% endfor %}
|
2023-06-13 22:18:17 +02:00
|
|
|
</div>
|
|
|
|
<div class="sort">
|
|
|
|
{{ form.sortBy.label }}
|
|
|
|
{{ form.sortBy(value=request.args.get('sortBy')) }}
|
2023-09-05 21:51:25 +02:00
|
|
|
{% for error in form.sortBy.errors %}
|
|
|
|
<span class="msgerror">{{ error }}</span>
|
|
|
|
{% endfor %}
|
2023-06-13 22:18:17 +02:00
|
|
|
</div>
|
|
|
|
<div class="scope">
|
|
|
|
{{ form.scope.label }}
|
|
|
|
{{ form.scope(value=request.args.get('scope')) }}
|
2023-09-05 21:51:25 +02:00
|
|
|
{% for error in form.scope.errors %}
|
|
|
|
<span class="msgerror">{{ error }}</span>
|
|
|
|
{% endfor %}
|
2019-02-03 14:57:30 +01:00
|
|
|
</div>
|
2023-09-05 21:46:57 +02:00
|
|
|
<div class="search-results">
|
|
|
|
{{ widget_pagination.paginate(results, 'search', None, {
|
|
|
|
'q': request.args.get('q'),
|
|
|
|
'date': request.args.get('date'),
|
|
|
|
'sortBy': request.args.get('sortBy')}) }}
|
|
|
|
{% for i in results.items %}
|
|
|
|
<div>
|
|
|
|
{{ i.id }} {{ i.title }}<br>
|
|
|
|
{% if i.forum %}
|
|
|
|
<a href="{{ url_for('forum_topic', f=i.forum, page=(i , 'fin')) }}">{{ i.title }}</a>
|
|
|
|
{% elif i.thread %}
|
2023-09-26 21:18:58 +02:00
|
|
|
{% if i.thread.owner_program %}
|
|
|
|
{% if i.thread.owner_program[0].id == i.id %}
|
|
|
|
<a href="{{ url_for('program_view', page=(i.thread.owner_program[0], '')) }}">{{ i.thread.owner_program[0].name }}</a>
|
|
|
|
{% else %}
|
|
|
|
<a href="{{ url_for('redirect_post', postid=i.id) }}">{{ i.thread.owner_program[0].name }}</a>
|
|
|
|
{% endif %}
|
|
|
|
{% elif i.thread.owner_topic %}
|
2023-09-05 21:46:57 +02:00
|
|
|
<a href="{{ url_for('redirect_post', postid=i.id) }}">{{ i.thread.owner_topic[0].title }}</a>
|
2023-09-12 22:05:38 +02:00
|
|
|
{% endif %}
|
2023-09-05 21:46:57 +02:00
|
|
|
{% endif %}
|
|
|
|
{{ i.headline }}<br>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
{{ widget_pagination.paginate(results, 'search', None, {
|
|
|
|
'q': request.args.get('q'),
|
|
|
|
'date': request.args.get('date'),
|
|
|
|
'sortBy': request.args.get('sortBy')}) }}
|
2023-06-13 22:18:17 +02:00
|
|
|
</div>
|
2023-09-05 21:46:57 +02:00
|
|
|
</form>
|
2023-06-13 22:18:17 +02:00
|
|
|
</section>
|
2019-02-03 14:57:30 +01:00
|
|
|
{% endblock %}
|