1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-10-22 03:16:34 +00:00
Files
seahub/templates/useradmin.html
2012-03-23 12:01:00 +08:00

104 lines
3.0 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends "myhome_base.html" %}
{% block nav_useradmin_class %}class="cur"{% endblock %}
{% block left_panel %}
<ul>
<li><a href="{{ SITE_ROOT }}useradmin/add/">添加用户</a></li>
</ul>
{% endblock %}
{% block right_panel %}
<h2>所有用户</h2>
<table class="user-list">
<tr>
<th>邮箱</th>
<th>是否激活</th>
<th>个人 ID</th>
<th>角色</th>
<th>操作</th>
</tr>
{% for user in users %}
<tr>
<td>{{ user.email }}</td>
{% if user.is_active %}
<td>已激活</td>
{% else %}
<td><button data="{{ SITE_ROOT }}useradmin/activate/{{ user.id }}/" class="activate">激活</button></td>
{% endif %}
{% if user.profile %}
<td>{{ user.profile.ccnet_user_id }}</td>
<td>
{% for role in user.role_list %}
{{ role }}<span class="small-action-link">(<a href="{{ SITE_ROOT }}useradmin/{{ user.profile.ccnet_user_id }}/role/remove/?role={{ role }}">删除</a>)</span>
{% endfor %}
</td>
{% else %}
<td></td>
<td></td>
{% endif %}
<td>
{% if user.profile %}
<button class="add-role-btn" userid="{{ user.profile.ccnet_user_id }}" email="{{ user.email }}">添加角色</button>
{% endif %}
<button class="remove-user-btn" userid="{{ user.id }}">删除用户</button>
</td>
</tr>
{% endfor %}
</table>
<div class="hidden">
<form id="add-role-form" action="" method="post">
<p><span id="user_email"></span> 的新角色 (即 MyClient 等)</p>
<input id="id_role" type="text" name="role" /><br/>
<input id="id_summit" type="submit" value="Submit" />
</form>
</div>
<div id="dialog-delete-confirm" class="hide">
<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>确认要删除该用户?</p>
<button class="remove-user-confirm-btn" data="">删除</button>
<button class="simplemodal-close">取消</button>
</div>
{% endblock %}
{% block extra_script %}
<script type="text/javascript">
$('.activate').each(function(){
$(this).click(function(){
location.href = $(this).attr('data');
});
});
$(function() {
$(".add-role-btn").each(function() {
$(this).click(function() {
var url = "{{ SITE_ROOT }}useradmin/" + $(this).attr("userid") + "/role/add/";
$("#add-role-form").attr('action', url);
$("#add-role-form #user_email").html($(this).attr("email"));
$("#add-role-form").modal({appendTo: "#main"});
});
});
//delete user dialog
var del_user_id = "";
$(".remove-user-btn").each(function() {
$(this).click(function() {
del_user_id = $(this).attr("userid");
$("#dialog-delete-confirm").modal({appendTo: "#main"});
});
});
$("button.remove-user-confirm-btn").click(function() {
location.href = "{{ SITE_ROOT }}useradmin/" + del_user_id + "/user/remove/";
});
});
</script>
{% endblock %}