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

{% block body %}
<!-- Geometry/Map -->
<!-- ko ifnot: mapOnly -->
<div class="afs-report-section">
    <h2 class="afs-report-section-title"><i data-bind="click: function() {toggleVisibility(visible.geometry)}, attr: {'aria-label': '{% trans "Expand/Collapse" %}'}" class="fa fa-angle-double-right toggle"></i> {% trans "Geospatial Coordinates" %}</h2>
    <a class="afs-report-a" data-bind="{if: cards && cards.locationGeometry && !geojson, click: function(){addNewTile(cards.locationGeometry)}}">
        <i class="fa fa-mail-reply" aria-hidden="true"></i> {% trans "Add Geometry" %}
    </a>

    <!-- Collapsible content -->
    <div data-bind="visible: visible.geometry" class="afs-report-collapsible-container pad-lft">

        <div class="afs-report-subsection">
            <h3><i data-bind="click: function() {toggleVisibility(visible.locality)}, attr: {'aria-label': '{% trans "Expand/Collapse" %}'}" class="fa fa-angle-double-right toggle"></i> {% trans "Geometry" %}</h3>
            <a class="afs-report-a" data-bind="{if: cards.locationGeometry, click: function(){addNewTile(cards.locationGeometry)}}"><i class="fa fa-mail-reply" aria-hidden="true"></i> {% trans "Edit location" %}</a>
            <div data-bind="visible: visible.locality">
                <!-- ko ifnot: geojson -->
                <div class="afs-nodata-note afs-top-card">{% trans "No geometry for this resource" %}</div>
                <!-- /ko --> 
        
                <!-- ko if: geojson -->
                <div class="afs-report-subsection-container no-flex">
                    <div class="firstchild-container">
                        <div class="afs-report-map">
                            <div class="map-container" style="height:475px">
                                <div class="map" style="height:475px" data-bind="component: {
                                    name: 'arches-map',
                                    params: $data
                                }">
                                </div>
                            </div>
                        </div>

                    </div>   
                </div>
                <!-- /ko -->
            </div>
        </div>

        <!-- Geometry Metadata -->
        <div class="afs-report-subsection" data-bind="if: geometryMetadata">
            <h3><i data-bind="click: function() {toggleVisibility(visible.metadata)}, attr: {'aria-label': '{% trans "Expand/Collapse" %}'}" class="fa fa-angle-double-right toggle"></i> {% trans "Geometry Metadata" %}</h3>
            
            <!-- Collapsible content -->
            <div data-bind="visible: visible.metadata" class="afs-report-collapsible-container">
                <!-- ko ifnot: false -->
                <div class="afs-nodata-note afs-top-card">{% trans "No metadata for this resource" %}</div>
                <!-- /ko -->

                <!-- ko if: false -->   
                <div class="afs-report-subsection-container multi-cards no-flex">

                    <!-- Record Authorization/Compilation/Update -->
                    <div class="afs-report-subsection-firstchild">
                        <h5>{% trans "Record Edit History" %}</h5>
                        
                        <!-- ko ifnot: hasGeometryAuthorization(location.geometry) -->
                        <div class="afs-nodata-note">{% trans "No authorization record for this resource" %}</div>
                        <!-- /ko -->

                        <!-- ko if: hasGeometryAuthorization(location.geometry) -->   
                        <div class="firstchild-container" data-bind="{with: location.geometry}">
                            <div class="afs-report-subsection-item flex">
                                <div class="afs-block-attributes actor-name">
                                    <h6 class="afs-block-key compressed">{% trans "Record Reviewer:" %} </h6>
                                    <div data-bind="text: reviewer" class="afs-block-value"></div>
                                </div>
                                <div class="afs-block-attributes timespan">
                                    <h6 class="afs-block-key compressed">{% trans "Review Date:" %} </h6>
                                    <div data-bind="text: reviewDate" class="afs-block-value"></div>
                                </div>
                                <div class="afs-block-attributes">
                                    <h6 class="afs-block-key compressed">{% trans "Type of Review:" %} </h6>
                                    <div data-bind="text: reviewType" class="afs-block-value"></div>
                                </div>
                            </div>
                            <div class="afs-report-subsection-item flex">
                                <div class="afs-block-attributes actor-name">
                                    <h6 class="afs-block-key compressed">{% trans "Compiler:" %} </h6>
                                    <div data-bind="text: compiler" class="afs-block-value"></div>
                                </div>
                                <div class="afs-block-attributes timespan">
                                    <h6 class="afs-block-key compressed">{% trans "Compile Date:" %} </h6>
                                    <div data-bind="text: compileDate" class="afs-block-value"></div>
                                </div>
                            </div>
                            <div class="afs-report-subsection-item flex">
                                <div class="afs-block-attributes actor-name">
                                    <h6 class="afs-block-key compressed">{% trans "Last Update:" %} </h6>
                                    <div data-bind="text: lastUpdateName"  class="afs-block-value"></div>
                                </div>
                                <div class="afs-block-attributes timespan">
                                    <h6 class="afs-block-key compressed">{% trans "Update Date:" %} </h6>
                                    <div data-bind="text: lastUpdate"  class="afs-block-value"></div>
                                </div>
                            </div>
                        </div>
                        <!-- /ko -->   
                    </div>

                    <!-- Geometry Sources/Scale -->
                    <div class="afs-report-subsection-firstchild">
                        <h5>{% trans "Record Sources/Scale" %}</h5>

                        <!-- ko ifnot: hasGeometrySourcesScale(location.geometry) -->
                        <div class="afs-nodata-note" style="display: none;">{% trans "No record sources/scale for this resource" %}</div>
                        <!-- /ko -->   

                        <!-- ko if: hasGeometrySourcesScale(location.geometry) -->
                        <div class="firstchild-container">
                            <div class="afs-report-subsection-item flex column-order pad-btm" data-bind="{with: location.geometry}">
                                <div class="afs-block-attributes">
                                    <h6 class="afs-block-key compressed">{% trans "Coordinate System:" %} </h6>
                                    <div data-bind="text: coordinateSystem" class="afs-block-value"></div>
                                </div>
                                <div class="afs-block-attributes">
                                    <h6 class="afs-block-key compressed">{% trans "Basemap:" %} </h6>
                                    <div data-bind="text: basemap" class="afs-block-value"></div>
                                </div>
                                <div class="afs-block-attributes">
                                    <h6 class="afs-block-key compressed">{% trans "Capture Scale:" %} </h6>
                                    <div data-bind="text: captureScale" class="afs-block-value">--</div>
                                </div>
                                <div class="afs-block-attributes">
                                    <h6 class="afs-block-key compressed">{% trans "Accuracy:" %} </h6>
                                    <div data-bind="text: accuracy" class="afs-block-value"></div>
                                </div>
                            </div>
                        </div>
                        <!-- /ko -->   
                    </div>

                    <!-- Record Description -->
                    <div class="afs-report-subsection-firstchild">
                        <h5>{% trans "Description" %}</h5>
                        <a class="afs-report-a"><i class="fa fa-mail-reply" aria-hidden="true"></i> {% trans "Description" %}</a>
                        
                        <!-- ko ifnot: location.geometry.description -->
                        <div class="afs-nodata-note" style="display: none;">{% trans "No description record for this resource" %}</div>
                        <!-- /ko -->   

                        <!-- ko ifnot: location.geometry.description -->
                        <div class="firstchild-container pad-btm">
                            <div class="afs-report-subsection-item">
                                <div data-bind="{with: location.geometry}" class="afs-block-attributes" style="margin-top: 5px;">
                                    <h6 class="afs-block-key compressed">{% trans "Metadata Description:" %} </h6>
                                    <div data-bind="text: description" class="afs-block-value"></div>
                                </div>
                            </div>
                        </div>
                        <!-- /ko -->   
                    </div>
                </div>  
                <!-- /ko -->
            </div>
        </div>
    </div>
</div>
<!-- /ko -->

<!-- ko if: mapOnly && geojson -->
<div class="afs-report-subsection-container no-flex">
    <div class="firstchild-container">
        <div class="afs-report-map">
            <div class="map-container" style="height:475px">
                <div class="map" style="height:475px" data-bind="component: {
                    name: 'arches-map',
                    params: $data
                }">
                </div>
            </div>
        </div>

    </div>   
</div>
<!-- /ko -->

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