{% load static %}
{% load template_tags %}
{% load i18n %}

<div id="search-results-list" data-bind="foreach: results, visible: true" style="display: none;">

    <div class="search-listing" data-bind="event: { mouseover: mouseoverInstance, mouseout: mouseoverInstance('')}, css: {'selected': selected()}">
        <h3 class="search-listing-title"><a class="search-candidate-title" href="" data-bind="click: $parent.viewReport.bind($parent)"><i class="search-listing-icon" data-bind="css: iconclass"></i> <span data-bind="text: displayname"></span></a></h3>

        <div class="search-listing-body" data-bind="html: displaydescription">
        </div>

        <div class="search-listing-footer">
            <!--ko if: provisional_resource == 'true' -->
            <a class="provisional-edits" href=""><i class="fa fa-exclamation-circle"></i> {% trans "Provisional" %} </a>
            <!--/ko-->

            <!--ko if: provisional_resource == 'partial' && $parent.userIsReviewer -->
            <a class="provisional-edits" href=""><i class="fa fa-exclamation-circle"></i> {% trans "Provisional" %} </a>
            <!--/ko-->

            <!-- ko if: !!$parent.details -->
            <a class="search-candidate-link" href="" data-bind="click: showDetails"><i class="fa fa-info-circle"></i> {% trans "Details" %} </a>
            <!-- /ko -->

            <!--ko if: canEdit -->
            <a class="search-candidate-link" href="" data-bind="click: $parent.editResource.bind($parent)"><i class="ion-ios-refresh-empty"></i> {% trans "Edit" %} </a>
            <!--/ko-->
            
            <!-- ko if: !!$parent.mapFilter -->
            <a class="search-candidate-link" href="" data-bind="visible: point, click: mapLinkClicked"><i class="fa fa-map-marker"></i> {% trans "Map" %} </a>
            <!-- /ko -->

            <!--ko ifnot: $root.resourceEditorContext -->

                <!--ko if: !!$parent.relatedResourcesManager && canRead -->
                <a class="search-candidate-link pull-right" href="" data-bind="click: showrelated"><i class="fa fa-code-fork"></i> {% trans "Related Resources" %} </a>
                <!--/ko-->

                <!--ko if: $root.resourceEditorContext -->
                    <!--ko if: relatable & $root.editingInstanceId != resourceinstanceid -->
                    <a class="search-candidate-link pull-right" href="" data-bind="click: function(val){relationshipcandidacy(val); showrelated()}"><i class="fa fa-code-fork"></i> {% trans "Relate Resource" %} </a>
                    <!--/ko-->
                    <!--ko if: relatable == false || $root.editingInstanceId == resourceinstanceid -->
                    <a class="search-candidate-link unrelatable-search-result pull-right" href=""><i class="fa fa-code-fork"></i> {% trans "Cannot Be Related" %} </a>
                    <!--/ko-->
                <!--/ko-->
            <!--/ko-->

        </div>
    </div>

</div>
