{% load i18n %}
{% if display == 'inline' %}
    <div class="btn-group dropdown">
        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            {% trans 'Actions' %} <i class="fa fa-caret-down"></i>
        </button>
        <ul class="dropdown-menu dropdown-menu-right">
{% else %}
    <div class="btn-group training-actions dropdown">
        <button type="button" class="btn btn-link btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            <i class="fa fa-ellipsis-h fa-2x"></i>
        </button>
        <ul class="dropdown-menu">
{% endif %}
        {% if training.is_duplicable and training.is_draftable and training.version_state == training.VERSION_STATES.PUBLISHED %}
            <li>
                <a href="{{ training.get_duplicate_url }}" class="dialog-box">
                    <i class="fa fa-paper-plane-o"></i>
                    {% trans 'Share to trainers' %}
                </a>
            </li>
        {% endif %}
        {% if training.version_state != training.VERSION_STATES.ARCHIVED %}
            <li>
                <a href="{{ training.get_archive_version_state_url }}" class="dialog-box">
                    <i class="fa fa-archive"></i>
                    {% trans 'Archive' %}
                </a>
            </li>
        {% endif %}
        {% if training.is_publishable and training.is_duplicable %}
            <li>
                <a href="{{ training.get_publish_and_share_url }}" class="dialog-box">
                    <i class="fa fa-paper-plane-o"></i>
                    {% trans 'Publish and share' %}
                </a>
            </li>
        {% elif training.is_publishable %}
            <li>
                <a href="{{ training.get_publish_version_state_url }}" class="dialog-box">
                    <i class="fa fa-paper-plane-o"></i>
                    {% trans 'Publish' %}
                </a>
            </li>
        {% endif %}
        {% if training.version_state != training.VERSION_STATES.DRAFT %}
        <li>
            <a href="{{ training.get_create_draft_url }}" class="dialog-box">
                <i class="fa fa-files-o"></i>
                {% trans 'Create a new version' %}
            </a>
        </li>
        {% endif %}
    </ul>
</div>
