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">
|
|
|
|
<div class="side fleft">
|
|
|
|
<p class="repo-desc">{{repo.props.desc}}</p>
|
|
|
|
<p class="repo-size">大小:{{ repo_size|filesizeformat }}</p>
|
|
|
|
<p>
|
|
|
|
<span class="item-name">WEB匿名访问:</span>
|
|
|
|
{% if is_owner %}
|
2012-04-24 08:15:29 +00:00
|
|
|
{% if repo_ap == 'public' %}
|
2012-05-04 13:36:36 +00:00
|
|
|
<input type="checkbox" name="repo-access-switch" id="repo-access-switch" checked="checked" autocomplete="off" /><label for="repo-access-switch">开启</label>
|
2012-04-24 08:15:29 +00:00
|
|
|
{% else %}
|
2012-05-04 13:36:36 +00:00
|
|
|
<input type="checkbox" name="repo-access-switch" id="repo-access-switch" autocomplete="off" /><label for="repo-access-switch">开启</label>
|
2012-04-24 08:15:29 +00:00
|
|
|
{% endif %}
|
2012-05-04 13:36:36 +00:00
|
|
|
<br /><span class="tip">开启后,任何人都能够访问该目录</span>
|
|
|
|
{% else %}
|
|
|
|
<span>只有同步目录拥有者可设置</span>
|
|
|
|
{% endif %}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<div class="main fright">
|
|
|
|
<h2>{{repo.props.name}}</h2>
|
|
|
|
<ul class="recent-commit">
|
|
|
|
{% for commit in recent_commits %}
|
|
|
|
<li>
|
|
|
|
{{ commit.props.desc }}
|
|
|
|
<span class="author">
|
|
|
|
{% if commit.props.creator_name %}
|
|
|
|
by {{ commit.props.creator_name }}
|
|
|
|
{% else %}
|
|
|
|
未知
|
|
|
|
{% endif %}
|
|
|
|
</span>
|
|
|
|
<span class="time">{{ commit.props.ctime|tsstr_sec }}</span>
|
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
<a href="{{ SITE_ROOT }}repo/history/{{repo.props.id}}/" style="font-weight:normal;font-size:12px;color:#333;">更多...</a>
|
|
|
|
|
|
|
|
<h3 class="mgt10">子目录及文件</h3>
|
|
|
|
{% if repo.props.encrypted %}
|
|
|
|
<p>该同步目录已加密,不能在线查看。</p>
|
|
|
|
{% else %}
|
|
|
|
<table class="repo-list">
|
|
|
|
<tr>
|
|
|
|
<th width="60%">名字</th>
|
|
|
|
<th width="40%">操作</th>
|
|
|
|
</tr>
|
2011-10-18 07:41:48 +00:00
|
|
|
|
2012-05-04 13:36:36 +00:00
|
|
|
{% 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>
|
|
|
|
<button data="{{ SITE_ROOT }}repo/view/{{ repo.props.id }}/{{ dirent.props.obj_id }}/?file_name={{ dirent.props.obj_name }}" class="view-btn">查看</button>
|
|
|
|
<button data="{{ SITE_ROOT }}repo/download/{{ repo.props.id }}/{{ dirent.props.obj_id }}/?file_name={{ dirent.props.obj_name }}" class="download-btn">下载</button>
|
|
|
|
</td>
|
|
|
|
{% endif %}
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
|
|
|
{% 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');
|
|
|
|
});
|
2011-10-18 07:41:48 +00:00
|
|
|
</script>
|
|
|
|
{% endblock %}
|