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

<div class="row">
7
  <div class="col-md-8">
8 9 10
    <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>
11
        <h3 class="no-margin"><i class="icon-desktop"></i> {% trans "Edit template" %}</h3>
12 13
      </div>
      <div class="panel-body">
14 15 16
        {% with form=form %}
          {% include "display-form-errors.html" %}
        {% endwith %}
17 18 19 20
        {% crispy form %}
      </div>
    </div>
  </div>
21 22 23 24 25 26 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 class="col-md-4">
    <div class="panel panel-default">
      <div class="panel-heading">
        <h3 class="no-margin"><i class="icon-group"></i> {% trans "Manage access"  %}</h3>
      </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>
  </div>
68 69
</div>

70

71 72 73 74 75 76 77 78 79 80 81 82 83 84
<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>

85
{% endblock %}