Changeset View
Changeset View
Standalone View
Standalone View
swh/web/templates/includes/content-display.html
Show All 22 Lines | <div class="swh-content"> | ||||
<i>File is empty</i> | <i>File is empty</i> | ||||
{% elif filename and filename|default:""|slice:"-5:" == "ipynb" %} | {% elif filename and filename|default:""|slice:"-5:" == "ipynb" %} | ||||
<div class="swh-ipynb"> | <div class="swh-ipynb"> | ||||
</div> | </div> | ||||
{% elif "text/" in mimetype and encoding != "binary" %} | {% elif "text/" in mimetype and encoding != "binary" %} | ||||
<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 mimetype in browsers_supported_image_mimes 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"> | ||||
<div class="py-2"> | <div class="py-2"> | ||||
<button class="btn btn-default btn-sm" id="pdf-prev">Previous</button> | <button class="btn btn-default btn-sm" id="pdf-prev">Previous</button> | ||||
<span>Page: <span id="pdf-page-num"></span> / <span id="pdf-page-count"></span></span> | <span>Page: <span id="pdf-page-num"></span> / <span id="pdf-page-count"></span></span> | ||||
<button class="btn btn-default btn-sm" id="pdf-next">Next</button> | <button class="btn btn-default btn-sm" id="pdf-next">Next</button> | ||||
</div> | </div> | ||||
<canvas id="pdf-canvas"></canvas> | <canvas id="pdf-canvas"></canvas> | ||||
</div> | </div> | ||||
{% elif content %} | {% elif content %} | ||||
Content with mime type {{ mimetype }} and encoding | Content with mime type {{ mimetype }} and encoding {{ encoding }} cannot be displayed. | ||||
{{ encoding }} cannot be displayed. | |||||
{% else %} | {% else %} | ||||
{% 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 %} | ||||
Show All 26 Lines |