1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-19 01:44:13 +00:00
Files
seahub/templates/view_shared_file.html

43 lines
1.6 KiB
HTML
Raw Normal View History

{% extends "myhome_base.html" %}
{% load seahub_tags i18n %}
{% block extra_style %}
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}codemirror/codemirror.css" />
{% endblock %}
{% block main_panel %}
2012-07-14 15:19:09 +08:00
<h2>{{ file_name }}</h2>
2012-11-10 13:49:49 +08:00
<p class="file-share-from">{% trans "Shared by: " %}{{ username }}</p>
2012-08-10 21:35:58 +08:00
<div id="file">
2012-09-24 16:23:00 +08:00
{% if filetype == 'PDF' and not pdf_use_flas %}
<div id="file-op" class="hide">
{% else %}
2012-08-15 10:44:15 +08:00
<div id="file-op">
{% endif %}
{% if filetype == 'Text' or filetype == 'Image' or filetype == 'SVG' or filetype == 'Markdown' %}
<button data="{{ SITE_ROOT }}repo/{{ repo.id }}/{{ obj_id }}/?file_name={{ file_name }}&op=view&t={{ shared_token }}" id="view-original">{% trans "Raw" %}</button>
{% endif %}
<button data="{{ SITE_ROOT }}repo/{{ repo.id }}/{{ obj_id }}/?file_name={{ file_name }}&op=download&t={{ shared_token }}" id="download">{% trans "Download" %}</button>
2012-08-10 21:35:58 +08:00
</div>
<div id="file-view">
{% if filetype == 'Text' %}
{% ifnotequal file_content None %}
<textarea id="docu-view" class="vh">{{ file_content|escape }}</textarea>
{% endifnotequal %}
{% else %}
2012-11-10 13:49:49 +08:00
<p>{% trans "Loading..." %}</p>
{% endif %}
2012-07-14 15:19:09 +08:00
</div>
</div>
{% endblock %}
{% block extra_script %}
2012-07-31 16:48:55 +08:00
{% include "snippets/file_view_js.html" %}
<script type="text/javascript">
2012-07-31 16:48:55 +08:00
{% include "snippets/repo_file_get.html" %}
2012-08-10 21:35:58 +08:00
$('#view-original, #download').click(function() {
window.open($(this).attr('data'));
});
</script>
{% endblock %}