lease-edit.html 3.86 KB
Newer Older
1 2
{% extends "dashboard/base.html" %}
{% load i18n %}
3
{% load crispy_forms_tags %}
4

5 6 7
{% block title-page %}{% trans "Edit lease" %}{% endblock %}

{% block content %}
8
<div class="row">
9
  <div class="col-md-7">
10 11
    <div class="panel panel-default">
      <div class="panel-heading">
12
        <a class="pull-right btn btn-default btn-xs" href="{% url "dashboard.views.template-list" %}">{% trans "Back" %}</a>
Kálmán Viktor committed
13
        <h3 class="no-margin"><i class="fa fa-clock-o"></i> {% trans "Edit lease" %}</h3>
14 15
      </div>
      <div class="panel-body">
16 17 18
        {% with form=form %}
          {% include "display-form-errors.html" %}
        {% endwith %}
19 20 21 22
        {% crispy form %}
      </div>
    </div>
  </div>
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 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84

  <div class="col-md-5">
    <div class="panel panel-default">
      <div class="panel-heading">
        <h4 class="no-margin"><i class="icon-group"></i> {% trans "Manage access" %}</h4>
      </div>
      <div class="panel-body">
        <form action="{% url "dashboard.views.lease-acl" pk=object.pk %}" method="post">{% csrf_token %}
          <table class="table table-striped table-with-form-fields" id="template-access-table">
            <thead>
              <tr>
                <th></th>
                <th>{% trans "Who" %}</th>
                <th>{% trans "What" %}</th>
                <th><i class="icon-remove"></i></th>
              </tr>
            </thead>
            <tbody>
              {% for i in acl.users %}
              <tr>
                <td>
                  <i class="icon-user"></i>
                </td>
                <td>
                  <a href="{% url "dashboard.views.profile" username=i.user.username %}"
                    title="{{ i.user.username }}">
                    {% include "dashboard/_display-name.html" with user=i.user show_org=True %}
                  </a>
                </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>
                  <input type="checkbox" name="remove-u-{{i.user.id}}" title="{% trans "Remove" %}"/>
                </td>
              </tr>
              {% endfor %}
              {% for i in acl.groups %}
              <tr>
                <td><i class="icon-group"></i></td>
                <td>
                  <a href="{% url "dashboard.views.group-detail" pk=i.group.pk %}">
                    {{i.group}}
                  </a>
                </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>
                  <input type="checkbox" name="remove-g-{{i.group.id}}" title="{% trans "Remove" %}"/>
                </td>
              </tr>
              {% endfor %}
              <tr><td><i class="icon-plus"></i></td>
85
                  <td><input type="text" class="form-control" name="name"
86
                      placeholder="{% trans "Name of group or user" %}"></td>
87
                  <td><select class="form-control" name="level">
88 89 90 91 92 93 94 95 96 97 98 99 100 101
                          {% 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>
102 103 104
</div>

{% endblock %}