From ed06b4bcb1b838332f4ca3a8b7e637d2865f83d7 Mon Sep 17 00:00:00 2001 From: Bobby Date: Tue, 28 Jun 2022 11:47:28 +0700 Subject: [PATCH] feat: allow disabling redirect on js-only pages --- views/_partial/noscript-refresh.njk | 2 ++ views/_partial/noscript.njk | 12 +++++------- views/album.njk | 2 +- views/player.njk | 2 ++ 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/views/_partial/noscript-refresh.njk b/views/_partial/noscript-refresh.njk index c86cfae..10dd7df 100644 --- a/views/_partial/noscript-refresh.njk +++ b/views/_partial/noscript-refresh.njk @@ -5,6 +5,8 @@ #} diff --git a/views/_partial/noscript.njk b/views/_partial/noscript.njk index 298630d..da213b7 100644 --- a/views/_partial/noscript.njk +++ b/views/_partial/noscript.njk @@ -5,13 +5,11 @@

This page requires JavaScript to function.

-

- {%- if noscriptMessage -%} - {{ noscriptMessage | safe }} - {%- else -%} - If you are not automatically redirected to our No-JS uploader, click here. - {%- endif -%} -

+ {% if noscriptMessage or (noscriptMessage === null) -%} + {{ noscriptMessage | safe }} + {%- else -%} +

If you are not automatically redirected to our No-JS uploader, click here.

+ {%- endif %} diff --git a/views/album.njk b/views/album.njk index c80ca54..d6a9176 100644 --- a/views/album.njk +++ b/views/album.njk @@ -147,7 +147,7 @@ {% set floatingHomeHref = '..' %} {% include "_partial/floating-home.njk" %} {% if not nojs -%} -{% set noscriptMessage = 'If you are not automatically redirected to its No-JS version, click here.' %} +{% set noscriptMessage = '

If you are not automatically redirected to its No-JS version, click here.

' %} {% include "_partial/noscript.njk" %} {%- endif %} {% endblock %} diff --git a/views/player.njk b/views/player.njk index 19497e9..8d8b658 100644 --- a/views/player.njk +++ b/views/player.njk @@ -34,6 +34,7 @@ {% endblock %} +{% set noscriptRefreshUrl = null %} {% block endmeta %} {% include "_partial/noscript-refresh.njk" %} {% endblock %} @@ -92,5 +93,6 @@ {% set floatingHomeHref = '..' %} {% include "_partial/floating-home.njk" %} +{% set noscriptMessage = null %} {% include "_partial/noscript.njk" %} {% endblock %}