1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-07-30 22:34:53 +00:00
seahub/templates/repo.html

86 lines
2.8 KiB
HTML
Raw Normal View History

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-04-17 03:41:38 +00:00
{% block left_panel %}
<ul>
<li><a href="{{ SITE_ROOT }}repo/history/{{repo.props.id}}/">历史</a></li>
2012-04-17 03:41:38 +00:00
</ul>
{% endblock %}
2011-08-16 13:05:42 +00:00
{% block right_panel %}
2011-10-12 16:17:48 +00:00
<h2>{{repo.props.name}}</h2>
2012-04-24 08:15:29 +00:00
<p class="repo-desc">{{repo.props.desc}}</p>
<p class="repo-size">大小:{{ repo_size|filesizeformat }}</p>
2012-04-24 08:15:29 +00:00
<p>
<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 %}
<span class="tip">开启后,任何人都能够访问该目录</span>
{% else %}
<span>只有同步目录拥有者可设置</span>
{% endif %}
</p>
<h3>文件及目录列表</h3>
{% if dirs %}
<table class="repo-list default">
2012-04-24 08:15:29 +00:00
<tr>
<th width="70%">名字</th>
<th width="30%">操作</th>
2012-04-24 08:15:29 +00:00
</tr>
{% for dirent in dirs %}
2012-04-24 08:15:29 +00:00
<tr>
{% if dirent.is_dir %}
<td><a href="{{ SITE_ROOT }}repo/dir/{{ 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 %}
2012-04-24 08:15:29 +00:00
</tr>
{% endfor %}
</table>
{% else %}
<p>暂无</p>
{% endif %}
2011-10-18 07:41:48 +00:00
2012-04-24 08:15:29 +00:00
<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>
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);
});
$('.view-btn').click(function() {
location.href = $(this).attr('data');
});
2011-10-18 07:41:48 +00:00
</script>
{% endblock %}