template-edit.html 4.22 KB
Newer Older
1 2
{% extends "dashboard/base.html" %}
{% load i18n %}
3
{% load sizefieldtags %}
4 5 6 7
{% load crispy_forms_tags %} 
{% block content %}

<div class="row">
8
  <div class="col-md-8">
9 10 11
    <div class="panel panel-default">
      <div class="panel-heading">
        <a class="pull-right btn btn-default btn-xs" href="{% url "dashboard.views.template-list" %}">Back</a>
12
        <h3 class="no-margin"><i class="icon-puzzle-piece"></i> {% trans "Edit template" %}</h3>
13 14
      </div>
      <div class="panel-body">
15 16 17
        {% with form=form %}
          {% include "display-form-errors.html" %}
        {% endwith %}
18 19 20 21
        {% crispy form %}
      </div>
    </div>
  </div>
22 23 24 25

  <div class="col-md-4">
    <div class="panel panel-default">
      <div class="panel-heading">
26
        <h4 class="no-margin"><i class="icon-group"></i> {% trans "Manage access"  %}</h4>
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
      </div>
      <div class="panel-body">
        <form action="{% url "dashboard.views.template-acl" pk=object.pk %}" method="post">{% csrf_token %}
          <table class="table table-striped table-with-form-fields">
            <thead><tr><th></th><th>{% trans "Who" %}</th><th>{% trans "What" %}</th><th></th></tr></thead>
            <tbody>
                {% for i in acl.users %}
                <tr><td><i class="icon-user"></i></td><td>{{i.user}}</td>
                    <td><select class="form-control" name="perm-u-{{i.user.id}}">
                            {% for id, name in acl.levels %}
                            <option{%if id = i.level%} selected="selected"{%endif%} value="{{id}}">{{name}}</option>
                            {% endfor %}
                    </select></td>
                    <td><a href="#" class="btn btn-link btn-xs"><i class="icon-remove"><span class="sr-only">{% trans "remove" %}</span></i></a></td></tr>
                {% endfor %}
                {% for i in acl.groups %}
                <tr><td><i class="icon-group"></i></td><td>{{i.group}}</td>
                    <td><select class="form-control" name="perm-g-{{i.group.id}}">
                            {% for id, name in acl.levels %}
                            <option{%if id = i.level%} selected="selected"{%endif%} value="{{id}}">{{name}}</option>
                            {% endfor %}
                    </select></td>
                    <td><a href="#" class="btn btn-link btn-xs"><i class="icon-remove"><span class="sr-only">{% trans "remove" %}</span></i></a></td></tr>
                {% endfor %}
                <tr><td><i class="icon-plus"></i></td>
                    <td><input type="text" class="form-control" name="perm-new-name"
                        placeholder="{% trans "Name of group or user" %}"></td>
                    <td><select class="form-control" name="perm-new">
                            {% for id, name in acl.levels %}
                            <option value="{{id}}">{{name}}</option>
                            {% endfor %}
                    </select></td><td></td>
                </tr>
          </tbody>
          </table>
          <div class="form-actions">
            <button type="submit" class="btn btn-success">{% trans "Save" %}</button>
          </div>
        </form>
      </div>
    </div>
68
    
69
        
70 71
    <div class="panel panel-default">
      <div class="panel-heading">
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
        <h4 class="no-margin"><i class="icon-file"></i> {% trans "Disk list" %}</h4>
      </div>
      <div class="panel-body">
        <ul style="list-style: none; padding-left: 0;">
        {% for d in disks %}
          <li>
            {% include "dashboard/_disk-list-element.html" %}
          </li>
        {% endfor %}
        </ul>
      </div>
    </div>
        
    <div class="panel panel-default">
      <div class="panel-heading">
        <h4 class="no-margin"><i class="icon-folder-open"></i> {% trans "Create new disk" %}</h4>
88 89 90 91 92 93 94 95 96
      </div>
      <div class="panel-body">
        <form action="{% url "dashboard.views.disk-add" %}" method="POST">
          {% crispy disk_add_form %} 
        </form>
      </div>
    </div>
  </div><!-- .col-md-4 -->
</div><!-- .row -->
97

98

99 100 101 102 103 104 105 106 107 108 109 110 111 112
<style>
  fieldset {
    margin-top: 40px;
  }
  fieldset legend {
    font-weight: bold;
  }
</style>
<script>
  $(function() {
    $("#hint_id_num_cores, #hint_id_priority, #hint_id_ram_size").hide();
  });
</script>

113
{% endblock %}