kotti/templates/site-setup/users.pt
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
i18n:domain="Kotti"
metal:use-macro="api.macro('kotti:templates/site-setup/master.pt')">
<div metal:fill-slot="content">
<h1>${api.page_title}</h1>
<ul class="nav nav-tabs">
<li class="${active_tab == 'search' and 'active'}">
<a href="#search-tab" data-toggle="tab" i18n:translate="">
Search user(s) / group(s)
</a>
</li>
<li class="${active_tab == 'add_user' and 'active'}">
<a href="#add-user-tab" data-toggle="tab" i18n:translate="">
Add user
</a>
</li>
<li class="${active_tab == 'add_group' and 'active'}">
<a href="#add-group-tab" data-toggle="tab" i18n:translate="">
Add group
</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane ${active_tab == 'search' and 'active'}"
id="search-tab">
<div class="panel panel-default" style="margin-top:2em;">
<div class="panel-heading">
<h3 class="panel-title" i18n:translate="">Find users or groups</h3>
</div>
<div class="panel-body">
<form action="${request.url}" id="form-principal-search"
method="post" class="form">
<div class="control-group">
<label for="search-query" i18n:translate="">
User- / groupname
</label>
<input type="search"
class="form-control"
name="query"
id="search-query"
value="${request.params.get('query')}"
placeholder="Search users and groups"
i18n:attributes="placeholder" />
<span class="help-block" i18n:translate="">
Blank search text finds all.
</span>
</div>
<button type="submit" name="search" class="btn btn-primary">
<i class="glyphicon glyphicon-search"></i>
<span i18n:translate="">Search</span>
</button>
</form>
</div>
</div>
<form action="${request.url}" id="form-global-roles" method="post"
tal:condition="entries">
<h2 i18n:translate="">Assign global roles</h2>
<table class="table table-bordered table-hover">
<thead>
<tr>
<th i18n:translate="">Type</th>
<th i18n:translate="">Name</th>
<th tal:repeat="role available_roles">
${role.title}
</th>
</tr>
</thead>
<tbody>
<tr tal:repeat="entry entries"
class="entry ${repeat.entry.even and 'even' or 'odd'}">
<td tal:define="is_group entry[0].name.startswith('group:');
is_user not is_group">
<span tal:condition="is_user" i18n:translate="">User</span>
<span tal:condition="is_group" i18n:translate="">Group</span>
</td>
<td>
<img src="${api.avatar_url(entry[0])}" alt="Gravatar"
i18n:attributes="alt"/>
<a tal:attributes="href request.resource_url(api.root, 'setup-user', query={'name': entry[0].name})">${entry[0].title}</a>
<span tal:condition="entry[0].email"><${entry[0].email}></span>
</td>
<td tal:repeat="role available_roles">
<input type="checkbox" title="Assign role" i18n:attributes="title"
name="role::${entry[0].name}::${role.name}"
checked="${role.name in entry[1][0] and 'checked' or None}"
disabled="${role.name in entry[1][1] and 'disabled' or None}"
/>
<input type="hidden"
name="orig-role::${entry[0].name}::${role.name}"
value="${role.name in entry[1][0] and '1' or None}"
/>
</td>
</tr>
</tbody>
</table>
<button type="submit" name="apply" class="btn btn-primary">
<i class="glyphicon glyphicon-save"></i>
<span i18n:translate="">
Apply changes
</span>
</button>
</form>
</div>
<div class="tab-pane ${active_tab == 'add_user' and 'active'}"
id="add-user-tab">
<h2 i18n:translate="">Add new user</h2>
<form tal:replace="structure user_addform"></form>
</div>
<div class="tab-pane ${active_tab == 'add_group' and 'active'}"
id="add-group-tab">
<h2 i18n:translate="">Add new group</h2>
<form tal:replace="structure group_addform"></form>
</div>
</div>
</div>
</html>