<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
      xmlns:map="http://typo3.org/ns/WSR/Myttaddressmap/ViewHelpers"
      data-namespace-typo3-fluid="true">
<f:comment>
    <h1>Location List</h1>
</f:comment>
<script type="text/javascript">
    maxPage = Math.ceil({locationsCount}/{settings.resultLimit});
</script>
<div class="searchResultContainer">
    <f:for each="{locations}" as="location" iteration="iter">
        <div id="a{location.uid}" class="panel panel-address" itemscope="" itemtype="http://schema.org/LocalBusiness">
            <div class="panel-body">
                <div class="address-organisation" itemprop="name">{location.company -> f:format.raw()}</div>
                <div class="address-fullname" itemprop="founder" itemscope="" itemtype="http://schema.org/Person">
                    <span class="address-title" itemprop="jobTitle">{location.title}</span>
                    <span class="address-name" itemprop="name">{location.name}</span>
                </div>
                <f:if condition="{location.description}">
                    <div class="address-fullname" itemprop="founder" itemscope="" itemtype="http://schema.org/Person">
                        <span class="address-name" itemprop="name">{location.description}</span>
                    </div>
                </f:if>
                <div class="address-outer" itemprop="address" itemscope="" itemtype="http://schema.org/PostalAddress" data-geolat="{location.latitude}" data-geolng="{location.longitude}">
                    <span class="address-street" itemprop="streetAddress">{location.address}</span><br>
                    <span class="address-zip" itemprop="postalCode">{f:if(condition: '{location.country} == "AT"', then: 'A-')}{location.zip}</span>
                    <span class="address-locality" itemprop="addressLocality">{location.city}</span> <span class="address-country sr-only">{location.country}</span><br>
                </div>
                <a href="tel:{location.phone}" class="address-telephone" itemprop="telephone">{location.phone}</a>
                <f:if condition="{location.email}">
                    <a href="" class="address-email" itemprop="email">{location.email}</a>
                </f:if>
                <f:if condition="{location.www}">
                    <a href="http://{location.www}" target="_blank" class="address-website" itemprop="url" rel=”noopener noreferrer”>{location.www}</a>
                </f:if>
                <f:link.action class="address-detail" style="display: inline-block" action="singleView" extensionName="myttaddressmap" pluginName="SingleView" controller="Address" pageUid="{settings.detailsPageId}" arguments="{locationUid : location.uid}">Detailansicht</f:link.action>
                <a class="address-pin" style="display: inline-block" onclick="openInfoWindow({iter.index}); scrollto('#map')">in Karte zeigen</a>
            </div>
        </div>
    </f:for>
</div>
