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

4 5 6
{% block content %}
<div class="body-content">
  <div class="page-header">
7 8 9 10 11 12
    <div class="pull-right" style="padding-top: 15px;">
      <a title="{% trans "Rename" %}" href="#" class="btn btn-default btn-xs group-details-rename-button"><i class="icon-pencil"></i></a>
      <a title="{% trans "Delete" %}" data-group-pk="{{ group.pk }}" class="btn btn-default btn-xs real-link group-delete" href="{% url "dashboard.views.delete-group" pk=group.pk %}"><i class="icon-trash"></i></a>
      <a title="{% trans "Help" %}" href="#" class="btn btn-default btn-xs group-details-help-button"><i class="icon-question"></i></a>
    </div>
   <h1>
13 14 15 16 17 18
      <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>
19
      </div>
20 21 22
      <div id="group-details-h1-name">
        {{ group.name }} 
      </div>
23
    </h1>
24 25 26 27 28 29 30 31 32 33 34 35 36
    <div class="group-details-help js-hidden">
      <ul style="list-style: none;">
        <li>
          <strong>{% trans "Rename" %}:</strong>
          {% trans "Change the name of the group." %}
        </li>
        <li>
          <strong>{% trans "Delete" %}:</strong>
          {% trans "Delete group." %}
        </li>
      </ul>
    </div>
 </div>
37
  <div class="row">
38
    <div class="col-md-12" id="group-detail-pane">
39
      <div class="panel panel-default" id="group-detail-panel">
40
        <div class="tab-content panel-body" id="group-form-body">
41
          <h3>{% trans "User list"|capfirst %}</h3>
42
<form action="" method="post">{% csrf_token %}
43
<table class="table table-striped table-with-form-fields table-bordered" id="group-detail-user-table">
44
    <tbody>
45 46 47 48 49
    {% if perms.auth.add_user %}
	    <p class="pull-right">
	    <a href="{% url "dashboard.views.create-user" group.pk %}" class="btn btn-success">{% trans "Create user" %}</a>
	    </p>
    {% endif %}
50
      <thead><tr><th></th><th>{% trans "Who" %}</th><th>{% trans "Remove" %}</th></tr></thead>
51
        {% for i in users %}
52
	  <tr>
53 54 55 56
            <td>
              <i class="icon-user"></i>
            </td>
            <td>
57
              <a href="{% url "dashboard.views.profile" username=i.username %}" title="{{ i.username }}"
58
                >{% include "dashboard/_display-name.html" with user=i show_org=True %}</a>
59
            </td>
60 61 62 63
	    <td>
              <a data-group_pk="{{ group.pk }}" data-member_pk="{{i.pk}}" href="{% url "dashboard.views.remove-user" member_pk=i.pk group_pk=group.pk %}" class="real-link delete-from-group btn btn-link btn-xs"><i class="icon-remove"><span class="sr-only">{% trans "remove" %}</span></i></a>
            </td>
          </tr>
64
        {% endfor %}
65 66 67 68 69
        <tr>
          <td><i class="icon-plus"></i></td>
          <td colspan="2">
            <input type="text" class="form-control" name="list-new-name"placeholder="{% trans "Name of user" %}">
          </td>
70 71 72
        </tr>
  </tbody>
  </table>
73 74
  <textarea name="list-new-namelist" class="form-control" 
    placeholder="{% trans "List of usernames (one per line)." %}"></textarea>
75 76 77 78 79
  <div class="form-actions">
    <button type="submit" class="btn btn-success">{% trans "Save" %}</button>
  </div>
  </form>

80

81
<h3 id="group-detail-perm-header">{% trans "Permissions"|capfirst %}</h3>
82
  <form action="{{acl.url}}" method="post">{% csrf_token %}
83 84 85 86 87 88
  <table class="table table-striped table-with-form-fields table-bordered" id="group-detail-perm-table">
    <thead>
      <tr>
        <th></th><th>{% trans "Who" %}</th><th>{% trans "What" %}</th><th>{% trans "Remove" %}</th>
      </tr>
    </thead>
89
    <tbody>
90 91
    {% for i in acl.users %}
    <tr>
92 93 94 95
      <td>
        <i class="icon-user"></i>
      </td>
      <td>
96
        <a href="{% url "dashboard.views.profile" username=i.user.username %}" title="{{ i.user.username }}"
97
          >{% include "dashboard/_display-name.html" with user=i.user show_org=True %}</a>
98
      </td>
99 100 101 102
      <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>
103
        {% endfor %}
104 105 106 107 108 109 110 111
        </select>
      </td>
      <td class="user-remove"><a data-group_pk="{{ group.pk }}" data-member_pk="{{i.user.pk }}" href="{% url "dashboard.views.remove-acluser" member_pk=i.user.pk group_pk=group.pk %}" class="real-link delete-from-group 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>
112 113 114 115 116 117
        <td>
          <i class="icon-group"></i>
        </td>
        <td>
          <a href="{% url "dashboard.views.group-detail" pk=i.group.pk %}">{{ i.group }}</a>
        </td>
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
        <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-group_pk="{{ i.pk }}"data-member_pk="{{i.group.pk }}" href="{% url "dashboard.views.remove-aclgroup" member_pk=i.group.pk group_pk=group.pk %}" class="real-link delete-from-group 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>
144 145
  </tbody>
  </table>
146

147
  <div class="form-actions">
148 149 150
    <button type="submit" class="btn btn-success">{% trans "Save" %}</button>
  </div>
  </form>
151 152


153 154 155 156 157 158
	</div>
     </div>
    </div>
  </div>
</div>
<script src="{{ STATIC_URL}}dashboard/group-details.js"></script>
159
{% endblock %}