{% extends "webpage/base.html" %}
{% load static %}
{% load transkribus_extras %}
{% block title %}Search{% endblock %}
{% block content %}
{% trp_lang as my_lang %}
    <div class="container">
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb">
                <li class="breadcrumb-item active">
                    {{ my_lang.docs.doc_plural }}
                </li>
            </ol>
        </nav>
        <div class="card transkribus_documents">
            <div class="card-header" style="text-align: center">
                <h1 class="transkribus_collection-title">
                    {{ collection.colName }}
                </h1>
                <h3 class="transkribus_collection-pagecount">{{ nr_docs }} {{ my_lang.docs.doc_plural }}</h3>
                <h4 class="transkribus_collection-description">{{ collection.description }}</h4>
            </div>
            <div class="card body">
                <table class="table">
                    <thead>
                        <tr>
                            <th>
                                {{ my_lang.docs.title_col }}
                            </th>
                            <th>
                                {{ my_lang.docs.page_nr_col }}
                            </th>
                            <th>
                                {{ my_lang.docs.preview_col }}
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        {% for x in result %}
                            <tr class="transkribus_document" data-docId="{{x.docId}}">
                                <td class="transkribus_document-title">
                                    <a href="{% url 'transkribus:trp_page' col_id=col_id doc_id=x.docId page_id=1 %}">
                                        {{ x.title }}
                                    </a>
                                </td>
                                <td class="transkribus_document-pagecount">
                                    {{ x.nrOfPages }}
                                </td>
                                <td class="transkribus_document-preview">
                                    <a href="{% url 'transkribus:trp_document' col_id=col_id doc_id=x.docId %}">
                                        <img src="{{ x.thumbUrl }}" />
                                    </a>
                                </td>
                            </tr>
                        {% endfor %}
                    </tbody>
                </table>

            </div>
        </div>
    </div>
{% endblock %}
