_template-create.html 1.46 KB
Newer Older
1
{% load i18n %}
2
{% load crispy_forms_tags %}
3

4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

<form action="" method="POST">
{% with form=form %}
  {% include "display-form-errors.html" %}
{% endwith %}

{% csrf_token %}

{{ form.name|as_crispy_field }}

<fieldset class="resources-sliders">
  <legend>{% trans "Resource configuration" %}</legend>
  {% include "dashboard/_resources-sliders.html" with field_priority=form.priority field_num_cores=form.num_cores field_ram_size=form.ram_size %}
  {{ form.max_ram_size|as_crispy_field }}
</fieldset>

<fieldset>
  <legend>{% trans "Virtual machine settings" %}</legend>
{{ form.arch|as_crispy_field }}
{{ form.access_method|as_crispy_field }}
{{ form.boot_menu|as_crispy_field }}
{{ form.raw_data|as_crispy_field }}
{{ form.req_traits|as_crispy_field }}
{{ form.description|as_crispy_field }}
{{ form.system|as_crispy_field }}
</fieldset>
<fieldset>
  <legend>{% trans "External resources" %}</legend>
{{ form.networks|as_crispy_field }}
{{ form.lease|as_crispy_field }}

{% if show_lease_create %}
36
  <div class="alert alert-warning">
37
    {% trans "You haven't created any leases yet, but you need one to create a template." %}
38 39 40
    <a href="{% url "dashboard.views.lease-create" %}">{% trans "Create a new lease now." %}</a>
  </div>
{% endif %}
41 42 43 44 45
{{ form.tags|as_crispy_field }}
</fieldset>

<input type="submit" value="{% trans "Create new template" %}" class="btn btn-success">
</form>
46

47 48 49 50 51 52 53 54 55

<style>
  fieldset {
    margin-top: 40px;
  }
  fieldset legend {
    font-weight: bold;
  }
</style>