1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-11 04:36:48 +00:00

refactor(templates): the last inline styles that Bootstrap covers

- The VM list's power forms (style="display:inline") are d-inline.
- The fields scripts show and hide are d-none, and the scripts add and
  remove that class instead of calling jQuery's show() and hide(),
  which could not undo it: the custom memory boxes of the Resize tab,
  the ISO upload's error message and the clone dialog's metadata row.
- The please-wait dialog's full bar is w-100.
- The create-VM pages' own 56rem width (.create-vm) goes: pages stop
  at 960px now, about the same.
- static/css/font-awesome.min.css goes: no page loaded it, no element
  used its classes and its fonts were never in the repository.
This commit is contained in:
catborise 2026-10-27 20:16:49 +03:00
parent 1cb1f8ac6a
commit 3a4554bcbf
9 changed files with 18 additions and 27 deletions

View file

@ -28,7 +28,7 @@
<span class="spinner-border spinner-border-sm" aria-hidden="true"></span>
<span id="upload-status-text">{% trans "Starting upload..." %}</span>
</div>
<div id="upload-error-message" class="alert alert-danger mt-3" style="display: none;"></div>
<div id="upload-error-message" class="alert alert-danger mt-3 d-none"></div>
</div>
<div class="modal-footer">
<input type="hidden" name="iso_upload" value="true">

View file

@ -124,7 +124,7 @@
</select>
</div>
</div>
<div class="row meta-prealloc" style="display: none;">
<div class="row meta-prealloc d-none">
<label class="col-sm-3 col-form-label">{% trans "Metadata" %}</label>
<div class="col-sm-6">
<input type="checkbox" name="meta_prealloc" value="true">
@ -184,7 +184,7 @@
var form = $(this).closest('form');
var convert = form.find('.volume-convert').prop('checked');
form.find('.format-convert').toggle(convert);
form.find('.meta-prealloc').toggle(convert && form.find('.image-format').val() == 'qcow2');
form.find('.meta-prealloc').toggleClass('d-none', !(convert && form.find('.image-format').val() == 'qcow2'));
});
$(document).ready(function() {
@ -208,7 +208,7 @@
var fileName = file.name;
var errorMessage = $('#upload-error-message');
if (!/\.iso$/i.test(fileName) || fileName.length <= 4) {
errorMessage.text("{% trans 'Only .iso files can be uploaded.'|escapejs %}").show();
errorMessage.text("{% trans 'Only .iso files can be uploaded.'|escapejs %}").removeClass("d-none");
return;
}
if (file.size === 0) {
@ -235,7 +235,7 @@
var uploadStatusText = $('#upload-status-text');
var uploadButton = $('#isoUploadForm button[type="submit"]');
errorMessage.hide();
errorMessage.addClass("d-none");
uploadStatusText.text("{% trans 'Starting upload...'|escapejs %}");
uploadStatus.removeClass('d-none').addClass('d-flex');
uploadButton.prop('disabled', true);
@ -299,7 +299,7 @@
pendingUpload = null;
}
var errorText = jqXHR.responseJSON && jqXHR.responseJSON.error ? jqXHR.responseJSON.error : "{% trans 'An error occurred during upload.'|escapejs %}";
errorMessage.text(errorText).show();
errorMessage.text(errorText).removeClass("d-none");
uploadDialog.show();
}
});