home » zplus/dokk.org.git
ID: 570f7d15ae7731aa569df18785045e07f4d2b641
65 lines — 2K — View raw


{% extends "templates/base.tpl" %}

{% block title %}Library{% endblock %}

{% block body %}

<div class="library">

<b>The library is also available via OPDS. Add this link to your OPDS client: https://dokk.org/library/opds.xml</b>
<br /><br /><br />

<details>
    <summary>Filters</summary>

    <form action="" method="post">
        <br />

        Author:
        <br />
        <select name="author" multiple size=10>
            {% for author in authors %}
                <option value="{{ author['name']['value'] }}" {{ 'selected' if author['name']['value'] in filters_author }}>{{ author['name']['value'] }}</option>
            {% endfor %}
        </select>

        <br /><br />

        License:
        <br />
        <select name="license" multiple size=10>
            {% for license in licenses %}
                <option value="{{ license['id']['value'] }}" {{ 'selected' if license['id']['value'] in filters_license }}>{{ license['id']['value'] }}</option>
            {% endfor %}
        </select>

        <br /><br />
        <input type="submit" value="Search" />
    </form>
</details>

{% for item in items["@graph"]|sort(attribute="library:title") %}
    <p>
        <div>
            <a href="/library/{{ item['@id'][8:] }}">{{ item['library:title'] }}</a>
        </div>

        <div>
            Authors:
            {% for author in item["library:author"]|sort() %}
                {{ author }}
            {% endfor%}
        </div>

        <div>
            License:
            {% for license in item["library:license"]|sort(attribute="license:id") %}
                {{ license['license:id'] }}
            {% endfor%}
        </div>
    </p>
    <br/><br/>
{% endfor %}
</div>

{% endblock %}