2012-05-17 06:02:47 +00:00
|
|
|
|
{% extends "admin_base.html" %}
|
2012-02-21 09:11:58 +00:00
|
|
|
|
|
2012-03-22 12:33:27 +00:00
|
|
|
|
{% block nav_useradmin_class %}class="cur"{% endblock %}
|
2012-03-09 02:31:35 +00:00
|
|
|
|
{% block left_panel %}
|
2012-05-17 12:39:37 +00:00
|
|
|
|
<h3>操作</h3>
|
|
|
|
|
<ul class="with-bg">
|
2012-03-09 02:31:35 +00:00
|
|
|
|
<li><a href="{{ SITE_ROOT }}useradmin/add/">添加用户</a></li>
|
|
|
|
|
</ul>
|
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
|
2012-02-21 09:11:58 +00:00
|
|
|
|
{% block right_panel %}
|
2012-06-20 11:39:21 +00:00
|
|
|
|
{% if messages %}
|
|
|
|
|
<ul class="messages">
|
|
|
|
|
{% for message in messages %}
|
|
|
|
|
{% if message.tags == 'info' %}
|
|
|
|
|
<li class="notification">邮件发送成功。</li>
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% if message.tags == 'error' %}
|
|
|
|
|
<li class="error">邮件发送失败。</li>
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</ul>
|
|
|
|
|
{% endif %}
|
2012-02-21 09:11:58 +00:00
|
|
|
|
|
2012-05-17 12:39:37 +00:00
|
|
|
|
<h3>所有用户</h3>
|
|
|
|
|
<table>
|
2012-02-21 09:11:58 +00:00
|
|
|
|
<tr>
|
2012-06-20 11:39:21 +00:00
|
|
|
|
<th width="50%">邮箱</th>
|
|
|
|
|
<th width="20%">是否激活</th>
|
|
|
|
|
<th width="20%">是否企业帐号</th>
|
2012-04-01 06:25:25 +00:00
|
|
|
|
<th width="10%">操作</th>
|
2012-02-21 09:11:58 +00:00
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
{% for user in users %}
|
|
|
|
|
<tr>
|
2012-05-03 02:52:43 +00:00
|
|
|
|
<td><a href="{{ SITE_ROOT }}useradmin/info/{{ user.props.email }}/">{{ user.props.email }}</a></td>
|
2012-04-11 11:48:20 +00:00
|
|
|
|
{% if user.props.is_active %}
|
2012-03-22 12:33:27 +00:00
|
|
|
|
<td>已激活</td>
|
|
|
|
|
{% else %}
|
2012-04-11 11:48:20 +00:00
|
|
|
|
<td><button data="{{ SITE_ROOT }}useradmin/activate/{{ user.props.id }}/" class="activate">激活</button></td>
|
2012-03-22 12:33:27 +00:00
|
|
|
|
{% endif %}
|
2012-06-20 11:39:21 +00:00
|
|
|
|
{% if user.is_org_user %}
|
|
|
|
|
<td>是</td>
|
|
|
|
|
{% else %}
|
|
|
|
|
<td></td>
|
|
|
|
|
{% endif %}
|
2012-03-17 06:05:21 +00:00
|
|
|
|
<td>
|
2012-03-19 03:11:37 +00:00
|
|
|
|
{% if user.profile %}
|
2012-03-26 05:59:44 +00:00
|
|
|
|
<!-- <button class="add-role-btn" userid="{{ user.profile.ccnet_user_id }}" email="{{ user.email }}">添加角色</button> -->
|
2012-03-19 03:11:37 +00:00
|
|
|
|
{% endif %}
|
2012-04-21 03:05:59 +00:00
|
|
|
|
{% if not user.is_self %}
|
2012-06-20 11:39:21 +00:00
|
|
|
|
<button class="remove-user-btn" data="{{ SITE_ROOT }}useradmin/remove/{{ user.props.id }}/">删除</button>
|
2012-04-21 03:05:59 +00:00
|
|
|
|
{% endif %}
|
2012-03-17 06:05:21 +00:00
|
|
|
|
</td>
|
2012-02-21 09:11:58 +00:00
|
|
|
|
</tr>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</table>
|
|
|
|
|
|
2012-03-27 03:11:21 +00: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 09:11:58 +00:00
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
{% block extra_script %}
|
2012-03-22 12:33:27 +00:00
|
|
|
|
<script type="text/javascript">
|
2012-05-22 08:21:16 +00:00
|
|
|
|
$('.activate').each(function(){
|
|
|
|
|
$(this).click(function(){
|
|
|
|
|
location.href = $(this).attr('data');
|
2012-03-22 12:33:27 +00:00
|
|
|
|
});
|
2012-05-22 08:21:16 +00:00
|
|
|
|
});
|
2012-03-22 12:33:27 +00:00
|
|
|
|
$(".add-role-btn").each(function() {
|
2012-05-22 08:21:16 +00:00
|
|
|
|
$(this).click(function() {
|
|
|
|
|
var url = "{{ SITE_ROOT }}useradmin/" + $(this).attr("userid") + "/role/add/";
|
|
|
|
|
$("#add-role-form").attr('action', url);
|
|
|
|
|
$("#user_email").html($(this).attr("email"));
|
|
|
|
|
$("#add-role-form").modal({appendTo: "#main"});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2012-03-26 08:52:10 +00:00
|
|
|
|
//delete confirm
|
2012-03-27 09:42:08 +00:00
|
|
|
|
addConfirmTo($('.remove-user-btn'));
|
|
|
|
|
addConfirmTo($('.role-delete-btn'));
|
2012-02-21 09:11:58 +00:00
|
|
|
|
</script>
|
|
|
|
|
{% endblock %}
|