_template-create-1.html 1.26 KB
Newer Older
1 2
{% load i18n %}

3 4 5 6
<div class="alert alert-info">
  {% trans "Customize an existing template or create a brand new one from scratch!" %}
</div>

7 8
<form action="{% url "dashboard.views.template-choose" %}" method="POST">
  {% csrf_token %}
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 36 37 38 39 40 41
  <div class="template-choose-list">
    {% for t in templates %}
    <div class="panel panel-default template-choose-list-element">
      <input type="radio" name="parent" value="{{ t.pk }}"/>
      {{ t.name }} - {{ t.system }}
      <small>Cores: {{ t.num_cores }} RAM: {{ t.ram_size }}</small>
      <div class="clearfix"></div>
    </div>
    {% endfor %}
    <div class="panel panel-default template-choose-list-element">
      <input type="radio" name="parent" value="base_vm"/>
      {% trans "Create a new base VM without disk" %}
    </div>
    <button type="submit" class="btn btn-success pull-right">{% trans "Next" %}</button>
    <div class="clearfix"></div>
  </div>
</form>

<script>
  $(function() {
    $(".template-choose-list-element").click(function() {
      $("input", $(this)).prop("checked", true);
    });
    $(".template-choose-list-element").hover(
      function() {
        $("small", $(this)).stop().fadeIn(200);
      },
      function() {
        $("small", $(this)).stop().fadeOut(200);
      }
    );
  });
</script>