2011-04-30 13:18:32 +08:00
|
|
|
{% extends "myhome_base.html" %}
|
2011-05-08 15:19:58 +08:00
|
|
|
|
2012-05-12 15:52:07 +08:00
|
|
|
{% block nav_myhome_class %}class="cur"{% endblock %}
|
2011-11-01 22:21:01 +08:00
|
|
|
{% block left_panel %}
|
|
|
|
<h3>已用空间</h3>
|
2012-05-03 10:52:43 +08:00
|
|
|
<p>{{ quota_usage|filesizeformat }} / 2 GB</p>
|
2012-05-15 11:23:28 +08:00
|
|
|
|
2012-05-15 14:29:37 +08:00
|
|
|
<h3>我管理的小组</h3>
|
2012-05-16 21:33:35 +08:00
|
|
|
{% if groups_manage %}
|
|
|
|
<ul class="w100 ovhd">
|
|
|
|
{% for group in groups_manage %}
|
|
|
|
<li class="mygroup">
|
2012-05-17 15:59:59 +08:00
|
|
|
<a href="{{ SITE_ROOT }}group/{{ group.props.id }}/"><img src="{{ MEDIA_URL }}img/group.jpg" alt="" /></a><br />
|
2012-05-16 21:33:35 +08:00
|
|
|
<a href="{{ SITE_ROOT }}group/{{ group.props.id }}/">{{ group.props.group_name }}</a>
|
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
{% else %}
|
|
|
|
<p>暂无</p>
|
2012-05-15 11:23:28 +08:00
|
|
|
{% endif %}
|
2012-05-16 21:33:35 +08:00
|
|
|
|
2012-05-15 11:23:28 +08:00
|
|
|
<h3>我参加的小组</h3>
|
2012-05-16 21:33:35 +08:00
|
|
|
{% if groups_join %}
|
|
|
|
<ul class="w100 ovhd">
|
|
|
|
{% for group in groups_join %}
|
|
|
|
<li class="mygroup">
|
2012-05-17 15:59:59 +08:00
|
|
|
<a href="{{ SITE_ROOT }}group/{{ group.props.id }}/"><img src="{{ MEDIA_URL }}img/group.jpg" alt="" /></a><br />
|
2012-05-16 21:33:35 +08:00
|
|
|
<a href="{{ SITE_ROOT }}group/{{ group.props.id }}/">{{ group.props.group_name }}</a>
|
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
{% else %}
|
|
|
|
<p>暂无</p>
|
2012-05-15 11:23:28 +08:00
|
|
|
{% endif %}
|
|
|
|
|
2011-11-01 22:21:01 +08:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
2011-05-08 15:19:58 +08:00
|
|
|
{% block right_panel %}
|
2012-04-27 13:43:17 +08:00
|
|
|
{% if output_msg %}
|
2012-05-09 13:13:15 +08:00
|
|
|
{% for key, value in output_msg.items %}
|
|
|
|
{% if key == 'info_msg' %}
|
|
|
|
<p class="notification">{{ value }} 请前往<a href="{{ SITE_ROOT }}shareadmin/">共享管理</a>查看。</p>
|
|
|
|
{% endif %}
|
|
|
|
{% if key == 'err_msg' %}
|
|
|
|
<p class="error">{{ value }}</p>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
2012-04-27 13:43:17 +08:00
|
|
|
{% endif %}
|
2011-10-13 00:17:48 +08:00
|
|
|
|
2012-03-26 13:59:44 +08:00
|
|
|
<h3>我拥有的同步目录</h3>
|
2012-03-22 20:33:27 +08:00
|
|
|
{% if owned_repos %}
|
2012-05-16 21:33:35 +08:00
|
|
|
<table>
|
2011-10-13 00:17:48 +08:00
|
|
|
<tr>
|
2012-04-24 22:31:24 +08:00
|
|
|
<th width="30%">名字</th>
|
|
|
|
<th width="50%">描述</th>
|
|
|
|
<th width="20%">操作</th>
|
2011-10-13 00:17:48 +08:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
{% for repo in owned_repos %}
|
|
|
|
<tr>
|
2012-04-25 11:18:49 +08:00
|
|
|
<td><a href="{{ SITE_ROOT }}repo/{{ repo.props.id }}/">{{ repo.props.name }}</a></td>
|
2011-10-13 00:17:48 +08:00
|
|
|
<td>{{ repo.props.desc }}</td>
|
2012-03-29 15:36:15 +08:00
|
|
|
<td>
|
2012-05-14 21:51:55 +08:00
|
|
|
<button data="{{ repo.props.id }}" class="download-btn">下载</button>
|
2012-04-24 14:21:52 +08:00
|
|
|
<button data="{{ repo.props.id }}" class="repo-share-btn">共享</button>
|
2012-04-17 11:41:38 +08:00
|
|
|
<button data="{{ SITE_ROOT }}repo/remove/{{ repo.props.id }}/" class="repo-delete-btn">删除</button>
|
2012-03-29 15:36:15 +08:00
|
|
|
</td>
|
2011-10-13 00:17:48 +08:00
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
2012-03-22 20:33:27 +08:00
|
|
|
{% else %}
|
|
|
|
<p>暂无</p>
|
|
|
|
{% endif %}
|
2011-10-13 00:17:48 +08:00
|
|
|
|
2012-04-26 22:15:07 +08:00
|
|
|
<h3>共享给我的同步目录</h3>
|
|
|
|
{% if in_repos %}
|
2012-05-16 21:33:35 +08:00
|
|
|
<table>
|
2012-03-11 21:35:44 +08:00
|
|
|
<tr>
|
2012-05-16 21:33:35 +08:00
|
|
|
<th width="25%">名字</th>
|
2012-04-26 22:15:07 +08:00
|
|
|
<th width="20%">共享来源</th>
|
2012-05-16 21:33:35 +08:00
|
|
|
<th width="40%">描述</th>
|
2012-04-26 22:15:07 +08:00
|
|
|
<th width="15%">操作</th>
|
2012-03-11 21:35:44 +08:00
|
|
|
</tr>
|
|
|
|
|
2012-04-26 22:15:07 +08:00
|
|
|
{% for repo in in_repos %}
|
2012-03-11 21:35:44 +08:00
|
|
|
<tr>
|
2012-04-26 22:15:07 +08:00
|
|
|
<td><a href="{{ SITE_ROOT }}repo/{{ repo.props.id }}">{{ repo.props.name }}</a></td>
|
|
|
|
<td>{{ repo.props.shared_email }}</td>
|
2012-03-11 21:35:44 +08:00
|
|
|
<td>{{ repo.props.desc }}</td>
|
2012-03-29 15:36:15 +08:00
|
|
|
<td>
|
2012-05-14 21:51:55 +08:00
|
|
|
<button data="{{ repo.props.id }}" class="download-btn">下载</button>
|
2012-03-29 15:36:15 +08:00
|
|
|
</td>
|
2012-03-11 21:35:44 +08:00
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
2012-03-22 20:33:27 +08:00
|
|
|
{% else %}
|
|
|
|
<p>暂无</p>
|
|
|
|
{% endif %}
|
2012-04-24 14:21:52 +08:00
|
|
|
|
2012-04-27 13:43:17 +08:00
|
|
|
<form id="repo-share-form" action="{{ SITE_ROOT }}home/my/" method="post" name="repo-share-form" class="hide">
|
2012-05-15 10:59:16 +08:00
|
|
|
<label>邮箱或小组:</label><br />
|
2012-05-09 13:13:15 +08:00
|
|
|
<textarea id="to_email" name="to_email"></textarea><br />
|
2012-04-24 14:21:52 +08:00
|
|
|
<input id="share_repo_id" type="hidden" name="share_repo_id" value="" />
|
2012-05-09 13:13:15 +08:00
|
|
|
<p class="error hide">输入不能为空。</p>
|
|
|
|
<input type="submit" value="提交" id="share-submit-btn" />
|
2012-04-24 14:21:52 +08:00
|
|
|
</form>
|
|
|
|
|
2012-03-26 16:52:10 +08:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block extra_script %}
|
|
|
|
<script type="text/javascript">
|
2012-05-09 13:13:15 +08:00
|
|
|
$(function() {
|
2012-05-16 21:33:35 +08:00
|
|
|
//repo-share-form share-list autocomplete
|
|
|
|
var share_list = [];
|
2012-05-09 13:13:15 +08:00
|
|
|
{% for contact in contacts %}
|
2012-05-16 21:33:35 +08:00
|
|
|
share_list.push('{{ contact.contact_email }}');
|
2012-05-09 13:13:15 +08:00
|
|
|
{% endfor %}
|
2012-05-07 16:33:36 +08:00
|
|
|
|
2012-05-15 10:59:16 +08:00
|
|
|
{% for group in groups %}
|
2012-05-16 21:33:35 +08:00
|
|
|
share_list.push('{{ group.props.group_name }} <{{ group.props.creator_name }}>');
|
2012-05-15 10:59:16 +08:00
|
|
|
{% endfor %}
|
|
|
|
|
2012-05-09 13:13:15 +08:00
|
|
|
$(".repo-share-btn").click(function() {
|
|
|
|
$("#share_repo_id").val($(this).attr("data"));
|
2012-05-19 18:29:52 +08:00
|
|
|
$("#repo-share-form").modal({appendTo: "#main"});
|
|
|
|
addAutocomplete('#to_email', '#repo-share-form', share_list);
|
2012-05-09 13:13:15 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
//check before post
|
|
|
|
$('#share-submit-btn').click(function() {
|
|
|
|
if (!$.trim($('#to_email').attr('value'))) {
|
|
|
|
$('#repo-share-form .error').removeClass('hide');
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
});
|
2012-05-07 16:33:36 +08:00
|
|
|
|
2012-05-09 13:13:15 +08:00
|
|
|
addConfirmTo($('.repo-delete-btn'));
|
2012-05-14 21:51:55 +08:00
|
|
|
|
|
|
|
$(".download-btn").click(function() {
|
2012-05-16 14:10:54 +08:00
|
|
|
window.open('{{ SITE_ROOT }}seafile_access_check/?repo_id=' + $(this).attr('data'));
|
2012-05-14 21:51:55 +08:00
|
|
|
});
|
|
|
|
|
2012-05-07 16:33:36 +08:00
|
|
|
});
|
2012-03-26 16:52:10 +08:00
|
|
|
</script>
|
2011-05-08 15:19:58 +08:00
|
|
|
{% endblock %}
|