1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-18 00:00:00 +00:00
Files
seahub/templates/myhome.html

213 lines
6.6 KiB
HTML
Raw Normal View History

{% extends "myhome_base.html" %}
2012-06-28 16:58:09 +08:00
{% load seahub_tags avatar_tags %}
2011-05-08 15:19:58 +08:00
{% block nav_myhome_class %}class="cur"{% endblock %}
{% block left_panel %}
2012-05-24 20:19:14 +08:00
<h3>我的基本信息</h3>
<div class="home-profile w100 ovhd">
2012-06-21 15:26:03 +08:00
{% avatar myname 48 %}
{% if nickname %}
<p class="fleft">{{ nickname }}</p>
{% else %}
<p class="fleft">暂无昵称 <a href="{{ SITE_ROOT }}profile/"><img src="{{ MEDIA_URL }}img/edit_12.png" alt="编辑" title="编辑" /></a></p>
{% endif %}
</div>
2012-06-28 19:24:27 +08:00
{% if grpmsg_reply_list %}
<span class="new-reply"><a href="{{ SITE_ROOT }}group/reply/new/">{{ grpmsg_reply_list|length }}条留言有新回复</a></span>
2012-06-27 19:56:11 +08:00
{% endif %}
<h3>已用空间</h3>
<p>{{ quota_usage|filesizeformat }} / 2 GB</p>
2012-06-20 19:39:21 +08:00
{% if request.user.org %}
<h3>所属企业</h3>
<p>{{ request.user.org.org_name }}</p>
{% endif %}
2012-05-15 14:29:37 +08:00
<h3>我管理的小组</h3>
{% if groups_manage %}
2012-05-21 15:08:34 +08:00
<ul>
{% 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>
2012-06-25 21:40:18 +08:00
{% if group.new_msg %}
<span class="tips">(新留言)</span>
{% endif %}
</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 %}
2012-05-21 15:08:34 +08:00
<ul>
{% 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>
2012-06-25 21:40:18 +08:00
{% if group.new_msg %}
<span class="tips">(新留言)</span>
{% endif %}
</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 %}
2012-06-12 10:13:14 +08:00
{% if messages %}
<ul class="messages">
{% for message in messages %}
{% if message.tags == 'info' %}
<li class="notification">共享给 {{ message }} 成功,请前往<a href="{{ SITE_ROOT }}shareadmin/">共享管理</a>查看。</li>
{% endif %}
{% if message.tags == 'error' %}
<li class="error">共享给 {{ message }} 失败</li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
{% 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>
<th width="34%">名字</th>
2012-06-28 16:58:09 +08:00
<th width="34%">描述</th>
<th width="20%">最后更新时间</th>
<th width="12%">操作</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-06-28 16:58:09 +08:00
{% if repo.latest_modify %}
<td>{{ repo.latest_modify|translate_commit_time }}</td>
{% else %}
<td>—— ——</td>
{% endif %}
2012-03-29 15:36:15 +08:00
<td>
2012-05-29 11:25:49 +08:00
<img src="{{ MEDIA_URL }}img/download-20.png" data="{{ repo.props.id }}" class="download-btn vh" title="下载" alt="下载" />
<img src="{{ MEDIA_URL }}img/share-20.png" data="{{ repo.props.id }}" class="repo-share-btn vh" title="共享" alt="共享" />
2012-06-05 19:38:28 +08:00
<img src="{{ MEDIA_URL }}img/delete-20.png" data="{{ SITE_ROOT }}repo/remove/{{ repo.props.id }}/?next={{ request.path }}" class="repo-delete-btn vh" title="删除" alt="删除" />
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>
2012-06-28 16:58:09 +08:00
<th width="25%">描述</th>
<th width="20%">最后更新时间</th>
2012-05-31 19:21:07 +08:00
<th width="10%">操作</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-06-28 16:58:09 +08:00
{% if repo.latest_modify %}
<td>{{ repo.latest_modify|translate_commit_time }}</td>
{% else %}
<td>—— ——</td>
{% endif %}
2012-03-29 15:36:15 +08:00
<td>
2012-05-29 11:25:49 +08:00
<img src="{{ MEDIA_URL }}img/download-20.png" data="{{ repo.props.id }}" class="download-btn vh" title="下载" alt="下载" />
<img src="{{ MEDIA_URL }}img/delete-20.png" data="{{ SITE_ROOT }}shareadmin/removeshare/?repo_id={{ repo.id }}&from={{ repo.shared_email }}&to={{ request.user }}" class="unshare-btn vh" title="取消共享" alt="取消共享" />
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-06-12 10:13:14 +08:00
<form id="repo-share-form" action="{{ SITE_ROOT }}share/add/" method="post" name="repo-share-form" class="hide">
2012-05-15 10:59:16 +08:00
<label>邮箱或小组:</label><br />
2012-06-12 10:13:14 +08:00
<textarea id="email_or_group" name="email_or_group"></textarea><br />
<input id="repo_id" type="hidden" name="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() {
2012-06-12 10:13:14 +08:00
$("#repo_id").val($(this).attr("data"));
2012-05-19 18:29:52 +08:00
$("#repo-share-form").modal({appendTo: "#main"});
2012-06-12 10:13:14 +08:00
addAutocomplete('#email_or_group', '#repo-share-form', share_list);
});
//check before post
$('#share-submit-btn').click(function() {
2012-06-12 10:13:14 +08:00
if (!$.trim($('#email_or_group').attr('value'))) {
$('#repo-share-form .error').removeClass('hide');
return false;
}
return true;
});
2012-05-07 16:33:36 +08:00
addConfirmTo($('.repo-delete-btn'));
addConfirmTo($('.unshare-btn'), '确定要取消共享?');
$(".download-btn").click(function() {
window.open('{{ SITE_ROOT }}seafile_access_check/?repo_id=' + $(this).attr('data'));
});
//show op images when mouse hover on
$("table tr:gt(0)").hover(
function() {
2012-05-29 11:25:49 +08:00
$(this).find('img').css('cursor', 'pointer').removeClass('vh');
},
function() {
2012-05-29 11:25:49 +08:00
$(this).find('img').addClass('vh');
}
);
2012-05-07 16:33:36 +08:00
});
</script>
2011-05-08 15:19:58 +08:00
{% endblock %}