2013-01-31 05:17:28 +00:00
|
|
|
{% load i18n %}
|
|
|
|
{% load url from future %}
|
|
|
|
{% comment %}
|
2012-12-20 11:50:56 +00:00
|
|
|
content of files that can be viewed online shows here.
|
|
|
|
For details please refer to 'snippets/file_content_js.html'.
|
2013-01-31 05:17:28 +00:00
|
|
|
{% endcomment %}
|
2012-12-20 11:50:56 +00:00
|
|
|
<div id="file-view">
|
2013-02-27 07:19:24 +00:00
|
|
|
{% include 'snippets/file_encoding.html' %}
|
2012-12-20 11:50:56 +00:00
|
|
|
{% if not err %}
|
2013-02-24 08:52:10 +00:00
|
|
|
{% if filetype == 'Text' or filetype == 'Sf' or filetype == 'Markdown' %}
|
2012-12-20 11:50:56 +00:00
|
|
|
{% ifnotequal file_content None %}
|
|
|
|
{% if filetype == 'Text' %}
|
|
|
|
<textarea id="docu-view" class="vh">{{ file_content|escape }}</textarea>
|
2013-02-24 08:52:10 +00:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if filetype == 'Sf' %}
|
2012-12-20 11:50:56 +00:00
|
|
|
<div id="sf" class="article">{{ file_content|safe }}</div>
|
|
|
|
{% endif %}
|
2013-02-24 08:52:10 +00:00
|
|
|
|
|
|
|
{% if filetype == 'Markdown' %}
|
|
|
|
<div id="md-view" class="article"></div>
|
|
|
|
{% endif %}
|
2012-12-20 11:50:56 +00:00
|
|
|
{% endifnotequal %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if filetype == 'Image' %}
|
2013-01-31 05:17:28 +00:00
|
|
|
{% if page == 'file_view'%}
|
|
|
|
{% if img_prev or img_next %}
|
|
|
|
<div id="img-prev-next">
|
|
|
|
{% if img_prev %}
|
|
|
|
<a href="{% url 'repo_view_file' repo.id %}?p={{img_prev|urlencode}}" id="img-prev" title="{% trans 'you can also press ← ' %}">{% trans "prev" %}</a>
|
|
|
|
{% endif %}
|
|
|
|
{% if img_prev and img_next %}
|
|
|
|
<span>/</span>
|
|
|
|
{% endif %}
|
|
|
|
{% if img_next %}
|
|
|
|
<a href="{% url 'repo_view_file' repo.id %}?p={{img_next|urlencode}}" id="img-next" title="{% trans 'you can also press → ' %}">{% trans "next" %}</a>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2013-02-28 03:21:15 +00:00
|
|
|
<img src="{{ raw_path }}" alt="{{ u_filename}}" id="image-view" class="vh" />
|
2012-12-20 11:50:56 +00:00
|
|
|
{% endif %}
|
|
|
|
{% else %}
|
|
|
|
<div id="file-view-tip">
|
|
|
|
<p class="error">{{ err }}</p>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|