Add kiosk mode

This commit is contained in:
Laura Hausmann 2023-05-20 00:24:20 +02:00
parent 27bb6a4bc6
commit da653053cd
Signed by: zotan
GPG key ID: D044E84C5BE01605
2 changed files with 22 additions and 11 deletions

View file

@ -6,7 +6,16 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
namespace AfRApay.Web.Pages;
public class IndexModel : PageModel {
public void OnGet() { }
public void OnGet() {
if (Request.Query.ContainsKey("kiosk")) {
if (Request.Query["kiosk"] == "true") {
Response.Cookies.Append("kiosk", "true");
}
else {
Response.Cookies.Delete("kiosk");
}
}
}
public async void OnPost() {
await using var db = new DatabaseContext();

View file

@ -39,18 +39,20 @@
</main>
</div>
<footer class="border-top footer mt-auto text-muted">
<div class="container">
<div class=row>
<div class="col px-1 col-auto">
&copy; @DateTime.Now.Year - <a href="https://git.ztn.sh/AfRA/AfRApay" target="_blank">AfRApay</a> team.
</div>
<div class="col px-1 col-auto">
Powered by AfRApay.Web <a class="footerlink" href="https://git.ztn.sh/AfRA/AfRApay/commit/@Utils.LinkVersion" target="_blank">@Utils.Version</a> on .NET @Environment.Version
@if(Context.Request.Cookies["kiosk"] != "true" && Context.Request.Query["kiosk"] != "true" || (Context.Request.Query.ContainsKey("kiosk") && Context.Request.Query["kiosk"] != "true")) {
<footer class="border-top footer mt-auto text-muted">
<div class="container">
<div class=row>
<div class="col px-1 col-auto">
&copy; @DateTime.Now.Year - <a href="https://git.ztn.sh/AfRA/AfRApay" target="_blank">AfRApay</a> team.
</div>
<div class="col px-1 col-auto">
Powered by AfRApay.Web <a class="footerlink" href="https://git.ztn.sh/AfRA/AfRApay/commit/@Utils.LinkVersion" target="_blank">@Utils.Version</a> on .NET @Environment.Version
</div>
</div>
</div>
</div>
</footer>
</footer>
}
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>