<?xml version="1.0" encoding="UTF-8" ?>
<FanvilIPPhoneDirectory>
{% for result in results -%}
 <DirectoryEntry>
  <Name>{{ result.name|e }}</Name>
  <Telephone>{{ result.number|e }}</Telephone>
 </DirectoryEntry>
{% else -%}
 <DirectoryEntry>
  <Name>{{ gettext('No entries') }}</Name>
  <Telephone></Telephone>
 </DirectoryEntry>
{% endfor -%}

{% if offset_next is not none or offset_previous is not none -%}
<SoftKeyItem>
<Name>{{ gettext('Dial') }}</Name>
<URL>SoftKey:Dial</URL>
<Position>1</Position>
</SoftKeyItem>

{% if offset_previous is not none -%}
<SoftKeyItem>
<Name>{{ gettext('PrevPage') }}</Name>
<URL>{{ base_url|e }}?xivo_user_uuid={{ user_uuid|e }}&term={{ term|e }}&limit={{ limit|e }}&offset={{ offset_previous|e }}</URL>
<Position>2</Position>
</SoftKeyItem>
{% endif -%}

<SoftKeyItem>
<Name>{{ gettext('Exit') }}</Name>
<URL>SoftKey:Exit</URL>
<Position>3</Position>
</SoftKeyItem>

{% if offset_next is not none -%}
<SoftKeyItem>
<Name>{{ gettext('NextPage') }}</Name>
<URL>{{ base_url|e }}?xivo_user_uuid={{ user_uuid|e }}&term={{ term|e }}&limit={{ limit|e }}&offset={{ offset_next|e }}</URL>
<Position>4</Position>
</SoftKeyItem>
{% endif -%}
{% endif -%}
</FanvilIPPhoneDirectory>
