1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 23:29:49 +00:00
Files
seahub/share/templates/repo/share_admin.html

94 lines
3.3 KiB
HTML
Raw Normal View History

2012-09-04 17:15:19 +08:00
{% extends base_template %}
2012-06-12 10:13:14 +08:00
{% load seahub_tags %}
2012-04-24 14:21:52 +08:00
{% block nav_shareadmin_class %}class="cur"{% endblock %}
{% block right_panel %}
<h3>我共享的同步目录</h3>
{% if shared_repos %}
2012-04-24 14:21:52 +08:00
<table class="repo-list">
<tr>
<th width="5%"><!--icon--></th>
<th width="20%">名字</th>
<th width="25%">共享给</th>
<th width="10%">权限</th>
<th width="35%">描述</th>
<th width="10%">操作</th>
2012-04-24 14:21:52 +08:00
</tr>
{% for repo in shared_repos %}
2012-04-24 14:21:52 +08:00
<tr>
<td><img src="{{MEDIA_URL}}img/sync-folder-20.png" alt="目录icon" /></td>
<td><a href="{{ SITE_ROOT }}repo/{{ repo.props.repo_id }}">{{ repo.props.repo_name }}</a></td>
<td>{{ repo.props.user }}</td>
<td>{{ repo.share_permission }}</td>
<td>{{ repo.props.repo_desc }}</td>
2012-04-24 14:21:52 +08:00
<td>
{% if repo.props.share_type == 'group' %}
<a href="#" data="{{ SITE_ROOT }}shareadmin/removeshare/?repo_id={{ repo.props.repo_id }}&from={{ request.user }}&gid={{ repo.props.group_id }}" class="cancel-share op">取消共享</a>
{% endif %}
{% if repo.props.share_type == 'personal' %}
<a href="#" data="{{ SITE_ROOT }}shareadmin/removeshare/?repo_id={{ repo.props.repo_id }}&from={{ request.user }}&to={{ repo.props.user }}" class="cancel-share op">取消共享</a>
{% endif %}
{% if repo.props.share_type == 'public' %}
{% if not org %}
<a href="#" data="{{ SITE_ROOT }}repo/unsetinnerpub/{{ repo.props.repo_id }}" class="cancel-share op">取消共享</a>
{% else %}
<a href="#" data="{{ SITE_ROOT }}organizations/{{ org.url_prefix }}/innerpubrepo/unset/{{ repo.props.repo_id }}" class="cancel-share op">取消共享</a>
{% endif %}
2012-05-22 13:41:41 +08:00
{% endif %}
2012-04-24 14:21:52 +08:00
</td>
</tr>
{% endfor %}
</table>
{% else %}
<p>暂无</p>
{% endif %}
2012-06-12 10:13:14 +08:00
<h3>我管理的文件外链</h3>
{% if fileshares %}
<table class="sharelink-list">
<tr>
<th width="45%">文件名</th>
<th width="30%">所属目录</th>
<th width="10%">查看次数</th>
<th width="15%">操作</th>
</tr>
{% for fs in fileshares %}
<tr>
<td><a href="{{ SITE_ROOT }}repo/{{ fs.repo.id }}/files/?p={{ fs.path|urlencode }}">{{ fs.filename }}</a></td>
<td><a href="{{ SITE_ROOT }}repo/{{ fs.repo.id }}/">{{ fs.repo.name }}</a></td>
<td>{{ fs.view_cnt }}</td>
<td>
<a href="#" class="op view-link" data="{{ fs.token }}">查看链接</a>
<a class="op" href="{{ SITE_ROOT }}sharedlink/remove/?t={{ fs.token }}">删除</a>
</td>
</tr>
{% endfor %}
</table>
{% else %}
<p>暂无</p>
{% endif %}
<p id="link" class="hide">该文件外链为:<input type="text" readonly="readonly" value="" id="shared-link" /></p>
2012-04-24 14:21:52 +08:00
{% endblock %}
{% block extra_script %}
<script type="text/javascript">
$('.cancel-share').click(function() {
location.href = $(this).attr('data');
});
$(".view-link").click(function() {
var token = $(this).attr('data'),
link = '{{ protocol }}://' + '{{ domain }}{{ SITE_ROOT }}f/' + token + '/';
$('#link').before('<p class="hide">' + link + '</p>');
$('#shared-link').val(link).css('width', $('#link').prev().width() + 2);
$("#link").modal({appendTo:'#main'});
$('#link').prev().remove();
return false;
});
$('#shared-link').click(function() {
$(this).select();
});
2012-04-24 14:21:52 +08:00
</script>
{% endblock %}