Changeset View
Changeset View
Standalone View
Standalone View
swh/web/templates/includes/content-display.html
Show All 15 Lines | <div class="card"> | ||||
{{ swh_object_metadata.filename }} | {{ swh_object_metadata.filename }} | ||||
</div> | </div> | ||||
{% endif %} | {% endif %} | ||||
<div class="swh-content"> | <div class="swh-content"> | ||||
{% if content_size > max_content_size %} | {% if content_size > max_content_size %} | ||||
Content is too large to be displayed (size is greater than {{ max_content_size|filesizeformat }}). | Content is too large to be displayed (size is greater than {{ max_content_size|filesizeformat }}). | ||||
{% elif "inode/x-empty" == mimetype %} | {% elif "inode/x-empty" == mimetype %} | ||||
<i>File is empty</i> | <i>File is empty</i> | ||||
{% elif swh_object_metadata.filename and swh_object_metadata.filename|default:""|slice:"-5:" == "ipynb" %} | |||||
<div class="swh-ipynb"> | |||||
</div> | |||||
{% elif "text/" in mimetype %} | {% elif "text/" in mimetype %} | ||||
<div class="highlightjs"> | <div class="highlightjs"> | ||||
<pre><code class="{{ language }}">{{ content }}</code></pre> | <pre><code class="{{ language }}">{{ content }}</code></pre> | ||||
</div> | </div> | ||||
{% elif "image/" in mimetype and content %} | {% elif "image/" in mimetype and content %} | ||||
<img src="data:{{ mimetype }};base64,{{ content }}"/> | <img src="data:{{ mimetype }};base64,{{ content }}"/> | ||||
{% elif "application/pdf" == mimetype %} | {% elif "application/pdf" == mimetype %} | ||||
<div class="text-center"> | <div class="text-center"> | ||||
Show All 10 Lines | <div class="swh-content"> | ||||
{% include "includes/http-error.html" %} | {% include "includes/http-error.html" %} | ||||
{% endif %} | {% endif %} | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<script> | <script> | ||||
{% if "application/pdf" == mimetype %} | {% if "application/pdf" == mimetype %} | ||||
swh.webapp.renderPdf({{ top_right_link.url|jsonify }}); | swh.webapp.renderPdf({{ top_right_link.url|jsonify }}); | ||||
{% elif swh_object_metadata.filename and swh_object_metadata.filename|default:""|slice:"-5:" == "ipynb" %} | |||||
swh.webapp.renderNotebook({{ top_right_link.url|jsonify }}, '.swh-ipynb'); | |||||
{% elif content %} | {% elif content %} | ||||
swh.webapp.highlightCode(); | swh.webapp.highlightCode(); | ||||
{% endif %} | {% endif %} | ||||
</script> | </script> | ||||
{% endif %} | {% endif %} |