-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Aaron
committed
May 4, 2020
1 parent
234482c
commit d9c2e39
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@using UmbracoForms.HCaptcha | ||
@model Umbraco.Forms.Mvc.Models.FieldViewModel | ||
@{ | ||
var siteKey = AppSettingsManager.GethCaptchaSiteKey(); | ||
var theme = "light"; | ||
var themeSetting = Model.AdditionalSettings.FirstOrDefault(x => x.Key == "Theme"); | ||
if (themeSetting.Value != "") | ||
{ | ||
theme = themeSetting.Value; | ||
} | ||
var size = "normal"; | ||
var sizeSetting = Model.AdditionalSettings.FirstOrDefault(x => x.Key == "Size"); | ||
if (sizeSetting.Value != "") | ||
{ | ||
size = sizeSetting.Value; | ||
} | ||
|
||
if (!string.IsNullOrEmpty(siteKey)) | ||
{ | ||
<script src="https://hcaptcha.com/1/api.js" async defer></script> | ||
<div class="h-captcha" data-sitekey="@siteKey" data-theme="@theme" data-size="@size"></div> | ||
} | ||
else | ||
{ | ||
<p class="error">ERROR: hCaptcha is missing the Site Key - Please update the web.config to include 'key="hCaptchaSiteKey"'</p> | ||
} | ||
} |