Hinzufügen einer Cookie-basierten Sprachauswahl zum Front-End
This commit is contained in:
@@ -1,6 +1,25 @@
|
||||
@{
|
||||
ViewData["Title"] = "Dokument geschützt";
|
||||
string userLanguage = ViewData["UserLanguage"] as string;
|
||||
string[] languages = ViewData["Languages"] as string[];
|
||||
}
|
||||
@* @if(ViewData["UserLanguage"] == null){
|
||||
<script>
|
||||
fetch('/api/data', { // Assuming the API endpoint is '/api/data' on the same origin
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
key: 'value'
|
||||
})
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => console.log(data))
|
||||
.catch(error => console.error('Error:', error));
|
||||
</script>
|
||||
} *@
|
||||
|
||||
<div class="page container p-5">
|
||||
<header class="text-center">
|
||||
<div class="icon locked">
|
||||
@@ -16,8 +35,8 @@
|
||||
<p>Wir haben Ihnen gerade den Zugriffscode an die hinterlegte Email Adresse gesendet. Dies kann evtl. einige Minuten dauern.</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<form id="form-access-code" class="form" method="post">
|
||||
<section class="d-flex">
|
||||
<form id="form-access-code" class="form pl-0 ml-0" method="post">
|
||||
<div class="input">
|
||||
<label class="visually-hidden" for="access_code">Zugriffscode</label>
|
||||
<input type="password" id="access_code" class="form-control" name="access_code" placeholder="Zugriffscode" required="required">
|
||||
@@ -27,6 +46,16 @@
|
||||
<button type="submit" class="btn btn-primary">Öffnen</button>
|
||||
</div>
|
||||
</form>
|
||||
<form class="form pl-0 ml-0" method="post" action="/lang">
|
||||
<div class="dropdown">
|
||||
<select class="form-select" name="language" onchange="this.form.submit()">
|
||||
@foreach(var lang in languages)
|
||||
{
|
||||
<option data-icon="flag-icon flag-icon-us" value="@lang">@_localizer[@lang]</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="text-center">
|
||||
|
||||
@@ -7,12 +7,21 @@
|
||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="~/lib/sweetalert2/sweetalert2.min.css" />
|
||||
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
|
||||
|
||||
<link rel="stylesheet" href="~/EnvelopeGenerator.Web.styles.css" asp-append-version="true" />
|
||||
<!-- Font Awesome -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet"/>
|
||||
<!-- Google Fonts -->
|
||||
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet"/>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/lipis/flag-icons@7.0.0/css/flag-icons.min.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
||||
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
||||
@{
|
||||
var popperjs_src = "https://cdn.jsdelivr.net/npm/@popperjs/core@2.10.2/dist/umd/popper.min.js";
|
||||
}
|
||||
<script src="@popperjs_src" integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="~/lib/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||
<script src="~/lib/sweetalert2/sweetalert2.min.js"></script>
|
||||
<script src="~/js/ui.js" asp-append-version="true"></script>
|
||||
<script src="~/js/annotation.js" asp-append-version="true"></script>
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
|
||||
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>
|
||||
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>
|
||||
@@ -1,3 +1,6 @@
|
||||
@using EnvelopeGenerator.Web
|
||||
@using EnvelopeGenerator.Web.Models
|
||||
@using Microsoft.Extensions.Localization;
|
||||
@using EnvelopeGenerator.Application.Resources;
|
||||
@inject IStringLocalizer<Resource> _localizer;
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
Reference in New Issue
Block a user