{% extends 'generic/object.html' %}
{% load i18n %}

{% block extra_controls %}
  {% if perms.core.sync_datasource %}
    {% if object.ready_for_sync %}
      <form action="{% url 'core:datasource_sync' pk=object.pk %}" method="post">
        {% csrf_token %}
        <button type="submit" class="btn btn-primary">
          <i class="mdi mdi-sync" aria-hidden="true"></i> {% trans "Sync" %}
        </button>
      </form>
    {% else %}
      <span class="inline-block" tabindex="0" data-bs-toggle="tooltip" data-bs-delay="100" data-bs-placement="bottom">
        <button class="btn btn-primary" disabled>
          <i class="mdi mdi-sync" aria-hidden="true"></i> {% trans "Sync" %}
        </button>
      </span>
    {% endif %}
  {% endif %}
{% endblock %}
