2011-09-07 02:57:47 +00:00
|
|
|
|
{% extends "myhome_base.html" %}
|
2011-10-12 16:17:48 +00:00
|
|
|
|
{% load seahub_tags %}
|
2011-08-16 13:05:42 +00:00
|
|
|
|
|
2012-05-04 13:36:36 +00:00
|
|
|
|
{% block main_panel %}
|
|
|
|
|
<div id="repo-page" class="ovhd">
|
2012-05-05 12:35:08 +00:00
|
|
|
|
<h2>{{repo.props.name}}</h2>
|
2012-05-05 05:57:42 +00:00
|
|
|
|
<div class="side fright">
|
|
|
|
|
<p>{{repo.props.desc}}</p>
|
|
|
|
|
<p>大小:{{ repo_size|filesizeformat }}</p>
|
2012-05-05 12:35:08 +00:00
|
|
|
|
|
|
|
|
|
{% if not repo.props.encrypted %}
|
2012-05-07 02:59:19 +00:00
|
|
|
|
{% if is_owner or repo_ap == 'public' or share_to_me %}
|
2012-05-05 12:35:08 +00:00
|
|
|
|
<p class="latest-commit mgt10">
|
|
|
|
|
{{ latest_commit.props.desc }}<br />
|
|
|
|
|
<span class="author">by
|
|
|
|
|
{% if latest_commit.props.creator_name %}
|
|
|
|
|
{{ latest_commit.props.creator_name }}
|
|
|
|
|
{% else %}
|
|
|
|
|
未知
|
|
|
|
|
{% endif %}
|
|
|
|
|
</span>
|
|
|
|
|
<span class="time">{{ latest_commit.props.ctime|tsstr_sec }}</span>
|
|
|
|
|
</p>
|
|
|
|
|
<a href="{{ SITE_ROOT }}repo/history/{{repo.props.id}}/" class="more">更多历史...</a>
|
|
|
|
|
|
2012-05-05 05:57:42 +00:00
|
|
|
|
<p class="mgt10">
|
2012-05-05 12:35:08 +00:00
|
|
|
|
<span class="item-name">WEB匿名访问:</span>
|
|
|
|
|
{% if is_owner %}
|
|
|
|
|
{% if repo_ap == 'public' %}
|
|
|
|
|
<input type="checkbox" name="repo-access-switch" id="repo-access-switch" checked="checked" autocomplete="off" /><label for="repo-access-switch">开启</label>
|
|
|
|
|
{% else %}
|
|
|
|
|
<input type="checkbox" name="repo-access-switch" id="repo-access-switch" autocomplete="off" /><label for="repo-access-switch">开启</label>
|
|
|
|
|
{% endif %}
|
|
|
|
|
<br /><span class="tip">开启后,任何人都能够访问该目录</span>
|
|
|
|
|
{% else %}
|
|
|
|
|
<span>只有同步目录拥有者可设置</span>
|
|
|
|
|
{% endif %}
|
2012-05-04 13:36:36 +00:00
|
|
|
|
</p>
|
2012-05-05 12:35:08 +00:00
|
|
|
|
{% endif %}
|
2012-05-07 02:59:19 +00:00
|
|
|
|
{% endif %}
|
2012-05-04 13:36:36 +00:00
|
|
|
|
</div>
|
2012-05-05 05:57:42 +00:00
|
|
|
|
<div class="main fleft">
|
2012-05-07 02:59:19 +00:00
|
|
|
|
{% if repo.props.encrypted %}
|
2012-05-05 12:35:08 +00:00
|
|
|
|
<p>该同步目录已加密,不能在线查看。</p>
|
2012-05-07 02:59:19 +00:00
|
|
|
|
{% else %}
|
|
|
|
|
{% if not is_owner and repo_ap == 'own' and not share_to_me %}
|
|
|
|
|
<p>该同步目录web匿名访问未开启,不能在线查看。</p>
|
|
|
|
|
{% else %}
|
2012-05-12 12:42:27 +00:00
|
|
|
|
<table>
|
2012-05-07 02:59:19 +00:00
|
|
|
|
<tr>
|
2012-05-12 12:42:27 +00:00
|
|
|
|
<th width="70%">名字</th>
|
|
|
|
|
<th width="30%">操作</th>
|
2012-05-07 02:59:19 +00:00
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
{% for dirent in dirs %}
|
|
|
|
|
<tr>
|
|
|
|
|
{% if dirent.is_dir %}
|
|
|
|
|
<td><a href="{{ SITE_ROOT }}repo/{{ repo.props.id }}/?root_id={{ dirent.props.obj_id }}">{{ dirent.props.obj_name }}</a></td>
|
|
|
|
|
<td></td>
|
|
|
|
|
{% else %}
|
|
|
|
|
<td>{{ dirent.props.obj_name }}</td>
|
|
|
|
|
<td>
|
2012-05-16 07:22:04 +00:00
|
|
|
|
<a href="{{ SITE_ROOT }}repo/view/{{ repo.props.id }}/{{ dirent.props.obj_id }}/?file_name={{ dirent.props.obj_name }}" class="">查看</a>
|
|
|
|
|
<a href="{{ SITE_ROOT }}repo/download/{{ repo.props.id }}/{{ dirent.props.obj_id }}/?file_name={{ dirent.props.obj_name }}" class="">下载</a>
|
2012-05-07 02:59:19 +00:00
|
|
|
|
</td>
|
|
|
|
|
{% endif %}
|
|
|
|
|
</tr>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</table>
|
|
|
|
|
{% endif %}
|
2012-05-04 13:36:36 +00:00
|
|
|
|
{% endif %}
|
|
|
|
|
</div>
|
|
|
|
|
<div id="public-access-start-confirm" class="hide">
|
|
|
|
|
<p>确定要开启吗?</p>
|
|
|
|
|
<button id="public-access-start-btn">确定</button>
|
|
|
|
|
<button id="public-access-start-cancel-btn" class="simplemodal-close">取消</button>
|
|
|
|
|
</div>
|
2012-03-30 05:49:32 +00:00
|
|
|
|
</div>
|
2011-08-16 13:05:42 +00:00
|
|
|
|
{% endblock %}
|
2011-10-18 07:41:48 +00:00
|
|
|
|
|
|
|
|
|
{% block extra_script %}
|
|
|
|
|
<script type="text/javascript">
|
2012-04-25 13:44:23 +00:00
|
|
|
|
if ($('#repo-access-switch').attr('checked')) {
|
|
|
|
|
$('#repo-access-switch').click(function() {
|
2012-04-26 02:57:36 +00:00
|
|
|
|
location.href = "{{ SITE_ROOT }}repo/setap/{{ repo.props.id}}/?ap=own";
|
2012-04-25 13:44:23 +00:00
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
$('#repo-access-switch').click(function() {
|
|
|
|
|
$('#public-access-start-confirm').modal({appendTo:"#main", containerCss:{padding:18}});
|
|
|
|
|
});
|
|
|
|
|
}
|
2012-04-20 05:34:52 +00:00
|
|
|
|
|
2012-04-24 08:15:29 +00:00
|
|
|
|
$('#public-access-start-btn').click(function() {
|
2012-04-26 02:57:36 +00:00
|
|
|
|
location.href = "{{ SITE_ROOT }}repo/setap/{{ repo.props.id}}/?ap=public";
|
2012-04-24 08:15:29 +00:00
|
|
|
|
});
|
|
|
|
|
$('#public-access-start-cancel-btn').click(function() {
|
|
|
|
|
$('#repo-access-switch').attr('checked', false);
|
|
|
|
|
});
|
2012-05-04 08:18:27 +00:00
|
|
|
|
|
|
|
|
|
$('.view-btn').click(function() {
|
|
|
|
|
location.href = $(this).attr('data');
|
|
|
|
|
});
|
2012-05-14 13:51:55 +00:00
|
|
|
|
|
|
|
|
|
$(".download-btn").click(function() {
|
|
|
|
|
window.open($(this).attr("data"));
|
|
|
|
|
});
|
2011-10-18 07:41:48 +00:00
|
|
|
|
</script>
|
|
|
|
|
{% endblock %}
|