{% load i18n %} {% load bootstrap_icons %} {% load vm_states %} {# the actions this user may use on the VM now (states.allowed_actions), as one group of the same shape in every row: the console, the power action the state calls for (its icon only, named on hover), and a menu of the others; what does not apply now is disabled, all of it for a VM its owner cannot use now (one an administrator paused). The console's word is hidden on a phone. #} {% vm_actions instance as actions %} {% vm_manages instance as manages %} {% if actions or manages and instance.info %}
{% if "clone" in actions %} {% bs_icon 'copy' %} {% elif "poweron" in actions %}
{% csrf_token %}
{% elif "resume" in actions %}
{% csrf_token %}
{% elif "poweroff" in actions %}
{% csrf_token %}
{% else %} {% if instance.info.0 == 3 %} {% else %} {% endif %} {% endif %}
{# fixed: the menu would be cut off by the table's scrolling box #}
{% endif %}