home » zplus/dokk.org.git
ID: e58ce9b7f82497a044fdc18dbce59c51d94f7a7a
79 lines — 2K — View raw


{% extends "base.html" %}

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

{% block body %}

<div class="library">

<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 />

        Journal:
        <br />
        <select name="journal" multiple size=5>
            {% for journal in journals %}
                <option value="{{ journal['id']['value'] }}" {{ 'selected' if journal['id']['value'] in filters_journal }}>{{ journal['title']['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'][5:] }}">{{ item['library:title'] }}</a>
        </div>

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

        {% if 'library:journal' in item %}
        <div>
            Journal:
            {{ item['library:journal']['library:title'] }}
        </div>
        {% endif %}

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

{% endblock %}