{% extends "admin/change_form.html" %}
{% load i18n widgy_tags %}

{% block object-tools %}
  {% if change %}
    <ul class="object-tools">
    {% if original.status == 2 %}
      <li><a href="unpublish/">Unpublish</a></li>
    {% endif %}
    {% get_action_links original original.root_node.working_copy as links %}
    {% for link in links %}
      <li><a class="{{ link.type }}" target="_blank" href="{{ link.url }}">{{ link.text }}</a></li>
    {% endfor %}
    {% if has_add_permission %}
      <li><a class="widgy-fancybox" href="clone/">Clone</a></li>
    {% endif %}
    {% if history_url %}
      <li><a class="historylink" target="_blank" href="{{ history_url }}">{% trans "History" %}</a></li>
    {% endif %}
    {% if has_absolute_url and original.status == 2 %}
        <li><a href="../../../r/{{ content_type_id }}/{{ object_id }}/" class="viewsitelink">
            {% trans "View live version" %}
        </a></li>
    {% endif%}
    </ul>
  {% endif %}
{% endblock %}

{% block submit_buttons_bottom %}
<div class="submit-row" {% if is_popup %}style="overflow: auto;"{% endif %}>
    {% if has_delete_permission and not add %}
      <p class="deletelink-box">
        <a href="delete/" class="deletelink">{% trans "Delete" %}</a>
      </p>
    {% endif %}
    {% for action, title in save_buttons %}
      <input type="submit" value="{{ title }}" class="default" name="{{ action }}">
    {% endfor %}
</div>
{% endblock %}
