1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

Add sortable

This commit is contained in:
Retspen 2015-03-10 16:46:52 +02:00
parent ed2b28c25e
commit 5f6b06b467
5 changed files with 197 additions and 91 deletions

View file

@ -1,6 +1,9 @@
{% extends "base.html" %}
{% load i18n %}
{% block title %}{% trans "Storage" %} - {{ pool }}{% endblock %}
{% block style %}
<link rel="stylesheet" href="{{ STATIC_URL }}/css/sortable-theme-bootstrap.css" />
{% endblock %}
{% block content %}
<!-- Page Heading -->
<div class="row">
@ -77,14 +80,14 @@
<h3 class="page-header">{% trans "Volumes" %}</h3>
{% if volumes %}
<div class="table-responsive">
<table class="table table-striped table-bordered" id="sortTable">
<table class="table table-striped table-bordered sortable-theme-bootstrap" data-sortable>
<thead>
<tr>
<th style="width:35px;">#</th>
<th>{% trans "Name" %}</th>
<th style="width:80px;">{% trans "Size" %}</th>
<th style="width:75px;">{% trans "Format" %}</th>
<th colspan="2">{% trans "Action" %}</th>
<th>{% trans "Size" %}</th>
<th>{% trans "Format" %}</th>
<th data-sortable="false" colspan="2">{% trans "Action" %}</th>
</tr>
</thead>
<tbody>
@ -177,25 +180,26 @@
</div>
{% endblock %}
{% block script %}
<script>
$('.format-convert').hide();
$(document).on('change', '.volume-convert', function () {
if ($(this).prop('checked')) {
$('.format-convert').show();
if ($('.image-format').val() == 'qcow2') {
$('.meta-prealloc').show();
}
} else {
$('.format-convert').hide();
$('.meta-prealloc').hide();
}
});
$(document).on('change', '.image-format', function () {
if ($(this).val() == "qcow2") {
<script src="{{ STATIC_URL }}/js/sortable.min.js"></script>
<script>
$('.format-convert').hide();
$(document).on('change', '.volume-convert', function () {
if ($(this).prop('checked')) {
$('.format-convert').show();
if ($('.image-format').val() == 'qcow2') {
$('.meta-prealloc').show();
} else {
$('.meta-prealloc').hide();
}
});
</script>
} else {
$('.format-convert').hide();
$('.meta-prealloc').hide();
}
});
$(document).on('change', '.image-format', function () {
if ($(this).val() == "qcow2") {
$('.meta-prealloc').show();
} else {
$('.meta-prealloc').hide();
}
});
</script>
{% endblock %}