1
0
Fork 0
mirror of https://gitlab.com/SIGBUS/nyaa.git synced 2024-12-22 14:40:00 +00:00

Fix broken search.

This commit is contained in:
ReimuHakurei 2017-05-24 05:45:29 +00:00
parent 1eb805120e
commit 16cfcff846

View file

@ -145,12 +145,6 @@
</li> </li>
{% endif %} {% endif %}
</ul> </ul>
{% if user_page %}
<form class="navbar-form navbar-right form" action="{{ url_for('view_user', user_name=user.username) }}" method="get">
{% else %}
<form class="navbar-form navbar-right form" action="/" method="get">
{% endif %}
{% set nyaa_cats = [('1_0', 'Anime', 'Anime'), {% set nyaa_cats = [('1_0', 'Anime', 'Anime'),
('1_1', '- Anime Music Video', 'Anime - AMV'), ('1_1', '- Anime Music Video', 'Anime - AMV'),
('1_2', '- English-translated', 'Anime - English'), ('1_2', '- English-translated', 'Anime - English'),
@ -190,7 +184,13 @@
{% endif %} {% endif %}
<div class="search-container visible-xs visible-sm"> <div class="search-container visible-xs visible-sm">
{% if user_page %}
<form class="navbar-form navbar-right form" action="{{ url_for('view_user', user_name=user.username) }}" method="get">
{% else %}
<form class="navbar-form navbar-right form" action="/" method="get">
{% endif %}
<input type="text" class="form-control" name="q" placeholder="Search..." value="{{ search["term"] if search is defined else '' }}"> <input type="text" class="form-control" name="q" placeholder="Search..." value="{{ search["term"] if search is defined else '' }}">
<br> <br>
@ -219,10 +219,17 @@
<button class="btn btn-primary form-control" type="submit"> <button class="btn btn-primary form-control" type="submit">
<i class="fa fa-search fa-fw"></i> Search <i class="fa fa-search fa-fw"></i> Search
</button> </button>
</div> </form>
</div>
{% if user_page %}
<form class="navbar-form navbar-right form" action="{{ url_for('view_user', user_name=user.username) }}" method="get">
{% else %}
<form class="navbar-form navbar-right form" action="/" method="get">
{% endif %}
<div class="input-group search-container hidden-xs hidden-sm"> <div class="input-group search-container hidden-xs hidden-sm">
<input type="text" class="form-control search-bar" name="q" placeholder="Search..." value="{{ search["term"] if search is defined else '' }}"> <input type="text" class="form-control search-bar" name="q" placeholder="Search..." value="{{ search["term"] if search is defined else '' }}">
<div class="input-group-btn nav-filter" id="navFilter-criteria"> <div class="input-group-btn nav-filter" id="navFilter-criteria">
<select class="selectpicker show-tick" title="Filter" data-width="120px" name="f"> <select class="selectpicker show-tick" title="Filter" data-width="120px" name="f">
<option value="0" title="No filter" {% if search is defined and search["quality_filter"] == "0" %}selected{% else %}selected{% endif %}>No filter</option> <option value="0" title="No filter" {% if search is defined and search["quality_filter"] == "0" %}selected{% else %}selected{% endif %}>No filter</option>
@ -230,7 +237,7 @@
<option value="2" title="Trusted only" {% if search is defined and search["quality_filter"] == "2" %}selected{% endif %}>Trusted only</option> <option value="2" title="Trusted only" {% if search is defined and search["quality_filter"] == "2" %}selected{% endif %}>Trusted only</option>
</select> </select>
</div> </div>
<div class="input-group-btn nav-filter" id="navFilter-category"> <div class="input-group-btn nav-filter" id="navFilter-category">
<!-- <!--
On narrow viewports, there isn't enough room to fit the full stuff in the selectpicker, so we show a full-width one on wide viewports, but squish it on narrow ones. On narrow viewports, there isn't enough room to fit the full stuff in the selectpicker, so we show a full-width one on wide viewports, but squish it on narrow ones.
@ -263,8 +270,8 @@
</div> </div>
</div> </div>
</form> </form>
</div> <!-- where is this? in a hurry, will fix later -->
</div><!--/.nav-collapse --> </div><!--/.nav-collapse -->
</div>
</nav> </nav>
<div class="container"> <div class="container">