{% load i18n %}
<!-- ko if: loading() === false -->
<div class="final-step">
    <div class="her-final-step-section">
        <h5 class="summary-value">{% trans 'Created or Modified Resource Instance' %}</h5>
        <div class="final-step-section-block">
            <div class="final-step-section-block-item">
                <a data-bind="attr: { href: urls.resource + '/' + resourceid}" target="_blank">
                    <div class="summary-value" 
                        data-bind = "text: displayName + ' ({% trans 'Consultation Resource Instance' %})'">
                    </div>
                </a>
                <!-- ko if: digitalObjectResourceId -->
                <a data-bind="attr: { href: urls.resource + '/' + digitalObjectResourceId()}" target="_blank">
                    <div class="summary-value" 
                        data-bind = "text: digitalObjectResourceName + ' ({% trans 'Digital Object Resource Instance' %})'">
                    </div>
                </a>
                <!-- /ko -->
            </div>
        </div>
    </div>

    <div class="her-final-step-section">
        <h5 class="summary-value">{% trans 'Consultation Communication Details' %}</h5>
        <div class="final-step-section-block">
            <div class="final-step-section-block-item">
                <div class="block-item">
                    <div class="summary-label" data-bind="text: reportVals.consultationName.name + ':'"></div>
                    <div class="summary-value" data-bind="text: reportVals.consultationName.value"></div>
                </div>
                <div class="block-item">
                    <div class="summary-label" data-bind="text: reportVals.subject.name + ':'"></div>
                    <div class="summary-value" data-bind="text: reportVals.subject.value"></div>
                </div>
                <div class="block-item">
                    <div class="summary-label" data-bind="text: reportVals.type.name + ':'"></div>
                    <div class="summary-value" data-bind="text: reportVals.type.value"></div>
                </div>
                <div class="block-item">
                    <div class="summary-label" data-bind="text: reportVals.date.name + ':'"></div>
                    <div class="summary-value" data-bind="text: reportVals.date.value"></div>
                </div>
                <div class="block-item">
                    <div class="summary-label" data-bind="text: reportVals.participants.name + ':'"></div>
                    <div class="summary-value" data-bind="text: reportVals.participants.value"></div>
                </div>
                <div class="block-item">
                    <div class="summary-label" data-bind="text: reportVals.relatedCondition.name + ':'"></div>
                    <div class="summary-value" data-bind="text: reportVals.relatedCondition.value"></div>
                </div>
            </div>
        </div>
    </div>

    <div class="her-final-step-section">
        <h5 class="summary-value">{% trans 'Notes' %}</h5>
        <div class="final-step-section-block">
            <div class="final-step-section-block-item">
                <div class="block-item">
                    <div class="summary-value" data-bind="html: reportVals.notes.value"></div>
                </div>
            </div>
        </div>
    </div>

    <div class="her-final-step-section">
        <h5 class="summary-value">{% trans 'Follow-on Actions' %}</h5>
        <div class="final-step-section-block">
            <div class="final-step-section-block-item">
                <div class="block-item">
                    <div class="summary-value" data-bind="html: reportVals.followOnActions.value"></div>
                </div>
            </div>
        </div>
    </div>

    <div class="her-final-step-section">
        <h5 class="summary-value">{% trans 'Uploaded Files' %}</h5>
        <div class="final-step-section-block" data-bind="if: documents().length">
            <div class="final-step-section-block-item file-list">
                <!-- ko foreach: documents -->
                <div class="file-upload-card" data-bind="style: {'border-width': $index() === ($parent.documents().length - 1) ? '0px' : '1px'}">
                    <div class="media-block">
                        <div class="media-left">
                            <a class="summary-value" data-bind="clickBubble: false, attr: {href: url}, text: name"></a>
                        </div>
                        <div class="media-right">
                            <span data-bind="text: $parent.formatSize($data)"></span>
                        </div>
                    </div>
                </div>
                <!-- /ko -->
            </div>
        </div>
        <div class="final-step-section-block-item">
            <div class="block-item files-metadata">
                <div class="summary-label">{% trans 'Files: ' %}</div>
                <div class="summary-value" data-bind='text: documents().length + "{% trans ' files for upload' %}"'></div>
            </div>
        </div>
    </div>
</div>
<!-- /ko -->
