diff --git a/cypress/integration/content-rendering.spec.js b/cypress/integration/content-rendering.spec.js --- a/cypress/integration/content-rendering.spec.js +++ b/cypress/integration/content-rendering.spec.js @@ -42,7 +42,7 @@ it(`should render image with extension ${ext}`, function() { cy.request(this.Urls.tests_content_other_extension(ext)).then(response => { const data = response.body; - cy.visit(`${this.Urls.browse_content(data.sha1)}?path=file.${ext}`); + cy.visit(`${this.Urls.browse_content(data.sha1)}`); cy.get('.swh-content img') .should('be.visible'); }); @@ -60,7 +60,7 @@ it(`should render a PDF file`, function() { cy.request(this.Urls.tests_content_other_extension('pdf')).then(response => { const data = response.body; - cy.visit(`${this.Urls.browse_content(data.sha1)}?path=file.pdf`); + cy.visit(`${this.Urls.browse_content(data.sha1)}`); cy.get('.swh-content canvas') .wait(2000) .then(canvas => { diff --git a/swh/web/templates/includes/content-display.html b/swh/web/templates/includes/content-display.html --- a/swh/web/templates/includes/content-display.html +++ b/swh/web/templates/includes/content-display.html @@ -25,13 +25,6 @@ Content is too large to be displayed (size is greater than {{ max_content_size|filesizeformat }}). {% elif "inode/x-empty" == mimetype %} File is empty - {% elif filename and filename|default:""|slice:"-5:" == "ipynb" %} -
-
- {% elif "text/" in mimetype or "application/" in mimetype and encoding != "binary" %} -
-
{{ content }}
-
{% elif mimetype in browsers_supported_image_mimes and content %} {% elif "application/pdf" == mimetype %} @@ -43,6 +36,13 @@ + {% elif filename and filename|default:""|slice:"-5:" == "ipynb" %} +
+
+ {% elif "text/" in mimetype or "application/" in mimetype and encoding != "binary" %} +
+
{{ content }}
+
{% elif content %} Content with mime type {{ mimetype }} and encoding {{ encoding }} cannot be displayed. {% else %}