1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-18 00:00:00 +00:00
Files
seahub/templates/repo.html
2012-04-26 10:59:02 +08:00

74 lines
2.3 KiB
HTML

{% extends "myhome_base.html" %}
{% load seahub_tags %}
{% block left_panel %}
<ul>
{% if is_owner %}
<li><a href="{{ SITE_ROOT }}repo/dir/{{ repo.props.id }}/">浏览</a></li>
{% else %}
{% if repo_ap == 'public' %}
<li><a href="{{ SITE_ROOT }}repo/dir/{{ repo.props.id }}/">浏览</a></li>
{% endif %}
{% endif %}
</ul>
{% endblock %}
{% block right_panel %}
<h2>{{repo.props.name}}</h2>
<p class="repo-desc">{{repo.props.desc}}</p>
<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>
<table>
<tr>
<th width="20%">修改时间</th>
<th width="80%">描述</th>
</tr>
{% for commit in recent_commits %}
<tr>
<td>{{ commit.props.ctime|tsstr_sec }}</td>
<td>{{ commit.props.desc }}</td>
</tr>
{% endfor %}
</table>
<a href="{{ SITE_ROOT }}repo/history/{{repo.props.id}}/">查看全部修改</a>
<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>
{% endblock %}
{% block extra_script %}
<script type="text/javascript">
if ($('#repo-access-switch').attr('checked')) {
$('#repo-access-switch').click(function() {
location.href = "{{ SITE_ROOT }}repo/setap/{{ repo.props.id}}/own/";
});
} else {
$('#repo-access-switch').click(function() {
$('#public-access-start-confirm').modal({appendTo:"#main", containerCss:{padding:18}});
});
}
$('#public-access-start-btn').click(function() {
location.href = "{{ SITE_ROOT }}repo/setap/{{ repo.props.id}}/public/";
});
$('#public-access-start-cancel-btn').click(function() {
$('#repo-access-switch').attr('checked', false);
});
</script>
{% endblock %}