mirror of
https://github.com/haiwen/seahub.git
synced 2025-07-19 17:39:39 +00:00
121 lines
4.9 KiB
HTML
121 lines
4.9 KiB
HTML
{% extends "myhome_base.html" %}
|
||
{% load seahub_tags %}
|
||
|
||
{% block main_panel %}
|
||
<h2 class="subject">
|
||
{{repo.props.name}}
|
||
</h2>
|
||
|
||
<div class="side fright">
|
||
<h3>基本信息</h3>
|
||
<p>{{repo.props.desc}}</p>
|
||
<p>大小:{{ repo_size|filesizeformat }}</p>
|
||
|
||
{% if not repo.props.encrypted or password_set %}
|
||
{% if is_owner or repo_ap == 'public' or share_to_me %}
|
||
<div class="latest-commit">
|
||
<h3>最新修改<a href="{{ SITE_ROOT }}repo/history/{{repo.props.id}}/" class="more">(更多)</a></h3>
|
||
<p>{{ latest_commit.props.desc|translate_commit_desc }}</p>
|
||
<p class="al-rt">
|
||
<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|translate_commit_time }}</span>
|
||
</p>
|
||
</div>
|
||
|
||
{% if is_owner %}
|
||
<h3>设置</h3>
|
||
<p>
|
||
<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" data="{{ SITE_ROOT }}repo/setap/{{ repo.props.id}}/?ap=public" autocomplete="off" /><label for="repo-access-switch">开启</label>
|
||
{% endif %}
|
||
<br /><span class="tip">开启后,任何人都能够访问该目录</span>
|
||
</p>
|
||
{% endif %}
|
||
{% endif %}
|
||
{% endif %}
|
||
</div>
|
||
|
||
<div class="main fleft">
|
||
{% if repo.props.encrypted and not password_set %}
|
||
<p class="access-notice">该目录已加密。如需在线查看里面的内容,请输入解密密码。密码只会在服务器上暂存1小时。</p>
|
||
<form action="{{ SITE_ROOT }}repo/{{ repo.id }}/" method="post">
|
||
<label>密码:</label>
|
||
<input id="id_password" type="password" name="password" maxlength="64" /><br />
|
||
{% if error %}
|
||
<p class="error">{{ error }}</p>
|
||
{% endif %}
|
||
<input type="submit" value="提交" />
|
||
</form>
|
||
|
||
{% else %}
|
||
{% if not is_owner and repo_ap == 'own' and not share_to_me %}
|
||
<p class="access-notice">该同步目录web匿名访问未开启,不能在线查看。</p>
|
||
{% else %}
|
||
<p class="path">
|
||
当前路径:
|
||
{% for name, link in zipped %}
|
||
{% if not forloop.last %}
|
||
<a href="{{ SITE_ROOT }}repo/{{ repo.id }}/?p={{ link|urlencode }}">{{ name }}</a> /
|
||
{% else %}
|
||
{{ name }}
|
||
{% endif %}
|
||
{% endfor %}
|
||
</p>
|
||
<table>
|
||
<tr>
|
||
<th width="5%"></th>
|
||
<th width="69%">名字</th>
|
||
<th width="13%">大小</th>
|
||
<th width="13%">操作</th>
|
||
</tr>
|
||
|
||
{% for dirent in dir_list %}
|
||
<tr>
|
||
<td class="icon-container"><img src="{{ MEDIA_URL }}img/folder-icon-24.png" alt="目录" /></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 }}" alt="文件" /></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>
|
||
{% 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() {
|
||
$(this).attr('checked', false);
|
||
});
|
||
addConfirmTo($('#repo-access-switch'), '确定要开启吗?');
|
||
}
|
||
</script>
|
||
{% endblock %}
|