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

5 6
{% block title-page %}{{ group.name }} | {% trans "group" %}{% endblock %}

7 8 9
{% block content %}
<div class="body-content">
  <div class="page-header">
10
    <div class="pull-right" style="padding-top: 15px;">
11
      <a title="{% trans "Rename" %}" href="#" class="btn btn-default btn-xs group-details-rename-button"><i class="fa fa-pencil"></i></a>
12
      <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="fa fa-trash-o"></i></a>
13
      <a title="{% trans "Help" %}" href="#" class="btn btn-default btn-xs group-details-help-button"><i class="fa fa-question"></i></a>
14 15
    </div>
   <h1>
16 17 18
      <div id="group-details-rename">
        <form action="" method="POST" id="group-details-rename-form">
          {% csrf_token %}
19
          <input id="group-details-rename-name" class="form-control" name="new_name" type="text" value="{{ group.name }}"/>
20 21
          <button type="submit" id="group-details-rename-submit" class="btn">{% trans "Rename" %}</button>
        </form>
22
      </div>
23
      <div id="group-details-h1-name">
24
        {{ group.name }}
25 26 27
        {% if group.groupprofile.org_id %}
        <small>{{group.groupprofile.org_id}}</small>
        {% endif %}
28
      </div>
29
    </h1>
30 31 32 33 34 35 36 37 38 39 40 41 42
    <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>
43
  <div class="row">
44
    <div class="col-md-12" id="group-detail-pane">
45
      <div class="panel panel-default" id="group-detail-panel">
46
        <div class="tab-content panel-body" id="group-form-body">
47 48 49 50 51 52

          <form method="POST" action="{% url "dashboard.views.group-update" pk=group.pk %}">
{% csrf_token %}
{% crispy group_profile_form %}
</form>

53 54
<hr />

55 56 57 58 59
<h3>{% trans "User list"|capfirst %}
    {% if perms.auth.add_user %}
        <a href="{% url "dashboard.views.create-user" group.pk %}" class="btn btn-success pull-right">{% trans "Create user" %}</a>
    {% endif %}
</h3>
60
<form action="" method="post">{% csrf_token %}
61
<table class="table table-striped table-with-form-fields table-bordered" id="group-detail-user-table">
62
    <tbody>
63
      <thead><tr><th></th><th>{% trans "Who" %}</th><th>{% trans "Remove" %}</th></tr></thead>
64
        {% for i in users %}
65
	  <tr>
66
            <td>
67
              <i class="fa fa-user"></i>
68 69
            </td>
            <td>
70
              <a href="{% url "dashboard.views.profile" username=i.username %}" title="{{ i.username }}"
71
                >{% include "dashboard/_display-name.html" with user=i show_org=True %}</a>
72
            </td>
73
	    <td>
74
              <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="fa fa-times"><span class="sr-only">{% trans "remove" %}</span></i></a>
75 76
            </td>
          </tr>
77
        {% endfor %}
78 79 80
        {% for i in future_users %}
	  <tr>
            <td>
81
              <i class="fa fa-user text-muted"></i>
82 83 84 85 86
            </td>
            <td> {{ i.org_id }} </td>
	    <td>
              <a href="{% url "dashboard.views.remove-future-user" member_org_id=i.org_id group_pk=group.pk %}"
                  class="real-link btn-link btn-xs">
87
                  <i class="fa fa-times"><span class="sr-only">{% trans "remove" %}</span></i></a>
88 89 90
            </td>
          </tr>
        {% endfor %}
91
        <tr>
92
          <td><i class="fa fa-plus"></i></td>
93
          <td colspan="2">
94
            {{addmemberform.new_member}}
95
          </td>
96 97 98
        </tr>
  </tbody>
  </table>
99
  <textarea name="new_members" class="form-control"
100
    placeholder="{% trans "Add multiple users at once (one identifier per line)." %}"></textarea>
101 102 103 104 105
  <div class="form-actions">
    <button type="submit" class="btn btn-success">{% trans "Save" %}</button>
  </div>
  </form>

106 107
  <hr />
<h3 id="group-detail-perm-header">{% trans "Access permissions"|capfirst %}</h3>
108
{% include "dashboard/_manage_access.html" with table_id="group-detail-perm-table" %}
109 110 111 112 113 114 115 116 117
{% if user.is_superuser %}
  <hr />

<script type="text/javascript" src="/static/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="/static/admin/js/jquery.init.js"></script>
{{ group_perm_form.media }}

<h3>{% trans "Group permissions" %}</h3>

118
<div id="group-detail-permissions">
119 120 121 122
{% crispy group_perm_form %}
</div>

<link rel="stylesheet" type="text/css" href="/static/admin/css/widgets.css" />
123

124
{% endif %}
125 126 127 128 129
	</div>
     </div>
    </div>
  </div>
</div>
130
{% endblock %}