forum: display search bar on every forum pages

This commit is contained in:
Antoine Bartuccio 2018-12-05 18:18:24 +01:00 committed by Skia
parent 404b825de4
commit 525b047b4f
5 changed files with 14 additions and 8 deletions

View File

@ -1,5 +1,5 @@
{% extends "core/base.jinja" %}
{% from 'forum/macros.jinja' import display_forum, display_topic %}
{% from 'forum/macros.jinja' import display_forum, display_topic, display_search_bar %}
{% block title %}
{{ forum }}
@ -12,6 +12,7 @@
> <a href="{{ f.get_absolute_url() }}">{{ f }}</a>
{% endfor %}
> <a href="{{ forum.get_absolute_url() }}">{{ forum }}</a>
{{ display_search_bar() }}
</div>
<div id="forum">
<h3>{{ forum.name }}</h3>

View File

@ -155,3 +155,9 @@
{{ m.mark_as_read(user) or "" }}
{% endmacro %}
{% macro display_search_bar() %}
<form action="{{ url('forum:search') }}" method="GET" style="text-align: right;">
<input type="text" placeholder="{% trans %}Search{% endtrans %}" name="query"/>
<input type="submit" value="{% trans %}Search{% endtrans %}"/>
</form>
{% endmacro %}

View File

@ -1,6 +1,6 @@
{% extends "core/base.jinja" %}
{% from 'core/macros.jinja' import user_profile_link %}
{% from 'forum/macros.jinja' import display_forum %}
{% from 'forum/macros.jinja' import display_forum, display_search_bar %}
{% block title %}
{% trans %}Forum{% endtrans %}
@ -12,6 +12,7 @@
</p>
<div id="forum">
<h3>{% trans %}Forum{% endtrans %}</h3>
{{ display_search_bar() }}
<p>
<a class="ib button" href="{{ url('forum:last_unread') }}">{% trans %}View last unread messages{% endtrans %}</a>
<a class="ib button" href="{{ url('forum:favorite_topics') }}">{% trans %}Favorite topics{% endtrans %}</a>
@ -21,10 +22,6 @@
<a href="{{ url('forum:new_forum') }}">{% trans %}New forum{% endtrans %}</a>
</p>
{% endif %}
<form action="{{ url('forum:search') }}" method="GET" id="header_search">
<input type="text" placeholder="{% trans %}Search{% endtrans %}" name="query" id="search" />
<input type="submit" value="{% trans %}Search{% endtrans %}" style="display: none;" />
</form>
<div>
<div class="ib w_big">
{% trans %}Title{% endtrans %}

View File

@ -1,5 +1,5 @@
{% extends "core/base.jinja" %}
{% from 'forum/macros.jinja' import display_message %}
{% from 'forum/macros.jinja' import display_message, display_search_bar %}
{% block title %}
{% if topic %}
@ -11,6 +11,7 @@
{% block content %}
{% if topic %}
{{ display_search_bar() }}
<p>
<a href="{{ url('forum:main') }}">{% trans %}Forum{% endtrans %}</a>
{% for f in topic.forum.get_parent_list() %}

View File

@ -1,6 +1,6 @@
{% extends "core/base.jinja" %}
{% from 'core/macros.jinja' import user_profile_link %}
{% from 'forum/macros.jinja' import display_message %}
{% from 'forum/macros.jinja' import display_message, display_search_bar %}
{% block title %}
{{ topic }}
@ -27,6 +27,7 @@
{% block content %}
<p>
{{ display_search_bar() }}
<a href="{{ url('forum:main') }}">{% trans %}Forum{% endtrans %}</a>
{% for f in topic.forum.get_parent_list()|reverse %}
> <a href="{{ f.get_absolute_url() }}">{{ f }}</a>