feat: Globale Konstante isReadOnly-Wert erstellt.

- Constraint für ReadOnly-Schaltfläche mit isReadOnly-Wert hinzugefügt
This commit is contained in:
Developer 02
2024-10-14 14:02:02 +02:00
parent 1cb9042736
commit 869493bd97
3 changed files with 33 additions and 19 deletions

View File

@@ -3,6 +3,10 @@
@using Newtonsoft.Json.Serialization
@{
var nonce = _accessor.HttpContext?.Items["csp-nonce"] as string;
var isReadOnly = false;
if (ViewData["IsReadOnly"] is bool isReadOnly_bool)
isReadOnly = isReadOnly_bool;
}
<!DOCTYPE html>
<html lang="en">
@@ -27,10 +31,15 @@
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24
}
</style>
<script nonce="@nonce">
@if (ViewData["EnvelopeKey"] is string envelopeKey)
{
<script nonce="@nonce">const ENV_KEY = "@envelopeKey.TrySanitize(_sanitizer)"</script>
@: const ENV_KEY = "@envelopeKey.TrySanitize(_sanitizer)"
}
const IS_READONLY = @isReadOnly.ToString().ToLower();
</script>
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/popper/dist/umd/popper.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.min.js"></script>