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-05-23 13:50:12 +08:00

115 lines
4.7 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends "myhome_base.html" %}
{% load seahub_tags %}
{% block main_panel %}
<div id="repo-page" class="ovhd">
<h2>{{repo.props.name}}</h2>
<div class="side fright">
<p>{{repo.props.desc}}</p>
<p>大小:{{ repo_size|filesizeformat }}</p>
{% if not repo.props.encrypted %}
{% if is_owner or repo_ap == 'public' or share_to_me %}
<p class="latest-commit mgt10">
{{ latest_commit.props.desc|translate_commit_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>
<p class="mgt10">
{% if is_owner %}
<span class="item-name">WEB匿名访问:</span>
{% 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 %}
</p>
{% endif %}
{% endif %}
</div>
<div class="main fleft">
{% if repo.props.encrypted %}
<p>该同步目录已加密,不能在线查看。</p>
{% else %}
{% if not is_owner and repo_ap == 'own' and not share_to_me %}
<p>该同步目录web匿名访问未开启不能在线查看。</p>
{% else %}
<div>
{% 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 }}
{% endfor %}
</div>
<table>
<tr>
<th width="5%"></th>
<th width="55%">名字</th>
<th width="10%">大小</th>
<th width="30%">操作</th>
</tr>
{% for dirent in dir_list %}
<tr>
<td class="icon-container"><img src="{{ MEDIA_URL }}img/folder-icon-24.png" /></td>
<td><a href="{{ SITE_ROOT }}repo/{{ repo.id }}/?p={{ path|urlencode }}{{ dirent.obj_name|urlencode }}">{{ dirent.obj_name }}</a></td>
<td></td>
<td></td>
</tr>
{% endfor %}
{% for dirent in file_list %}
<tr>
<td class="icon-container"><img src="{{ MEDIA_URL }}img/{{ dirent.obj_name|file_icon_filter }}" /></td>
<td>{{ dirent.props.obj_name }}</td>
<td>{{ dirent.file_size|filesizeformat }}</td>
<td>
<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>
</td>
</tr>
{% endfor %}
</table>
{% endif %}
{% 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>
</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}}/?ap=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}}/?ap=public";
});
$('#public-access-start-cancel-btn').click(function() {
$('#repo-access-switch').attr('checked', false);
});
</script>
{% endblock %}