{% extends "views/report-templates/default.htm" %} 
{% load i18n %} 
{% block report %}
    {% block report_title_bar %}
    <!-- Custom Template Report Title Bar -->
    <div class="relative">

        <!-- Title Block -->
        <div class="afs-report-toolbar">
            <h1 class="afs-report-toolbar-title"><span class="afs-report-name">{% trans "Instrument:" %}</span><span data-bind="text: displayname" class="afs-report-instance-name"></span></h1>
        </div>

    </div>
    {% endblock report_title_bar %}

    
    {% block body %}
    <!-- Link nav -->
    <div class="afs-report-anchor-container">
        <ol class="afs-report-anchors breadcrumb">
            <!-- ko foreach: {data: sections, as: 'section'} -->
            <li data-bind="click: function(){$parent.activeSection(section.id)}, css: {active: $parent.activeSection() === section.id}, text: section.title" class="afs-report-a"></li>
            <!-- /ko -->
        </ol>
    </div>
    <div class="afs-tabbed-report">
        <div class="afs-tabbed-report-content">
            <!-- Names Tab -->
            <div class="afs-report-page" data-bind="if: activeSection() === 'name'">
                <div data-bind="component: {
                    name: 'views/components/reports/scenes/name',
                    params: {
                        data: resource,
                        cards: nameCards,
                        dataConfig: nameDataConfig
                    }
                }"></div>
            </div>
            <!-- Description Tab -->
            <div class="afs-report-page" data-bind="if: activeSection() === 'description'">
                <div data-bind="component: {
                    name: 'views/components/reports/scenes/description',
                    params: {
                        data: resource,
                        cards: descriptionCards,

                    }
                }"></div>
            </div>
            <!-- Documentation Tab -->
            <div class="afs-report-page" data-bind="if: activeSection() === 'documentation'">
                <div data-bind="component: {
                    name: 'views/components/reports/scenes/documentation',
                    params: {
                        data: resource,
                        cards: documentationCards,
                        dataConfig: documentationDataConfig
                    }
                }"></div>
                <div class="afs-report-section">
                    <h2 class="afs-report-section-title"><i data-bind="click: function() {toggleVisibility(visible.textualReference)}, css: {'fa-angle-double-right': visible.textualReference(), 'fa-angle-double-up': !visible.textualReference()}, attr: {'aria-label': '{% trans "Expand/Collapse" %}'}" class="fa toggle"></i> {% trans "Textual Reference" %}</h2>
                    <span data-bind="if: textualReferenceCards && (!textualReference().length || textualReferenceCards.cardinality == 'n')">
                        <a class="afs-report-a" data-bind="click: function(){addNewTile(textualReferenceCards)}"><i class="fa fa-mail-reply" aria-hidden="true"></i> {% trans "Add Textual Reference" %}</a>
                    </span>
                
                    <!-- Collapsible content -->
                    <div data-bind="visible: visible.textualReference" class="afs-report-collapsible-container pad-lft">
                
                        <!-- ko ifnot: textualReference().length -->
                        <div class="afs-nodata-note">{% trans "No textual references for this resource" %}</div>
                        <!-- /ko -->
                        
                        <!-- ko if: textualReference().length -->
                        <div class="afs-report-subsection" >
                            <div class="firstchild-container">
                                <div class="afs-table pad-btm">
                                    <table class="table table-striped" cells pacing="0" width="100%">
                                        <thead>
                                            <tr class="afs-table-header">
                                                <th class="min-tabletl">{% trans "Type" %}</th>
                                                <th>{% trans "Source" %}</th>
                                                <th class="afs-table-control all"></th>
                                            </tr>
                                        </thead>
                                        <tbody data-bind="dataTablesForEach: { data: textualReference, dataTableOptions: textualReferenceTableConfig }">
                                            <tr>
                                                <td data-bind="text: type"></td>
                                                <td><a class="afs-block-value-url" data-bind="text: source, attr: {href: link}"></a></td>
                                                <td class="afs-table-control">
                                                    <div data-bind="if: $parent.cards && $parent.textualReferenceCards">
                                                        <a data-bind="click: function() {$parent.editTile(tileid, $parent.textualReferenceCards)},
                                                            attr: {'aria-label': $root.translations.edit}">
                                                            <i class="fa fa-mail-reply" aria-hidden="true"></i>
                                                        </a>
                                                        <a data-bind="click: $parent.deleteTile.bind($data, tileid, $parent.textualReferenceCards),
                                                            attr: {'aria-label': $root.translations.delete}">
                                                            <i class="fa fa-trash" aria-hidden="true"></i>
                                                        </a>
                                                    </div>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <!-- /ko -->
                    </div>
                </div>
                
            </div>
           <!-- Actor Tab -->
           <div class="afs-report-page" data-bind="if: activeSection() === 'actor-relations'">
                <div data-bind="component: {
                    name: 'views/components/reports/scenes/default',
                    params: {
                        data: actorData,
                    }
                }"></div>
            </div>   
            <!-- Location Tab -->
            <div class="afs-report-page" data-bind="if: activeSection() === 'location'">
                <div data-bind="component: {
                    name: 'views/components/reports/scenes/default',
                    params: {
                        data: locationData,
                    }
                }"></div>
            </div>
            <!-- Parent Instrument Tab -->
            <div class="afs-report-page" data-bind="if: activeSection() === 'component'">
                <div data-bind="component: {
                    name: 'views/components/reports/scenes/default',
                    params: {
                        data: parthoodData,
                    }
                }"></div>
            </div>
            <!-- Instrument Configuration Tab -->
            <div class="afs-report-page" data-bind="if: activeSection() === 'instrument'">
                <div data-bind="component: {
                    name: 'views/components/reports/scenes/default',
                    params: {
                        data: sethoodData,
                    }
                }"></div>
            </div>           
            <!-- JSON Tab -->
           <div class="afs-report-page afs-flex-col" data-bind="if: activeSection() === 'json'">
               <div class="afs-flex-col" data-bind="component: {
                   name: 'views/components/reports/scenes/json',
                   params: {
                       resourceInstanceId: reportMetadata().resourceinstanceid,
                   }
               }"></div>
           </div>
        </div>
    </div>

                

    {% endblock body %}
{% endblock report %}

{% block summary %}
<div class="afs-summary-report-header">
    <h1 class="afs-summary-report-title"><span data-bind="text: displayname" class="afs-report-instance-name"></span><span class="afs-report-name pad-lft-sm">{% trans "(Instrument)" %}</span></h1>
</div>
<div class="model-summary-report">
    <div class="afs-report-page">
        <!-- Name -->
        <div class="afs-report-section">
            <h2 class="afs-report-section-title">{% trans "Name of Instrument" %}</h2>
            <div class="afs-report-subsection">
                <!-- ko ifnot: nameSummary() && nameSummary().length -->
                <h3 class="afs-report-nodata-message">{% trans "There are no names for this resource" %}</h3>
                <!-- /ko -->

                <!-- ko if: nameSummary() && nameSummary().length -->
                <div class="afs-table pad-btm">
                    <table class="table table-striped" cellspacing="0" width="100%">
                        <thead>
                            <tr class="afs-table-header">
                                <th>{% trans "Name" %}</th>
                                <th>{% trans "Name Type" %}</th>
                            </tr>
                        </thead>
                        <tbody data-bind="dataTablesForEach: { data: nameSummary, dataTableOptions: $data.getTableConfig(2) }">
                            <tr>
                                <td data-bind="text: content"></td>
                                <td data-bind="text: type"></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <!-- /ko -->
            </div>
        </div>
        <!-- Type of Instrument -->
        <div class="afs-report-section">
            <h2 class="afs-report-section-title">{% trans "Type of Instrument" %}</h2>
            <div class="afs-report-subsection">
                <!-- ko ifnot: typeSummary() && typeSummary().length -->
                <h3 class="afs-report-nodata-message">{% trans "There is no instrument type for this resource" %}</h3>
                <!-- /ko -->

                <!-- ko if: typeSummary() && typeSummary().length -->
                <div class="afs-report-data-block" data-bind="foreach: typeSummary()">
                    <div class="afs-block-value" data-bind="text: type"></div>
                </div>
                <!-- /ko -->
            </div>
        </div>
    </div>
</div>

{% endblock summary %}