2012-02-21 17:11:58 +08:00
{% extends "myhome_base.html" %}
2012-03-22 20:33:27 +08:00
{% block nav_useradmin_class %}class="cur"{% endblock %}
2012-03-09 10:31:35 +08:00
{% block left_panel %}
< ul >
< li > < a href = "{{ SITE_ROOT }}useradmin/add/" > 添加用户< / a > < / li >
< / ul >
{% endblock %}
2012-02-21 17:11:58 +08:00
{% block right_panel %}
< h2 > 所有用户< / h2 >
2012-03-22 20:33:27 +08:00
< table class = "user-list" >
2012-02-21 17:11:58 +08:00
< tr >
2012-04-13 13:21:48 +08:00
< th width = "70%" > 邮箱< / th >
< th width = "20%" > 是否激活< / th >
2012-04-01 14:25:25 +08:00
< th width = "10%" > 操作< / th >
2012-02-21 17:11:58 +08:00
< / tr >
{% for user in users %}
< tr >
2012-04-13 13:21:48 +08:00
< td > < a href = "{{ SITE_ROOT }}useradmin/info/{{ user.props.email }}" > {{ user.props.email }}< / a > < / td >
2012-04-11 19:48:20 +08:00
{% if user.props.is_active %}
2012-03-22 20:33:27 +08:00
< td > 已激活< / td >
{% else %}
2012-04-11 19:48:20 +08:00
< td > < button data = "{{ SITE_ROOT }}useradmin/activate/{{ user.props.id }}/" class = "activate" > 激活< / button > < / td >
2012-03-22 20:33:27 +08:00
{% endif %}
2012-04-13 13:21:48 +08:00
<!--
2012-04-02 23:56:41 +08:00
{% if user.userid_list %}
< td > {{ user.userid_list|first }}< / td >
2012-04-01 21:55:33 +08:00
{% else %}
< td > < / td >
{% endif %}
2012-02-21 17:11:58 +08:00
< td >
{% for role in user.role_list %}
2012-04-13 13:21:48 +08:00
{{ role }} < button data = "{{ SITE_ROOT }}useradmin/{{ user.profile.ccnet_user_id }}/role/remove/?role={{ role }}" class = "role-delete-btn" > 删除< / button > < br / >
2012-02-21 17:11:58 +08:00
{% endfor %}
< / td >
2012-04-13 13:21:48 +08:00
-->
2012-03-17 14:05:21 +08:00
< td >
2012-03-19 11:11:37 +08:00
{% if user.profile %}
2012-03-26 13:59:44 +08:00
<!-- <button class="add - role - btn" userid="{{ user.profile.ccnet_user_id }}" email="{{ user.email }}">添加角色</button> -->
2012-03-19 11:11:37 +08:00
{% endif %}
2012-04-11 19:48:20 +08:00
< button class = "remove-user-btn" data = "{{ SITE_ROOT }}useradmin/{{ user.props.id }}/user/remove/" > 删除< / button >
2012-03-17 14:05:21 +08:00
< / td >
2012-02-21 17:11:58 +08:00
< / tr >
{% endfor %}
< / table >
2012-03-27 11:11:21 +08:00
< form id = "add-role-form" action = "" method = "post" class = "hide" >
< p > < span id = "user_email" > < / span > 的新角色 (即 MyClient 等): < / p >
< input id = "id_role" type = "text" name = "role" / > < br / >
< input id = "id_summit" type = "submit" value = "提交" / >
< / form >
2012-02-21 17:11:58 +08:00
{% endblock %}
{% block extra_script %}
2012-03-22 20:33:27 +08:00
< script type = "text/javascript" >
$('.activate').each(function(){
$(this).click(function(){
location.href = $(this).attr('data');
});
});
$(".add-role-btn").each(function() {
2012-03-27 17:42:08 +08:00
$(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"});
});
});
2012-03-26 16:52:10 +08:00
//delete confirm
2012-03-27 17:42:08 +08:00
addConfirmTo($('.remove-user-btn'));
addConfirmTo($('.role-delete-btn'));
2012-02-21 17:11:58 +08:00
< / script >
{% endblock %}