2012-07-11 14:39:36 +00:00
|
|
|
{% extends "myhome_base.html" %}
|
2012-11-10 04:03:25 +00:00
|
|
|
{% load seahub_tags i18n %}
|
2012-07-11 14:39:36 +00:00
|
|
|
|
2012-10-17 14:06:12 +00:00
|
|
|
{% block extra_style %}
|
2012-12-19 11:52:34 +00:00
|
|
|
{% include 'snippets/file_view_style.html' %}
|
2012-12-14 11:56:27 +00:00
|
|
|
<style type="text/css">
|
2012-12-19 11:52:34 +00:00
|
|
|
.CodeMirror { margin-bottom:0; }
|
|
|
|
#footer { display:block; }
|
2012-12-14 11:56:27 +00:00
|
|
|
</style>
|
2012-10-17 14:06:12 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
2012-07-11 14:39:36 +00:00
|
|
|
{% block main_panel %}
|
2012-11-28 07:24:11 +00:00
|
|
|
<h2 id="view-hd">{{ file_name }}</h2>
|
2012-08-10 13:35:58 +00:00
|
|
|
<div id="file">
|
2012-08-15 02:44:15 +00:00
|
|
|
<div id="file-op">
|
2012-12-18 03:11:34 +00:00
|
|
|
<p class="fleft">{% trans "Shared by: " %}{{ username|email2nickname }}</p>
|
2012-11-28 07:24:11 +00:00
|
|
|
|
2012-09-24 07:29:24 +00:00
|
|
|
{% if filetype == 'Text' or filetype == 'Image' or filetype == 'SVG' or filetype == 'Markdown' %}
|
2012-11-10 04:03:25 +00:00
|
|
|
<button data="{{ SITE_ROOT }}repo/{{ repo.id }}/{{ obj_id }}/?file_name={{ file_name }}&op=view&t={{ shared_token }}" id="view-original">{% trans "Raw" %}</button>
|
2012-09-24 07:29:24 +00:00
|
|
|
{% endif %}
|
2012-11-28 07:24:11 +00:00
|
|
|
|
2012-11-10 04:03:25 +00:00
|
|
|
<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 13:35:58 +00:00
|
|
|
</div>
|
|
|
|
<div id="file-view">
|
2012-11-20 08:28:33 +00:00
|
|
|
{% if filetype == 'Text' or filetype == 'Sf' %}
|
2012-09-13 08:36:23 +00:00
|
|
|
{% ifnotequal file_content None %}
|
2012-11-20 08:28:33 +00:00
|
|
|
{% if filetype == 'Text' %}
|
2012-09-13 08:36:23 +00:00
|
|
|
<textarea id="docu-view" class="vh">{{ file_content|escape }}</textarea>
|
2012-11-20 08:28:33 +00:00
|
|
|
{% else %}
|
2012-11-28 07:24:11 +00:00
|
|
|
<div id="sf" class="article">{{ file_content|safe }}</div>
|
2012-11-20 08:28:33 +00:00
|
|
|
{% endif %}
|
2012-09-13 08:36:23 +00:00
|
|
|
{% endifnotequal %}
|
|
|
|
{% endif %}
|
2012-07-14 07:19:09 +00:00
|
|
|
</div>
|
2012-07-11 14:39:36 +00:00
|
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block extra_script %}
|
2012-07-31 08:48:55 +00:00
|
|
|
{% include "snippets/file_view_js.html" %}
|
2012-07-11 14:39:36 +00:00
|
|
|
<script type="text/javascript">
|
2012-08-10 13:35:58 +00:00
|
|
|
$('#view-original, #download').click(function() {
|
|
|
|
window.open($(this).attr('data'));
|
|
|
|
});
|
2012-12-14 11:56:27 +00:00
|
|
|
{% include "snippets/repo_file_get.html" %}
|
2012-07-11 14:39:36 +00:00
|
|
|
</script>
|
|
|
|
{% endblock %}
|