1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-24 21:07:17 +00:00
Files
seahub/templates/view_shared_file.html
2012-09-13 16:36:23 +08:00

33 lines
1.2 KiB
HTML

{% extends "myhome_base.html" %}
{% load seahub_tags %}
{% block main_panel %}
<h2>{{ file_name }}</h2>
<p class="file-share-from">共享者:{{ username }}</p>
<div id="file">
<div id="file-op">
<button data="{{ SITE_ROOT }}repo/{{ repo.id }}/{{ obj_id }}/?file_name={{ file_name }}&op=view&t={{ shared_token }}" id="view-original">原始文件</button>
<button data="{{ SITE_ROOT }}repo/{{ repo.id }}/{{ obj_id }}/?file_name={{ file_name }}&op=download&t={{ shared_token }}" id="download">下载</button>
</div>
<div id="file-view">
{% if filetype == 'Text' %}
{% ifnotequal file_content None %}
<textarea id="docu-view" class="vh">{{ file_content|escape }}</textarea>
{% endifnotequal %}
{% else %}
<p>文件内容读取中...</p>
{% endif %}
</div>
</div>
{% endblock %}
{% block extra_script %}
{% include "snippets/file_view_js.html" %}
<script type="text/javascript">
{% include "snippets/repo_file_get.html" %}
$('#view-original, #download').click(function() {
window.open($(this).attr('data'));
});
</script>
{% endblock %}