_template-choose.html 1.52 KB
Newer Older
1 2
{% load i18n %}

3
<div class="alert alert-info" id="template-choose-alert">
4 5 6 7 8
  {% if perms.vm.create_base_template %}
    {% trans "Customize an existing template or create a brand new one from scratch." %}
  {% else %}
    {% trans "Customize an existing template." %}
  {% endif %}
9 10
</div>

11 12
<form action="{% url "dashboard.views.template-choose" %}" method="POST"
  id="template-choose-form">
13
  {% csrf_token %}
14 15 16 17 18 19 20 21 22
  <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 %}
23
    {% if perms.vm.create_base_template %}
24 25 26 27
    <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>
28
    {% endif %}
Biró Vince committed
29
    <button type="submit" id="template-choose-next-button" class="btn btn-success pull-right">{% trans "Asd" %}</button>
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
    <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>