Remove empty box on post redirect (#1995)

In case JS is enabled the post redirect page showed an empty box. This box contains the explanation text for the non-JS text.

This changes it to only show the modal box in casee JS is disabled, because the page – even though only visible briefly –  looks weird for users with JS enabled.
This commit is contained in:
Dennis Reimann 2020-10-18 11:10:51 +02:00 committed by GitHub
parent b430afe3e1
commit 933e0c30bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,25 +17,27 @@
<title>Post Redirect</title> <title>Post Redirect</title>
</head> </head>
<body> <body>
<div class="modal-dialog modal-dialog-centered"> <form method="post" id="postform" action="@action">
<div class="modal-content"> @Html.AntiForgeryToken()
<form method="post" id="postform" action="@action" class="modal-body text-center my-3"> @foreach (var o in Model.Parameters)
@Html.AntiForgeryToken() {
@foreach (var o in Model.Parameters) <input type="hidden" name="@o.Key" value="@o.Value"/>
{ }
<input type="hidden" name="@o.Key" value="@o.Value"/> <noscript>
} <div class="modal-dialog modal-dialog-centered">
<noscript> <div class="modal-content">
<p> <div class="modal-body text-center my-3">
This redirection page is supposed to be submitted automatically. <p>
<br> This redirection page is supposed to be submitted automatically.
Since you have not enabled JavaScript, please submit manually. <br>
</p> Since you have not enabled JavaScript, please submit manually.
<button class="btn btn-primary" type="submit">Submit</button> </p>
</noscript> <button class="btn btn-primary" type="submit">Submit</button>
</form> </div>
</div> </div>
</div> </div>
</noscript>
</form>
<script type="text/javascript"> <script type="text/javascript">
document.forms.item(0).submit(); document.forms.item(0).submit();
</script> </script>