diff --git a/EnvelopeGenerator.Web/XSSExtensions.cs b/EnvelopeGenerator.Web/XSSExtensions.cs index 9c019dc2..9b414fd6 100644 --- a/EnvelopeGenerator.Web/XSSExtensions.cs +++ b/EnvelopeGenerator.Web/XSSExtensions.cs @@ -1,4 +1,5 @@ using Ganss.Xss; +using Microsoft.Extensions.Localization; using System.Text.Encodings.Web; namespace EnvelopeGenerator.Web @@ -7,6 +8,10 @@ namespace EnvelopeGenerator.Web { public static string? TryEncode(this string? value, UrlEncoder encoder) => value is null ? value : encoder.Encode(value); + public static string? TryEncode(this LocalizedString? value, UrlEncoder encoder) => value is null ? null : encoder.Encode(value); + public static string? TrySanitize(this string? html, HtmlSanitizer sanitizer) => html is null ? html : sanitizer.Sanitize(html); + + public static string? TrySanitize(this LocalizedString? html, HtmlSanitizer sanitizer) => html is null ? null : sanitizer.Sanitize(html); } } \ No newline at end of file diff --git a/EnvelopeGenerator.Web/appsettings.json b/EnvelopeGenerator.Web/appsettings.json index 55862018..82f633d8 100644 --- a/EnvelopeGenerator.Web/appsettings.json +++ b/EnvelopeGenerator.Web/appsettings.json @@ -1,4 +1,6 @@ { + "EnableSwagger": true, + "EnableTestControllers": true, "DetailedErrors": true, "Logging": { "LogLevel": { @@ -13,7 +15,7 @@ "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self';" */ "Content-Security-Policy": null, "AdminPassword": "dd", - "AllowedOrigins": [ "https://localhost:7202" ], + "AllowedOrigins": [ "https://localhost:7202", "https://digitale.unterschrift.wisag.de/" ], "NLog": { "throwConfigExceptions": true, "targets": { @@ -53,17 +55,11 @@ } ] }, - "AddTestControllers": true, "Jwt": { "Issuer": null, "Audience": null, "Key": "8RGnd7x0G2TYLOIW4m_qlIls7MfbAIGNrpQJzMAUIvULHOLiG723znRa_MG-Z4yw3SErusOU4hTui2rVBMcCaQ" }, - "AuthCookieConfig": { - "HttpOnly": true, - "SecurePolicy": 1 - - }, "CookieConsentSettings": { "PrivacyPolicyUrl": "./privacy-policy.en.html", "LegalNoticeUrl": "./cookies-policy.en.html", @@ -89,5 +85,6 @@ /* Resx naming format is -> Resource.language.resx (eg: Resource.de_DE.resx). To add a new language, first you should write the required resx file. first is the default culture name. */ - "Languages": [ "de_DE", "en_US" ] + "Languages": [ "de_DE", "en_US" ], + "DisableMultiLanguage": true } \ No newline at end of file diff --git a/EnvelopeGenerator.Web/wwwroot/css/site.css b/EnvelopeGenerator.Web/wwwroot/css/site.css index 1c169b00..937eab6c 100644 --- a/EnvelopeGenerator.Web/wwwroot/css/site.css +++ b/EnvelopeGenerator.Web/wwwroot/css/site.css @@ -139,4 +139,63 @@ footer#page-footer a:focus { .none-display { display: none +} + +.dropdown-flag img, .img-flag { + width: 30%; + height: 70%; +} +.dropdown-flag { + height: 75%; + width: 75%; +} + +/* --- */ +/* Adjusting the height of the select2 container */ +.dropdown-flag .select2-container--default .select2-selection--single { + height: 40px; /* Desired height */ +} + +/* Adjusting the height and vertical alignment of the selected item */ +.dropdown-flag .select2-container--default .select2-selection--single .select2-selection__rendered { + line-height: 38px; /* Should be 2px less than the height for internal padding */ +} + +/* Adjusting the height of the dropdown arrow */ +.dropdown-flag .select2-container--default .select2-selection--single .select2-selection__arrow { + height: 38px; /* Again, 2px less than the height */ +} + +/* Adjusting the height of dropdown list items */ +.dropdown-flag .select2-container--default .select2-dropdown .select2-results>.select2-results__options { + max-height: 200px; /* Optional, adjust for larger dropdown height */ +} + +/* CSS for custom class to increase dropdown height */ +.increase-dropdown-height { + min-height: 400px; /* Optional, larger value for increased height */ +} + + +/* Adjusting select2 width to fit within a specific form size */ +.dropdown-flag .select2-container { + width: 100% !important; /* Makes the container full width */ + max-width: 180px; /* Suitable maximum width for the form */ +} + + +.select2-container--default .select2-search--dropdown .select2-search__field { + border-color: #86b7fe; + outline: 0; + mask-border-width: 0 +} + +.select2-container--default .select2-search--dropdown .select2-search__field:hover { + border-color: #86b7fe; + outline: 0; + box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25); +} + +.select2-search__field { + display:none } \ No newline at end of file diff --git a/EnvelopeGenerator.Web/wwwroot/img/flags/de_DE.png b/EnvelopeGenerator.Web/wwwroot/img/flags/de_DE.png new file mode 100644 index 00000000..a2bae4b3 Binary files /dev/null and b/EnvelopeGenerator.Web/wwwroot/img/flags/de_DE.png differ diff --git a/EnvelopeGenerator.Web/wwwroot/img/flags/en_US.png b/EnvelopeGenerator.Web/wwwroot/img/flags/en_US.png new file mode 100644 index 00000000..5e1212da Binary files /dev/null and b/EnvelopeGenerator.Web/wwwroot/img/flags/en_US.png differ