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">
|
||||
|
||||
Reference in New Issue
Block a user