{% extends "layout.html" %}
{% block head %}
    {{ super() }}
    <script type="text/javascript" src="{{ url_for('static', filename='gwaripper.js') }}"></script>
    <title>GWARipper</title>
{% endblock %}
{% block body %}
<div class="row">
<div class="col-md-10" style="margin:auto;">
<div id="searchResult">
{% if entries %}
    {% for entry in entries %}
        {% set additional_classes = loop.cycle('odd', '') %}
        {% set audio_path = audio_paths[loop.index0] %}
        {% include 'components/entry_expandable.html' %}
    {% endfor %}
{% else %}
    {% if display_search_err_msg %}
        <h2>Error in (title) search query!</h2>
        <p class="search-err-msg">
            Only alphanumerical characters and the following special characters are allowed in the
            title search query (uses 
            <a href="https://www.sqlite.org/fts5.html#full_text_query_syntax">SQLite FTS Query Syntax</a>):<br/>
        </p>
        <p class="search-err-msg">
            asterisk(*):<br/>
            Allowed as wild-chard-character, matches zero or more arbitrary characters. Can't
            be the first character!
        </p>
        <p class="search-err-msg">
            plus(+):<br/>
            To concatenate phrases.
        </p>
        <p class="search-err-msg">
            parentheses():<br/>
            To change operator presedence in multi-phrase statements!
        </p>
    {% else %}
        <em>Unbelievable. No entries here so far</em>
    {% endif %}
{% endif %}
</div>
</div>
</div>

{% if last %}
{% if search_field %}
	{% if more.next %}
    <a href="{{ url_for('main.search_entries', after=last, q=search_field,
	sort_col=order_col, order=asc_desc) }}"><div class="page-nav" id="page-next">›</div></a>
	{% endif %}
	{% if more.prev %}
    <a href="{{ url_for('main.search_entries', before=first, q=search_field,
	sort_col=order_col, order=asc_desc) }}"><div class="page-nav" id="page-prev">‹</div></a>
	{% endif %}
{% elif listen_later_only %}
	{% if more.next %}
    <a href="{{ url_for('main.show_listen_later', after=last, sort_col=order_col, order=asc_desc) }}"><div class="page-nav" id="page-next">›</div></a>
	{% endif %}
	{% if more.prev %}
    <a href="{{ url_for('main.show_listen_later', before=first, sort_col=order_col, order=asc_desc) }}"><div class="page-nav" id="page-prev">‹</div></a>
	{% endif %}
{% else %}
	{% if more.next %}
    <a href="{{ url_for('main.show_entries', after=last, sort_col=order_col, order=asc_desc) }}"><div class="page-nav" id="page-next">›</div></a>
	{% endif %}
	{% if more.prev %}
    <a href="{{ url_for('main.show_entries', before=first, sort_col=order_col, order=asc_desc) }}"><div class="page-nav" id="page-prev">‹</div></a>
	{% endif %}
{% endif %}
{% endif %}
{% endblock %}
