group-detail.html 4.92 KB
Newer Older
1 2 3
{% extends "dashboard/base.html" %}
{% load i18n %}

4 5 6 7 8 9 10 11 12 13
{% block content %}
<div class="body-content">
  <div class="page-header">
    <h1>
      <div id="group-details-rename">
        <form action="" method="POST" id="group-details-rename-form">
          {% csrf_token %}
          <input id="group-details-rename-name" class="form-control" name="new_name" type="text" value="{{ group.name }}"/> 
          <button type="submit" id="group-details-rename-submit" class="btn">{% trans "Rename" %}</button>
        </form>
14
      </div>
15 16 17
      <div id="group-details-h1-name">
        {{ group.name }} 
      </div>
18
    </h1>
19 20 21 22
  </div>
  <div class="row">
    <div class="col-md-4" id="group-info-pane">
      <div class="big">
23 24
 	 <div class="btn-group">
          <button type="button" class="btn btn-warning nojs-dropdown-toogle dropdown-toggle" data-toggle="dropdown">Action 		<i class="icon-caret-down"></i></button>
25
          <ul class="nojs-dropdown-menu dropdown-menu" role="menu">
26 27 28
            <li><a href="#" class="group-details-rename-button"><i class="icon-pencil"></i>{% trans "Rename" %}</a></li>
            <li><a data-group-pk="{{ group.pk }}" class="group-delete" href="{% url "dashboard.views.delete-group" pk=group.pk %}"><i class="icon-remove"></i> Discard</a></li>
	</ul>
29 30 31
        </div>
      </div>
    </div>
32 33 34
    <div class="col-md-8" id="group-detail-pane">
      <div class="panel panel-default" id="group-detail-panel">
        <div class="tab-content panel-body">
35

36 37
		<h3>{% trans "User list"|capfirst %}</h3>
<form action="" method="post">{% csrf_token %}
38 39 40 41 42
<table class="table table-striped table-with-form-fields">
    <tbody>
     <thead><tr><th></th><th>{% trans "Who" %}</th><th></th><th></th></tr></thead>
        {% for i in users %}
	<tr><td><i class="icon-user"></i></td><td>{{i.username}}</td>
43
		<td><a data-groupmember-pk="{{i.pk}}" href="{% url "dashboard.views.remove-user" user_pk=i.pk group_pk=group.pk %}?next={{ request.path }}" class="real-link groupmember-delete btn btn-link btn-xs"><i class="icon-remove"><span class="sr-only">{% trans "remove" %}</span></i></a></td></tr>
44 45
        {% endfor %}
        <tr><td><i class="icon-plus"></i></td>
46
            <td><input type="text" class="form-control" name="list-new-name"
47
                placeholder="{% trans "Name of user" %}"></td>
48 49 50
        </tr>
  </tbody>
  </table>
51 52 53 54 55
  <div class="form-actions">
    <button type="submit" class="btn btn-success">{% trans "Save" %}</button>
  </div>
  </form>

56

57 58 59 60 61 62 63 64 65 66 67 68
<h3>{% trans "Permissions"|capfirst %}</h3>
  <form action="{{acl.url}}" 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>
69 70 71 72 73 74 75 76 77 78
	    <td class="user-remove"><a data-groupaclmember-pk="{{i.user.id}}" href="{% url "dashboard.views.remove-acluser" user_pk=i.user.pk group_pk=group.pk %}?next={{ request.path }}" class="real-link groupacl-delete 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-user"></i></td><td>{{ i.group }}</td>
            <td><select class="form-control" name="perm-g-{{ i.group.pk }}">
                    {% for id, name in acl.levels %}
                    <option{%if id = i.level%} selected="selected"{%endif%} value="{{id}}">{{name}}</option>
                    {% endfor %}
            </select></td>
	    <td class="user-remove"><a data-groupaclmember-pk="{{i.group.pk }}" href="{% url "dashboard.views.remove-aclgroup" user_pk=i.group.pk group_pk=group.pk %}?next={{ request.path }}" class="real-link groupacl-delete btn btn-link btn-xs"><i class="icon-remove"><span class="sr-only">{% trans "remove" %}</span></i></a></td></tr>
79 80 81 82 83 84 85 86 87 88 89 90 91
        {% 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>
	  <textarea class="form-control"></textarea>
92

93
  <div class="form-actions">
94 95 96
    <button type="submit" class="btn btn-success">{% trans "Save" %}</button>
  </div>
  </form>
97 98


99 100 101 102 103 104
	</div>
     </div>
    </div>
  </div>
</div>
<script src="{{ STATIC_URL}}dashboard/group-details.js"></script>
105
{% endblock %}