78 lines
2.5 KiB
HTML
78 lines
2.5 KiB
HTML
{% extends "base/base.html" %}
|
|
{% import "widgets/pagination.html" as widget_pagination with context %}
|
|
|
|
{% set tabtitle = "Recherche avancée" %}
|
|
|
|
{% block content %}
|
|
<section class="search-page">
|
|
<h1>Recherche avancée</h1>
|
|
|
|
<form class="form" action="{{ url_for('search') }}" method="get">
|
|
{{ form.csrf_token }}
|
|
<div class="query">
|
|
{{ form.q.label }}
|
|
{{ form.q(value=request.args.get('q')) }}
|
|
{% 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 %}
|
|
</div>
|
|
<div class="date">
|
|
{{ form.date.label }}
|
|
{{ form.date(value=request.args.get('date')) }}
|
|
{% for error in form.date.errors %}
|
|
<span class="msgerror">{{ error }}</span>
|
|
{% endfor %}
|
|
</div>
|
|
<div class="sort">
|
|
{{ form.sortBy.label }}
|
|
{{ form.sortBy(value=request.args.get('sortBy')) }}
|
|
{% for error in form.sortBy.errors %}
|
|
<span class="msgerror">{{ error }}</span>
|
|
{% endfor %}
|
|
</div>
|
|
<div class="scope">
|
|
{{ form.scope.label }}
|
|
{{ form.scope(value=request.args.get('scope')) }}
|
|
{% for error in form.scope.errors %}
|
|
<span class="msgerror">{{ error }}</span>
|
|
{% endfor %}
|
|
</div>
|
|
<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 %}
|
|
{% 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 %}
|
|
<a href="{{ url_for('redirect_post', postid=i.id) }}">{{ i.thread.owner_topic[0].title }}</a>
|
|
{% endif %}
|
|
{% 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')}) }}
|
|
</div>
|
|
</form>
|
|
</section>
|
|
{% endblock %}
|