{% load i18n %}
<div class="oh-btn-group">
  {% if perms.outlook_auth.change_azureapi and instance.token %}
    <a href="{% url 'refresh_outlook_token' instance.pk %}" class="oh-btn oh-btn--light-bkg w-100" title="{% trans 'Refresh Token' %}"><ion-icon name="refresh"></ion-icon></a>
  {% endif %}
  {% if perms.outlook_auth.change_azureapi %}
    <a target="_blank" href="/outlook/login/" class="oh-btn oh-btn--light-bkg w-100" title="{% trans 'Login' %}"><ion-icon name="log-in-outline"></ion-icon></a>
  {% endif %}
  <a hx-get="{% url 'mail-server-test-email' %}?instance_id={{ instance.id }}" onclick="event.stopPropagation()" hx-target="#mailServerModalBody" data-toggle="oh-modal-toggle" data-target="#mailServerModal" class="oh-btn oh-btn--light-bkg w-100" title="Test email"><ion-icon name="mail-unread-outline" role="img" class="md hydrated" aria-label="at-circle-outline"></ion-icon></a>
  {% if perms.outlook_auth.change_azureapi %}
    <a hx-get="{% url 'outlook_server_change' instance.id %}?instance_ids={{ instance.ordered_ids }}" onclick="event.stopPropagation()" hx-target="#genericModalBody" data-toggle="oh-modal-toggle" data-target="#genericModal" class="oh-btn oh-btn--light-bkg w-100" title="Edit"><ion-icon name="create-outline" role="img" class="md hydrated" aria-label="create outline"></ion-icon></a>
  {% endif %}
  {% if perms.outlook_auth.delete_azureapi %}
    <a onclick="event.stopPropagation()" hx-get="{% url 'generic-delete' %}?pk={{instance.pk}}&model=outlook_auth.AzureApi" data-toggle="oh-modal-toggle" data-target="#deleteConfirmation" hx-target="#deleteConfirmationBody" type="submit" class="oh-btn oh-btn--danger-outline oh-btn--light-bkg w-100" title="Remove"><ion-icon name="trash-outline" role="img" class="md hydrated" aria-label="trash outline"></ion-icon></a>
  {% endif %}
</div>
