Rename Web Project

This commit is contained in:
Jonathan Jenne
2023-11-08 08:59:03 +01:00
parent 9245448d1c
commit d0a4249eb7
781 changed files with 14192 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
@page
@model EnvelopeGenerator.Web.Pages.ErrorModel
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Error</title>
<link href="~/css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="~/css/site.css" rel="stylesheet" asp-append-version="true" />
</head>
<body>
<div class="main">
<div class="content px-4">
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (Model.ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@Model.RequestId</code>
</p>
}
<h3>Development Mode</h3>
<p>
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,27 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System.Diagnostics;
namespace EnvelopeGenerator.Web.Pages
{
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
[IgnoreAntiforgeryToken]
public class ErrorModel : PageModel
{
public string? RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
private readonly ILogger<ErrorModel> _logger;
public ErrorModel(ILogger<ErrorModel> logger)
{
_logger = logger;
}
public void OnGet()
{
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
}
}
}

View File

@@ -0,0 +1,5 @@
@page "/EnvelopeKey/Finish"
<h3>Dokumente signiert</h3>
<p>Sie haben den Umschlag erfolgreich signiert!</p>

View File

@@ -0,0 +1,39 @@
@page "/"
@using EnvelopeGenerator.Common;
@using EnvelopeGenerator.Web.Services;
@inject EnvelopeService Envelope;
<PageTitle>Index</PageTitle>
<ul>
@foreach (var envelope in envelopes)
{
<li><a href="/EnvelopeKey/@getEnvelopeKey(envelope)">@envelope.Title</a></li>
}
</ul>
@code {
public List<Envelope> envelopes = new();
// List envelopes delivered to j.jenne@digitaldata.works
public int receiverId = 11;
string? getReceiverSignature(Envelope envelope)
{
var receiver = envelope.Receivers.Where(r => r.Id == receiverId).SingleOrDefault();
return receiver?.Signature;
}
string getEnvelopeKey(Envelope envelope)
{
return Helpers.EncodeEnvelopeReceiverId(envelope.Uuid, getReceiverSignature(envelope));
}
protected override void OnInitialized()
{
// Test
envelopes = Envelope.LoadEnvelopes(receiverId);
}
}

View File

@@ -0,0 +1,21 @@
@page "/EnvelopeKey/{EnvelopeReceiverId}"
@using EnvelopeGenerator.Common;
@using EnvelopeGenerator.Web.Services;
@inject DatabaseService Database
@inject IJSRuntime JS
<div id='container' style='background: gray; width: 100vw; height: 100vh; margin: 0 auto;'></div>
@code {
[Parameter] public string EnvelopeReceiverId { get; set; }
protected override async void OnAfterRender(bool firstRender)
{
if (firstRender)
{
var module = await JS.InvokeAsync<IJSObjectReference>("import", "./js/app.js");
await module.InvokeVoidAsync("App.init", "#container", EnvelopeReceiverId);
}
}
}

View File

@@ -0,0 +1,12 @@
@page "/"
@namespace EnvelopeGenerator.Web.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{
Layout = "_Layout";
}
@* Include pspdfkit.js in your Pages/_Host.cshtml file *@
<script src="lib/pspdfkit.js"></script>
<script src="js/app.js"></script>
<component type="typeof(App)" render-mode="ServerPrerendered" />

View File

@@ -0,0 +1,37 @@
@using Microsoft.AspNetCore.Components.Web
@namespace EnvelopeGenerator.Web.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8" />
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base href="~/" />
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
<link href="css/site.css" rel="stylesheet" />
<link href="EnvelopeGenerator.Web.styles.css" rel="stylesheet" />
<component type="typeof(HeadOutlet)" render-mode="ServerPrerendered" />
</head>
<body>
@RenderBody()
<div id="blazor-error-ui">
<environment include="Staging,Production">
An error has occurred. This application may no longer respond until reloaded.
</environment>
<environment include="Development">
An unhandled exception has occurred. See browser dev tools for details.
</environment>
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.server.js"></script>
@Html.AntiForgeryToken()
</body>
</html>