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">
|
2012-05-20 12:32:21 +00:00
|
|
|
|
{{ latest_commit.props.desc|translate_commit_desc }}<br />
|
2012-05-05 12:35:08 +00:00
|
|
|
|
<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
|
|
|
|
{% if is_owner %}
|
2012-05-17 11:43:50 +00:00
|
|
|
|
<span class="item-name">WEB匿名访问:</span>
|
2012-05-05 12:35:08 +00:00
|
|
|
|
{% 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>
|
|
|
|
|
{% 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-17 14:43:47 +00:00
|
|
|
|
<div>
|
2012-05-18 03:40:39 +00:00
|
|
|
|
{% for name, link in zipped|slice:":-1" %}
|
|
|
|
|
<a href="{{ SITE_ROOT }}repo/{{ repo.id }}/?p={{ link|urlencode }}">{{ name }}</a> /
|
|
|
|
|
{% endfor %}
|
|
|
|
|
{% for name, link in zipped|slice:"-1:" %}
|
|
|
|
|
{{ name }}
|
2012-05-17 14:43:47 +00:00
|
|
|
|
{% endfor %}
|
|
|
|
|
</div>
|
2012-05-12 12:42:27 +00:00
|
|
|
|
<table>
|
2012-05-07 02:59:19 +00:00
|
|
|
|
<tr>
|
2012-05-17 15:11:46 +00:00
|
|
|
|
<th width="5%"></th>
|
2012-05-18 09:48:58 +00:00
|
|
|
|
<th width="55%">名字</th>
|
|
|
|
|
<th width="10%">大小</th>
|
2012-05-12 12:42:27 +00:00
|
|
|
|
<th width="30%">操作</th>
|
2012-05-07 02:59:19 +00:00
|
|
|
|
</tr>
|
2012-05-19 13:01:21 +00:00
|
|
|
|
|
|
|
|
|
{% for dirent in dir_list %}
|
2012-05-07 02:59:19 +00:00
|
|
|
|
<tr>
|
2012-05-18 07:21:53 +00:00
|
|
|
|
<td><img src="{{ MEDIA_URL }}img/folder-icon-24.png" /></td>
|
2012-05-18 03:40:39 +00:00
|
|
|
|
<td><a href="{{ SITE_ROOT }}repo/{{ repo.id }}/?p={{ path|urlencode }}{{ dirent.obj_name|urlencode }}">{{ dirent.obj_name }}</a></td>
|
2012-05-07 02:59:19 +00:00
|
|
|
|
<td></td>
|
2012-05-18 09:48:58 +00:00
|
|
|
|
<td></td>
|
2012-05-19 13:01:21 +00:00
|
|
|
|
</tr>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
|
|
{% for dirent in file_list %}
|
|
|
|
|
<tr>
|
2012-05-18 07:21:53 +00:00
|
|
|
|
<td><img src="{{ MEDIA_URL }}img/{{ dirent.obj_name|file_icon_filter }}" /></td>
|
2012-05-07 02:59:19 +00:00
|
|
|
|
<td>{{ dirent.props.obj_name }}</td>
|
2012-05-18 09:48:58 +00:00
|
|
|
|
<td>{{ dirent.file_size|filesizeformat }}</td>
|
2012-05-07 02:59:19 +00:00
|
|
|
|
<td>
|
2012-05-19 03:50:05 +00:00
|
|
|
|
<a class="op" href="{{ SITE_ROOT }}repo/{{ repo.props.id }}/{{ dirent.props.obj_id }}/?file_name={{ dirent.props.obj_name }}&op=view">查看</a>
|
|
|
|
|
<a class="op" href="{{ SITE_ROOT }}repo/{{ repo.props.id }}/{{ dirent.props.obj_id }}/?file_name={{ dirent.props.obj_name }}&op=download">下载</a>
|
2012-05-07 02:59:19 +00:00
|
|
|
|
</td>
|
|
|
|
|
</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);
|
|
|
|
|
});
|
2011-10-18 07:41:48 +00:00
|
|
|
|
</script>
|
|
|
|
|
{% endblock %}
|