1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-24 15:15:22 +00:00

Fix layout

This commit is contained in:
Retspen 2015-03-06 15:06:29 +02:00
parent 573a09fd4d
commit cd4ac13e36
4 changed files with 67 additions and 26 deletions

View file

@ -1,5 +1,40 @@
{% load i18n %}
{% if request.user.is_superuser %}
<button type="button" class="btn btn-success pull-right">
<a href="#AddInstance" type="button" class="btn btn-success pull-right" data-toggle="modal">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
</button>
</a>
<!-- Modal pool -->
<div class="modal fade" id="AddInstance" tabindex="-1" role="dialog" aria-labelledby="AddNetPoolLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">{% trans "Chose computes for new instance" %}</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" role="form">
<div class="form-group">
<label class="col-sm-4 control-label">{% trans "Compute" %}</label>
<div class="col-sm-6">
<select class="form-control" id="compute_select">
{% for compute in computes %}
<option value="{{ compute.id }}">{{ compute.name }}</option>
{% endfor %}
</select>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">
{% trans "Close" %}
</button>
<button type="submit" class="btn btn-primary" name="chose" onclick='goto_compute()'>
{% trans "Chose" %}
</button>
</div>
</div> <!-- /.modal-content -->
</div> <!-- /.modal-dialog -->
</div> <!-- /.modal -->
{% endif %}

View file

@ -49,11 +49,11 @@
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
<button type="submit" class="btn btn-primary" name="create">{% trans "Create" %}</button>
</div>
</form>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
<button type="submit" class="btn btn-primary" name="create">{% trans "Create" %}</button>
</div>
</form>
</div> <!-- /.modal-content -->
</div> <!-- /.modal-dialog -->
</div><!-- /.modal -->

View file

@ -189,10 +189,16 @@
</div>
</div>
{% endblock %}
{% block javascript %}
<script type="application/javascript">
function open_console(uuid) {
window.open("/{% url 'console' %}/?token=" + uuid, "", "width=850,height=485");
}
</script>
{% block script %}
<script>
function open_console(uuid) {
window.open("{% url 'console' %}?token=" + uuid, "", "width=850,height=485");
}
</script>
<script>
function goto_compute() {
var compute = $("#compute_select").val();
window.location = "/create/" + compute + "/";
}
</script>
{% endblock %}

View file

@ -64,17 +64,17 @@
</div>
{% endblock %}
{% block script %}
<script>
$(document).ready(function () {
$('#forward_select').change(function (eventObject) {
if ($(this).val() == 'bridge') {
$('.bridge_name_form_group').show();
$('.bridge_name_form_group_dhcp').hide();
} else {
$('.bridge_name_form_group').hide();
$('.bridge_name_form_group_dhcp').show();
}
}).change();
});
</script>
<script>
$(document).ready(function () {
$('#forward_select').change(function (eventObject) {
if ($(this).val() == 'bridge') {
$('.bridge_name_form_group').show();
$('.bridge_name_form_group_dhcp').hide();
} else {
$('.bridge_name_form_group').hide();
$('.bridge_name_form_group_dhcp').show();
}
}).change();
});
</script>
{% endblock %}