1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-10 20:26:48 +00:00
webvirtcloud/storages/templates/create_stg_vol_block.html
catborise 3a4554bcbf 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.
2026-10-27 20:37:30 +03:00

71 lines
4.3 KiB
HTML

{% load i18n %}
{% load django_bootstrap5 %}
{% load bootstrap_icons %}
{% if request.user.is_superuser %}
{% if state != 0 %}
{% if pool == "iso" %}
<a href="#IsoUpload" class="btn btn-success float-end" data-bs-toggle="modal">
<span aria-hidden="true">{% bs_icon 'plus-circle-fill' %} </span>
</a>
<!-- Modal Upload -->
<div class="modal fade" id="IsoUpload" tabindex="-1" role="dialog" aria-labelledby="IsoUploadLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{% trans "Upload ISO Image" %}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<form id="isoUploadForm" enctype="multipart/form-data" method="post" role="form" aria-label="Upload iso form">{% csrf_token %}
<div class="modal-body">
<div class="row mb-3">
<label for="id_file" class="col-sm-3 col-form-label">{% trans "Name" %}</label>
<div class="col-sm-9">
<input type="file" name="file" id="id_file" class="form-control" accept=".iso" required>
</div>
</div>
<div id="upload-status" class="d-none align-items-center gap-2 text-primary mt-3" role="status" aria-live="polite">
<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 d-none"></div>
</div>
<div class="modal-footer">
<input type="hidden" name="iso_upload" value="true">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{% trans "Close" %}</button>
<button type="submit" class="btn btn-primary">{% trans "Upload" %}</button>
</div>
</form>
</div> <!-- /.modal-content -->
</div> <!-- /.modal-dialog -->
</div> <!-- /.modal -->
{% else %}
<a href="#AddImage" class="btn btn-success float-end" title="{% trans "Add New Volume" %}" data-bs-toggle="modal">
<span aria-hidden="true">{% bs_icon 'plus-circle-fill' %} </span>
</a>
<!-- Modal Image -->
<div class="modal fade" id="AddImage" tabindex="-1" role="dialog" aria-labelledby="AddImageLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{% trans "Add New Volume" %}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form action="{% url 'create_volume' compute_id pool %}" id="create-volume" method="post" role="form" aria-label="Create volume to storage form">
{% csrf_token %}
{% bootstrap_form form layout='horizontal' %}
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{% trans "Close" %}</button>
<button type="submit" form="create-volume" class="btn btn-primary">{% trans "Create" %}</button>
</div>
</div> <!-- /.modal-content -->
</div> <!-- /.modal-dialog -->
</div> <!-- /.modal -->
{% endif %}
{% endif %}
{% endif %}