{% extends "dashboard/base.html" %} {% load i18n %} {% load render_table from django_tables2 %} {% block content %}
Tip of the day: you can select multiple vm instances while holding down the CTRL button!

Your virtual machines

{% for i in "xxxxxxxxxxxxxxxxxxxxx" %} {% with forloop.counter as c %} {% include "dashboard/vm-list/test-one.html" %} {% endwith %} {% endfor %}
Id Name State Suspend in Delete in Admin Details Actions

Your virtual machines

{% render_table table %}
{% endblock %} {% block extra_js %} $(function() { var ctrlDown = false; var ctrlKey = 17; $(document).keydown(function(e) { if (e.keyCode == ctrlKey) ctrlDown = true; }).keyup(function(e) { if (e.keyCode == ctrlKey) ctrlDown = false; }); $('.vm-list-table').find('tr').click(function() { if (ctrlDown) { setRowColor($(this)); } else { $('.vm-list-selected').removeClass('vm-list-selected'); $(this).addClass('vm-list-selected'); } }); $('.vm-list-details').popover({ 'placement': 'auto', 'html': true, 'trigger': 'hover' }); $('.vm-list-connect').popover({ 'placement': 'left', 'html': true, 'trigger': 'click' }); $('tbody a').click(function(e) { // parent tr doesn't get selected when clicked e.stopPropagation(); // browser doesn't jump to top when clicked the buttons if(!$(this).hasClass('real-link')) { return false; } }); /* $('#check_all').click(function() { var checked = $(this).prop('checked'); $('.vm-checkbox').each(function() { // reverse // $(this).prop('checked', !$(this).prop('checked')); // set $(this).prop('checked', checked); setRowColor($(this)) }) }); $('.vm-checkbox').click(function() { setRowColor($(this)); }); */ }); function setRowColor(row) { if(!row.hasClass('vm-list-selected')) { row.addClass('vm-list-selected'); } else { row.removeClass('vm-list-selected'); } } {% endblock %}