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" %} {% 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 %} {% block title %}
{{ forum }} {{ forum }}
@ -12,6 +12,7 @@
> <a href="{{ f.get_absolute_url() }}">{{ f }}</a> > <a href="{{ f.get_absolute_url() }}">{{ f }}</a>
{% endfor %} {% endfor %}
> <a href="{{ forum.get_absolute_url() }}">{{ forum }}</a> > <a href="{{ forum.get_absolute_url() }}">{{ forum }}</a>
{{ display_search_bar() }}
</div> </div>
<div id="forum"> <div id="forum">
<h3>{{ forum.name }}</h3> <h3>{{ forum.name }}</h3>

View File

@ -155,3 +155,9 @@
{{ m.mark_as_read(user) or "" }} {{ m.mark_as_read(user) or "" }}
{% endmacro %} {% 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" %} {% extends "core/base.jinja" %}
{% from 'core/macros.jinja' import user_profile_link %} {% 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 %} {% block title %}
{% trans %}Forum{% endtrans %} {% trans %}Forum{% endtrans %}
@ -12,6 +12,7 @@
</p> </p>
<div id="forum"> <div id="forum">
<h3>{% trans %}Forum{% endtrans %}</h3> <h3>{% trans %}Forum{% endtrans %}</h3>
{{ display_search_bar() }}
<p> <p>
<a class="ib button" href="{{ url('forum:last_unread') }}">{% trans %}View last unread messages{% endtrans %}</a> <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> <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> <a href="{{ url('forum:new_forum') }}">{% trans %}New forum{% endtrans %}</a>
</p> </p>
{% endif %} {% 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>
<div class="ib w_big"> <div class="ib w_big">
{% trans %}Title{% endtrans %} {% trans %}Title{% endtrans %}

View File

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

View File

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