{% extends "views/report-templates/default.htm" %}
{% load i18n %}
{% block report %}

{% block body %}

<!-- Bibliographic Source Creation section -->
<div class="aher-report-section" data-bind="visible: !!dataConfig.sourceCreation">
    <h2 class="aher-report-section-title"><i tabindex="0" data-bind="onEnterkeyClick, onSpaceClick, click: function() {toggleVisibility(visible.sourceCreation)}, onReportSectionToggleAria: visible.sourceCreation, sectionName: '{% trans "Source Creation" %}'" class="fa toggle"></i> {% trans "Source Creation" %}</h2>
    <!-- ko if: checkCardsAvailable($data.cards) -->
    <a href="#" data-bind="{if: cards.sourceCreation, click: function(){addNewTile(cards.sourceCreation)}}" class="aher-report-a"><i class="fa fa-mail-reply"></i> {% trans "Add Source Creation" %}</a>
    <!-- /ko -->
    <!-- Collapsible content -->
    <div data-bind="visible: visible.sourceCreation" class="aher-report-collapsible-container pad-lft">

        <!-- ko ifnot: sourceCreation() -->
        <div class="aher-nodata-note">{% trans "No source creation for this resource" %}</div>
        <!-- /ko -->

        <!-- ko if: sourceCreation() -->
        <div class="aher-report-subsection">
            <div class="firstchild-container">
                <div class="aher-table" data-bind="">
                    <table class="table table-striped" cellspacing="0" width="100%">
                        <thead>
                            <tr>
                                <th>{% trans "Author" %}</th>
                                <th>{% trans "Editor" %}</th>
                                <th>{% trans "Contributor" %}</th>
                                <th>{% trans "Statement of Responsibility" %}</th>
                                <th class="aher-table-control all"></th>
                            </tr>
                        </thead>
                        <tbody data-bind="dataTablesForEach: { data: sourceCreation, dataTableOptions: sourceCreationConfig}">
                            <tr>
                                <td data-bind="text: author"></td>
                                <td data-bind="text: editor"></td>
                                <td data-bind="text: contributor"></td>
                                <td data-bind="text: statement"></td>
                                <td class="aher-table-control">
                                    <div data-bind="if: $parent.cards.sourceCreation">
                                        <a href="#" data-bind="onEnterkeyClick, onSpaceClick, click: function() {$parent.editTile(tileid, $parent.cards.sourceCreation)}">
                                            <i class="fa fa-mail-reply"></i>
                                        </a>
                                        <a href="#" data-bind="if: $parent.cards.sourceCreation.cardinality == 'n', onEnterkeyClick, onSpaceClick, click: $parent.deleteTile.bind($data, tileid, $parent.cards.sourceCreation, $parent.resource)">
                                            <i class="fa fa-trash"></i>
                                        </a>
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <!-- /ko -->
    </div>
</div>

<!-- Repository Storage section -->
<div class="aher-report-section" data-bind="visible: !!dataConfig.repositoryStorage">
    <h2 class="aher-report-section-title"><i tabindex="0" data-bind="onEnterkeyClick, onSpaceClick, click: function() {toggleVisibility(visible.repositoryStorage)}, onReportSectionToggleAria: visible.repositoryStorage, sectionName: '{% trans "Repository Storage Location" %}'" class="fa toggle"></i> {% trans "Repository Storage Location" %}</h2>
    <!-- ko if: checkCardsAvailable($data.cards) -->
    <a href="#" data-bind="{if: cards.repositoryStorage, click: function(){addNewTile(cards.repositoryStorage)}}" class="aher-report-a"><i class="fa fa-mail-reply"></i> {% trans "Add Condition Assessment" %}</a>
    <!-- /ko -->
    <!-- Collapsible content -->
    <div data-bind="visible: visible.repositoryStorage" class="aher-report-collapsible-container pad-lft">

        <!-- ko ifnot: repositoryStorage() -->
        <div class="aher-nodata-note">{% trans "No repository storage location for this resource" %}</div>
        <!-- /ko -->

        <!-- ko if: repositoryStorage() -->
        <div class="aher-report-subsection">
            <div class="firstchild-container">
                <div class="aher-table" data-bind="">
                    <table class="table table-striped" cellspacing="0" width="100%">
                        <thead>
                            <tr>
                                <th>{% trans "Owner" %}</th>
                                <th>{% trans "Building Name" %}</th>
                                <th>{% trans "Storage Area" %}</th>
                                <th class="aher-table-control all"></th>
                            </tr>
                        </thead>
                        <tbody data-bind="dataTablesForEach: { data: repositoryStorage, dataTableOptions: repositoryStorageConfig}">
                            <tr>
                                <td><a class="aher-table-link" data-bind="text: repositoryOwner, attr: {href: repositoryOwnerLink}"></a></td>
                                <td data-bind="text: storageBuilding"></td>
                                <td data-bind="text: storageAreaName"></td>
                                <td class="aher-table-control">
                                    <div data-bind="if: $parent.cards.repositoryStorage">
                                        <a href="#" data-bind="onEnterkeyClick, onSpaceClick, click: function() {$parent.editTile(tileid, $parent.cards.repositoryStorage)}">
                                            <i class="fa fa-mail-reply"></i>
                                        </a>
                                        <a href="#" data-bind="if: $parent.cards.repositoryStorage.cardinality == 'n', onEnterkeyClick, onSpaceClick, click: $parent.deleteTile.bind($data, tileid, $parent.cards.repositoryStorage, $parent.resource)">
                                            <i class="fa fa-trash"></i>
                                        </a>
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <!-- /ko -->
    </div>
</div>
{% endblock body %}
{% endblock report %}