Compare commits
5 Commits
76d4151182
...
e4aed5309e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4aed5309e | ||
|
|
c31f081208 | ||
|
|
21934928c2 | ||
|
|
21e8a86a99 | ||
|
|
0228e82c63 |
@@ -120,6 +120,9 @@
|
||||
<data name="Complete" xml:space="preserve">
|
||||
<value>Abschließen</value>
|
||||
</data>
|
||||
<data name="Confirmation" xml:space="preserve">
|
||||
<value>Konfirmation</value>
|
||||
</data>
|
||||
<data name="de-DE" xml:space="preserve">
|
||||
<value>Deutch</value>
|
||||
</data>
|
||||
@@ -135,6 +138,9 @@
|
||||
<data name="EnvelopeInfo2" xml:space="preserve">
|
||||
<value>Erstellt am {0} von {1}. Sie können den Absender über <a href="mailto:{2}?subject={3}&body=Sehr%20geehrter%20{4}%20{5},%0A%0A%0A">{6}</a> kontaktieren.</value>
|
||||
</data>
|
||||
<data name="Finalize" xml:space="preserve">
|
||||
<value>Abschließen</value>
|
||||
</data>
|
||||
<data name="LocakedOpen" xml:space="preserve">
|
||||
<value>Öffnen</value>
|
||||
</data>
|
||||
@@ -153,6 +159,15 @@
|
||||
<data name="LockedTitle" xml:space="preserve">
|
||||
<value>Dokument erfordert einen Zugriffscode</value>
|
||||
</data>
|
||||
<data name="Reject" xml:space="preserve">
|
||||
<value>Ablehnen</value>
|
||||
</data>
|
||||
<data name="Review" xml:space="preserve">
|
||||
<value>Überprüfung</value>
|
||||
</data>
|
||||
<data name="SigAgree" xml:space="preserve">
|
||||
<value>Durch Klick auf Abschließen stimme ich zu, dass die abgebildete und übermittelte Signatur als elektronische Darstellung meiner Signatur in den Fällen gelten, in denen ich sie auf Dokumenten, einschließlich rechtsgültiger Verträge verwende.</value>
|
||||
</data>
|
||||
<data name="SignDoc" xml:space="preserve">
|
||||
<value>Dokument unterschreiben</value>
|
||||
</data>
|
||||
|
||||
@@ -120,6 +120,9 @@
|
||||
<data name="Complete" xml:space="preserve">
|
||||
<value>Complete</value>
|
||||
</data>
|
||||
<data name="Confirmation" xml:space="preserve">
|
||||
<value>Confirmation</value>
|
||||
</data>
|
||||
<data name="de-DE" xml:space="preserve">
|
||||
<value>German</value>
|
||||
</data>
|
||||
@@ -135,6 +138,9 @@
|
||||
<data name="EnvelopeInfo2" xml:space="preserve">
|
||||
<value>Created on {0} by {1}. You can contact the sender via <a href="mailto:{2}?subject={3}&body=Dear%20{4}%20{5},%0A%0A%0A">{6}</a>.</value>
|
||||
</data>
|
||||
<data name="Finalize" xml:space="preserve">
|
||||
<value>Finalize</value>
|
||||
</data>
|
||||
<data name="LocakedOpen" xml:space="preserve">
|
||||
<value>Open</value>
|
||||
</data>
|
||||
@@ -153,6 +159,15 @@
|
||||
<data name="LockedTitle" xml:space="preserve">
|
||||
<value>Document requires an access code</value>
|
||||
</data>
|
||||
<data name="Reject" xml:space="preserve">
|
||||
<value>Reject</value>
|
||||
</data>
|
||||
<data name="Review" xml:space="preserve">
|
||||
<value>Review</value>
|
||||
</data>
|
||||
<data name="SigAgree" xml:space="preserve">
|
||||
<value>By clicking on Finalize, I agree that the signature shown and submitted is an electronic representation of my signature in cases where I use it on documents, including legally binding contracts.</value>
|
||||
</data>
|
||||
<data name="SignDoc" xml:space="preserve">
|
||||
<value>Sign document</value>
|
||||
</data>
|
||||
|
||||
@@ -78,6 +78,7 @@
|
||||
</Reference>
|
||||
<Reference Include="GdPicture.NET.14, Version=14.1.0.152, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>D:\ProgramFiles\GdPicture.NET 14\Redist\GdPicture.NET (.NET Framework 4.5)\GdPicture.NET.14.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
|
||||
33
EnvelopeGenerator.Web/Controllers/LocalizationController.cs
Normal file
33
EnvelopeGenerator.Web/Controllers/LocalizationController.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using EnvelopeGenerator.Application.Resources;
|
||||
using Ganss.Xss;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Localization;
|
||||
|
||||
namespace EnvelopeGenerator.Web.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class LocalizationController : ControllerBase
|
||||
{
|
||||
private readonly IStringLocalizer<Resource> _localizer;
|
||||
private readonly ILogger<LocalizationController> _logger;
|
||||
private readonly HtmlSanitizer _sanitizer;
|
||||
|
||||
public LocalizationController(IStringLocalizer<Resource> localizer, ILogger<LocalizationController> logger, HtmlSanitizer sanitizer)
|
||||
{
|
||||
_localizer = localizer;
|
||||
_logger = logger;
|
||||
_sanitizer = sanitizer;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public IActionResult GetLocalized([FromQuery] string[]? name = null, [FromQuery] string[]? ignore = null)
|
||||
{
|
||||
ignore ??= Array.Empty<string>();
|
||||
var pairs = name?.ToDictionary(n => n, n => _localizer[n].Value)
|
||||
?? _localizer.GetAllStrings().Where(ls => !ignore.Contains(ls.Name)).ToDictionary(ls => ls.Name, ls => ls.Value); ;
|
||||
return Ok(pairs);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,11 +28,5 @@ namespace EnvelopeGenerator.Web.Controllers.Test
|
||||
|
||||
[HttpGet("culture")]
|
||||
public IActionResult GetCultures(string? lang = null) => lang is null ? Ok(_cultures) : Ok(_cultures[lang]);
|
||||
|
||||
[HttpGet("to-culture-info")]
|
||||
public IActionResult ToCultureInfo(string locale) => Ok(locale.ToCultureInfo());
|
||||
|
||||
[HttpGet("two-letter-iso-language-name")]
|
||||
public IActionResult TwoLetterISOLanguageName(string locale) => Ok(locale.TwoLetterISOLanguageName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
}
|
||||
@using DigitalData.Core.DTO;
|
||||
@using EnvelopeGenerator.Application.DTOs;
|
||||
@using Newtonsoft.Json
|
||||
@using Newtonsoft.Json.Serialization
|
||||
@model EnvelopeReceiverDto;
|
||||
@{
|
||||
ViewData["Title"] = _localizer[WebKey.SignDoc];
|
||||
@@ -59,7 +61,13 @@
|
||||
</svg>
|
||||
<span>@_localizer[WebKey.Complete]</span>
|
||||
</button>
|
||||
<button class="btn_refresh btn btn-outline-secondary" type="button">
|
||||
<button class="btn_reject btn btn-danger" type="button">
|
||||
<svg width="25px" height="25px" viewBox="43.5 43.5 512 512" version="1.1" fill="currentColor" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<path class="st0" d="M263.24,43.5c-117.36,0-212.5,95.14-212.5,212.5s95.14,212.5,212.5,212.5s212.5-95.14,212.5-212.5 S380.6,43.5,263.24,43.5z M367.83,298.36c17.18,17.18,17.18,45.04,0,62.23v0c-17.18,17.18-45.04,17.18-62.23,0l-42.36-42.36 l-42.36,42.36c-17.18,17.18-45.04,17.18-62.23,0v0c-17.18-17.18-17.18-45.04,0-62.23L201.01,256l-42.36-42.36 c-17.18-17.18-17.18-45.04,0-62.23v0c17.18-17.18,45.04-17.18,62.23,0l42.36,42.36l42.36-42.36c17.18-17.18,45.04-17.18,62.23,0v0 c17.18,17.18,17.18,45.04,0,62.23L325.46,256L367.83,298.36z"/>
|
||||
</svg>
|
||||
<span>@_localizer[WebKey.Reject]</span>
|
||||
</button>
|
||||
<button class="btn_refresh btn btn-secondary" type="button">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-arrow-counterclockwise" viewBox="0 0 16 16">
|
||||
<path fill-rule="evenodd" d="M8 3a5 5 0 1 1-4.546 2.914.5.5 0 0 0-.908-.417A6 6 0 1 0 8 2v1z" />
|
||||
<path d="M8 4.466V.534a.25.25 0 0 0-.41-.192L5.23 2.308a.25.25 0 0 0 0 .384l2.36 1.966A.25.25 0 0 0 8 4.466z" />
|
||||
@@ -82,11 +90,11 @@
|
||||
}
|
||||
@if (ViewData["DocumentBytes"] is byte[] documentBytes)
|
||||
{
|
||||
var settings = new Newtonsoft.Json.JsonSerializerSettings
|
||||
var settings = new JsonSerializerSettings
|
||||
{
|
||||
ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver()
|
||||
ContractResolver = new CamelCasePropertyNamesContractResolver()
|
||||
};
|
||||
var envelopeReceiverJson = Newtonsoft.Json.JsonConvert.SerializeObject(Model, settings);
|
||||
var envelopeReceiverJson = JsonConvert.SerializeObject(Model, settings);
|
||||
var documentBase64String = Convert.ToBase64String(documentBytes);
|
||||
var envelopeKey = ViewData["EnvelopeKey"] as string;
|
||||
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
@using DigitalData.Core.API
|
||||
@using Newtonsoft.Json
|
||||
@{
|
||||
var nonce = _accessor.HttpContext?.Items["csp-nonce"] as string;
|
||||
}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
@@ -24,6 +29,13 @@
|
||||
<script src="~/js/util.js" asp-append-version="true"></script>
|
||||
<script src="~/js/api.js" asp-append-version="true"></script>
|
||||
@await RenderSectionAsync("Scripts", required: false)
|
||||
@{
|
||||
var lStrsJson = JsonConvert.SerializeObject(_localizer.ToDictionary()).TrySanitize(_sanitizer);
|
||||
}
|
||||
<script nonce="@nonce">
|
||||
var localized = @Html.Raw(lStrsJson)
|
||||
</script>
|
||||
|
||||
<main role="main">
|
||||
<partial name="_CookieConsentPartial" />
|
||||
@RenderBody()
|
||||
|
||||
@@ -24,5 +24,7 @@ namespace EnvelopeGenerator.Web
|
||||
public static readonly string Complete = nameof(Complete);
|
||||
public static readonly string EnvelopeInfo1 = nameof(EnvelopeInfo1);
|
||||
public static readonly string EnvelopeInfo2 = nameof(EnvelopeInfo2);
|
||||
public static readonly string SigAgree = nameof(SigAgree);
|
||||
public static readonly string Reject = nameof(Reject);
|
||||
}
|
||||
}
|
||||
@@ -15,14 +15,16 @@
|
||||
margin-bottom: 10vh;
|
||||
}
|
||||
|
||||
.btn_refresh, .btn_complete {
|
||||
|
||||
.btn_refresh, .btn_reject, .btn_complete {
|
||||
height:2.5rem;
|
||||
}
|
||||
|
||||
.btn_complete .icon {
|
||||
.btn_complete .icon, .btn_reject .icon, .btn_refresh .icon {
|
||||
width: 1.1rem;
|
||||
}
|
||||
|
||||
.btn_complete span {
|
||||
.btn_complete span, .btn_reject span, .btn_refresh span {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
|
||||
@@ -177,52 +177,68 @@ class App {
|
||||
icon: 'warning',
|
||||
})
|
||||
return false
|
||||
|
||||
}
|
||||
|
||||
// Save changes before doing anything
|
||||
try {
|
||||
await this.Instance.save()
|
||||
} catch (e) {
|
||||
Swal.fire({
|
||||
title: 'Fehler',
|
||||
text: 'Umschlag konnte nicht signiert werden!',
|
||||
icon: 'error',
|
||||
})
|
||||
return false
|
||||
}
|
||||
return Swal.fire({
|
||||
title: localized.Confirmation,
|
||||
html: `<div class="text-start fs-6 p-0 m-0">${localized.SigAgree}</div>`,
|
||||
icon: "question",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
cancelButtonColor: "#d33",
|
||||
confirmButtonText: localized.Finalize,
|
||||
cancelButtonText: localized.Review
|
||||
}).then(async (result) => {
|
||||
if (result.isConfirmed) {
|
||||
//---
|
||||
// Save changes before doing anything
|
||||
try {
|
||||
await this.Instance.save()
|
||||
} catch (e) {
|
||||
Swal.fire({
|
||||
title: 'Fehler',
|
||||
text: 'Umschlag konnte nicht signiert werden!',
|
||||
icon: 'error',
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
// Export annotation data and save to database
|
||||
try {
|
||||
const json = await this.Instance.exportInstantJSON()
|
||||
const postEnvelopeResult = await this.Network.postEnvelope(
|
||||
this.envelopeKey,
|
||||
this.currentDocument.id,
|
||||
json
|
||||
)
|
||||
// Export annotation data and save to database
|
||||
try {
|
||||
const json = await this.Instance.exportInstantJSON()
|
||||
const postEnvelopeResult = await this.Network.postEnvelope(
|
||||
this.envelopeKey,
|
||||
this.currentDocument.id,
|
||||
json
|
||||
)
|
||||
|
||||
if (postEnvelopeResult.fatal) {
|
||||
Swal.fire({
|
||||
title: 'Fehler',
|
||||
text: 'Umschlag konnte nicht signiert werden!',
|
||||
icon: 'error',
|
||||
})
|
||||
return false
|
||||
if (postEnvelopeResult.fatal) {
|
||||
Swal.fire({
|
||||
title: 'Fehler',
|
||||
text: 'Umschlag konnte nicht signiert werden!',
|
||||
icon: 'error',
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
if (postEnvelopeResult.error) {
|
||||
Swal.fire({
|
||||
title: 'Warnung',
|
||||
text: 'Umschlag ist nicht mehr verfügbar.',
|
||||
icon: 'warning',
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
//---
|
||||
}
|
||||
|
||||
if (postEnvelopeResult.error) {
|
||||
Swal.fire({
|
||||
title: 'Warnung',
|
||||
text: 'Umschlag ist nicht mehr verfügbar.',
|
||||
icon: 'warning',
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
else
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user