mass-operate.html 1.51 KB
Newer Older
1 2 3 4 5
{% load i18n %}
{% load crispy_forms_tags %}

{% block question %}
<p>
6 7 8 9
{% blocktrans with op=op.name count count=vm_count %}
Do you want to perform the <strong>{{op}}</strong> operation on the following instance?
{% plural %}
Do you want to perform the <strong>{{op}}</strong> operation on the following {{ count }} instances?
10 11 12 13 14
{% endblocktrans %}
</p>
<p class="text-info">{{op.description}}</p>
{% endblock %}
<form method="POST" action="{{url}}">{% csrf_token %}
15 16 17 18 19
  {% block formfields %}{% endblock %}
  {% for i in instances %}
  <div class="panel panel-default mass-op-panel">
    <i class="fa {{ i.get_status_icon }} fa-fw"></i>
    {{ i.name }} ({{ i.pk }})
20 21 22 23 24
    <div style="float: right;" title="{{ i.disabled }}" class="status-icon">
      <span class="fa-stack">
        <i class="fa fa-stack-2x fa-square {{ i.disabled|yesno:"minus,check" }}"></i>
        <i class="fa fa-stack-1x fa-inverse fa-{% if i.disabled %}{{i.disabled_icon|default:"minus"}}{% else %}check{% endif %}"></i>
      </span>
25
    </div>
26 27 28 29
  </div>
  <input type="checkbox" name="vm" value="{{ i.pk }}" {% if not i.disabled %}checked{% endif %}
    style="display: none;"/>
  {% endfor %}
30 31 32

  <div class="pull-right">
    <a class="btn btn-default" href="{% url "dashboard.views.vm-list" %}"
33
     data-dismiss="modal">{% trans "Cancel" %}</a>
34
    <button class="btn btn-{{ opview.effect }}" type="submit" id="mass-op-form-send">
35 36
      {% if opview.icon %}<i class="fa fa-fw fa-{{opview.icon}}"></i> {% endif %}{{ opview.name|capfirst }}
    </button>
37 38
  </div>
</form>