{% load rules %}
{% load projectroles_common_tags %}

<div class="btn-group sodar-list-btn-group sodar-pr-btn-grp-remote-site"
     role="group" id="sodar-pr-btn-grp-remote-site-{{ site.sodar_uuid }}">
  <button class="btn btn-secondary dropdown-toggle sodar-list-dropdown"
      type="button" data-toggle="dropdown"
      aria-haspopup="true" aria-expanded="false">
    <i class="iconify" data-icon="mdi:cog"></i>
  </button>
  <div class="dropdown-menu dropdown-menu-right">
    <a class="dropdown-item"
       href="{% url 'projectroles:remote_projects' remotesite=site.sodar_uuid %}">
      <i class="iconify" data-icon="mdi:rhombus-split"></i>
      View{% if site_mode == 'SOURCE' %}/Edit{% endif %}
      {% get_display_name 'PROJECT' title=True plural=True %}
    </a>
    {% if site_mode == 'TARGET' and site.mode == 'SOURCE' %}
      <a class="dropdown-item"
         href="{% url 'projectroles:remote_projects_sync' remotesite=site.sodar_uuid %}">
        <i class="iconify" data-icon="mdi:cloud-download"></i> Synchronize
      </a>
    {% endif %}
    <a class="dropdown-item"
       href="{% url 'projectroles:remote_site_update' remotesite=site.sodar_uuid %}">
      <i class="iconify" data-icon="mdi:lead-pencil"></i> Update Site
    </a>
    <a class="dropdown-item text-danger"
       href="{% url 'projectroles:remote_site_delete' remotesite=site.sodar_uuid %}">
      <i class="iconify" data-icon="mdi:close-thick"></i> Remove Site
    </a>
  </div>
</div>
