mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-17 14:37:58 +00:00
50 lines
1.9 KiB
HTML
50 lines
1.9 KiB
HTML
{% load i18n %}
|
|
{% load url from future %}
|
|
{% comment %}
|
|
content of files that can be viewed online shows here.
|
|
For details please refer to 'snippets/file_content_js.html'.
|
|
{% endcomment %}
|
|
<div id="file-view">
|
|
{% include 'snippets/file_encoding.html' %}
|
|
{% if not err %}
|
|
{% if filetype == 'Text' or filetype == 'Sf' or filetype == 'Markdown' %}
|
|
{% ifnotequal file_content None %}
|
|
{% if filetype == 'Text' %}
|
|
<textarea id="docu-view" class="vh">{{ file_content|escape }}</textarea>
|
|
{% endif %}
|
|
|
|
{% if filetype == 'Sf' %}
|
|
<div id="sf" class="article">{{ file_content|safe }}</div>
|
|
{% endif %}
|
|
|
|
{% if filetype == 'Markdown' %}
|
|
<div id="md-view" class="article"></div>
|
|
{% endif %}
|
|
{% endifnotequal %}
|
|
{% endif %}
|
|
|
|
{% if filetype == 'Image' %}
|
|
{% 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 %}
|
|
<img src="{{ raw_path }}" alt="{{ u_filename}}" id="image-view" class="vh" />
|
|
{% endif %}
|
|
{% else %}
|
|
<div id="file-view-tip">
|
|
<p class="error">{{ err }}</p>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|