1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-31 06:34:40 +00:00
Files
seahub/templates/myhome.html

148 lines
4.2 KiB
HTML
Raw Normal View History

{% extends "myhome_base.html" %}
2011-05-08 15:19:58 +08:00
{% block nav_myhome_class %}class="cur"{% endblock %}
{% block left_panel %}
<h3>已用空间</h3>
<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>
{% if groups_manage %}
<ul class="w100 ovhd">
{% for group in groups_manage %}
<li class="mygroup">
<a href="{{ SITE_ROOT }}group/{{ group.props.id }}/"><img src="{{ MEDIA_URL }}img/group.jpg" alt="" /></a><br />
<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-15 11:23:28 +08:00
<h3>我参加的小组</h3>
{% if groups_join %}
<ul class="w100 ovhd">
{% for group in groups_join %}
<li class="mygroup">
<a href="{{ SITE_ROOT }}group/{{ group.props.id }}/"><img src="{{ MEDIA_URL }}img/group.jpg" alt="" /></a><br />
<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 %}
{% endblock %}
2011-05-08 15:19:58 +08:00
{% block right_panel %}
{% if output_msg %}
{% 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 %}
{% endif %}
2011-10-13 00:17:48 +08:00
<h3>我拥有的同步目录</h3>
2012-03-22 20:33:27 +08:00
{% if owned_repos %}
<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>
<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>
<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 %}
<table>
2012-03-11 21:35:44 +08:00
<tr>
<th width="25%">名字</th>
2012-04-26 22:15:07 +08:00
<th width="20%">共享来源</th>
<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>
<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
<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 />
<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="" />
<p class="error hide">输入不能为空。</p>
<input type="submit" value="提交" id="share-submit-btn" />
2012-04-24 14:21:52 +08:00
</form>
{% endblock %}
{% block extra_script %}
<script type="text/javascript">
$(function() {
//repo-share-form share-list autocomplete
var share_list = [];
{% for contact in contacts %}
share_list.push('{{ contact.contact_email }}');
{% endfor %}
2012-05-07 16:33:36 +08:00
2012-05-15 10:59:16 +08:00
{% for group in groups %}
share_list.push('{{ group.props.group_name }} <{{ group.props.creator_name }}>');
2012-05-15 10:59:16 +08:00
{% endfor %}
$(".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);
});
//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
addConfirmTo($('.repo-delete-btn'));
$(".download-btn").click(function() {
window.open('{{ SITE_ROOT }}seafile_access_check/?repo_id=' + $(this).attr('data'));
});
2012-05-07 16:33:36 +08:00
});
</script>
2011-05-08 15:19:58 +08:00
{% endblock %}