-
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace Google captcha with hCaptcha
- Loading branch information
Igor Kowalczyk
committed
Apr 24, 2022
1 parent
6dec1a6
commit 82e8833
Showing
5 changed files
with
559 additions
and
6,675 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
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
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 |
---|---|---|
@@ -1,129 +1,106 @@ | ||
<%- include("includes/head", { bot, user, path, title: "Contact" }) %> | ||
|
||
<% if (user) { %> | ||
<% const checked = "contact" %> | ||
<%- include("includes/side_nav_other", { bot, user, path, checked_nav: checked }) %> | ||
<div class="content" style="padding: 40px 20px 40px;"> | ||
<% const checked = "contact" %> | ||
<%- include("includes/side_nav_other", { bot, user, path, checked_nav: checked }) %> | ||
<div class="content" style="padding: 40px 20px 40px;"> | ||
<% } else { %> | ||
<div class="container-contact"> | ||
<div class="container-contact"> | ||
<div class="wrap-contact"> | ||
<% } %> | ||
<link rel="stylesheet" type="text/css" href="<%= secure_connection %><%= domain %><%= port %>/css/contact.css" /> | ||
<% if (alert) { %> | ||
<% if(error == true) { %> | ||
<% if (alert) { %> | ||
<% if(error == true) { %> | ||
<style> | ||
.banner { | ||
background-color: #F05454; | ||
} | ||
</style> | ||
} | ||
<% } %> | ||
<div class="banner" style="width: 100%;"> | ||
<div class="banner-content"> | ||
<div class="banner-text"> | ||
<%= alert %> | ||
</div> | ||
<button class="banner-close" type="button"> | ||
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#FFFFFF"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/></svg> | ||
</button> | ||
</style> | ||
<% } %> | ||
<div class="banner" style="width: 100%;"> | ||
<div class="banner-content"> | ||
<div class="banner-text"> | ||
<%= alert %> | ||
</div> | ||
<button class="banner-close" type="button"> | ||
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#FFFFFF"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/></svg> | ||
</button> | ||
</div> | ||
</div> | ||
<script> | ||
const close_banner = document.querySelector(".banner-close") | ||
const banner = document.querySelector (".banner") | ||
close_banner.addEventListener("click", function () { | ||
banner.style.display = "none"; | ||
}); | ||
</script> | ||
const close_banner = document.querySelector(".banner-close") | ||
const banner = document.querySelector (".banner") | ||
close_banner.addEventListener("click", function () { | ||
banner.style.display = "none"; | ||
}); | ||
</script> | ||
<% } %> | ||
<form action="/contact" class="contact-form validate-form" method="POST"> | ||
<input type="hidden" name="_csrf" value="<%= csrfToken %>"> | ||
<span class="contact-form-title"></span> | ||
<% if (user) { %> | ||
<input type="hidden" name="id" value="<%= user.id %>"> | ||
<input type="hidden" name="name" value="<%= user.username %>#<%= user.discriminator %>"> | ||
<div class="wrap-input rs1-wrap-input"> | ||
<span class="label">Name</span> | ||
<input disabled class="input" maxlenght="100" autocomplete="off" spellcheck="false" title="You can't change your nickname here!" type="text" name="name_invi" placeholder="Name" value="<%= user.username %>#<%= user.discriminator %>" /> | ||
</div> | ||
<div class="wrap-input rs1-wrap-input"> | ||
<span class="label">Email</span> | ||
<input class="input" type="email" maxlenght="100" title="E-mail through which we can contact you" spellcheck="false" name="email" placeholder="[email protected]" required="true"/> | ||
</div> | ||
<div class="wrap-input"> | ||
<span class="label">Message</span> | ||
<textarea class="input" name="message" maxlenght="1000" title="Message we have to read <3"spellcheck="true" placeholder="Your looong message" required="true"></textarea> | ||
</div> | ||
<div class="wrap-input"> | ||
<span class="label">Why are you contacting us?</span> | ||
<select class="input" title="Why are you contacting us?" style="height: 40px;margin-top: 10px;width: 100%;" name="reason"> | ||
<option value="select_disabled" disabled selected>Select option</option> | ||
<option value="feature_request">Feauture Request</option> | ||
<option value="bug_report">Bug report</option> | ||
<option value="general_question">General question</option> | ||
<option value="developer_question">Developer question</option> | ||
<option value="partnership">Partnership</option> | ||
<option value="other">Other</option> | ||
</select> | ||
</div> | ||
<% } else { %> | ||
<div class="wrap-input rs1-wrap-input noactive"> | ||
<span class="label">Name</span> | ||
<input class="input" title="Please login to contact us!" maxlenght="100" autocomplete="off" spellcheck="false" type="text" name="tmp_name" placeholder="Wumpus#0001" disabled /> | ||
</div> | ||
<div class="wrap-input rs1-wrap-input noactive"> | ||
<span class="label">Email</span> | ||
<input class="input" title="Please login to contact us!" maxlenght="100" autocomplete="off" spellcheck="false" type="email" name="tmp_email" placeholder="[email protected]" disabled /> | ||
</div> | ||
<div class="wrap-input noactive"> | ||
<span class="label">Message</span> | ||
<textarea class="input" title="Please login to contact us!" maxlenght="2000" autocomplete="off" spellcheck="true" name="tmp_message" placeholder="Your looong message" disabled></textarea> | ||
</div> | ||
<div class="wrap-input noactive"> | ||
<span class="label">Why are you contacting us?</span> | ||
<select class="input" disabled title="Please login to contact us!" style="height: 40px;margin-top: 10px;width: 100%;" name="reason"> | ||
<option value="select_disabled" disabled selected>Select option</option> | ||
<option value="feature_request">Feauture Request</option> | ||
<option value="bug_report">Bug report</option> | ||
<option value="general_question">General question</option> | ||
<option value="developer_question">Developer question</option> | ||
<option value="partnership">Partnership</option> | ||
<option value="other">Other</option> | ||
</select> | ||
</div> | ||
<% } %> | ||
|
||
<div class="container-contact-form-btn"> | ||
<% if (user) { %> | ||
<div id="captcha"></div> | ||
<script type="text/javascript"> | ||
var verifyCallback = function (response) { | ||
console.log(response); | ||
}; | ||
var onloadCallback = function () { | ||
grecaptcha.render("captcha", { | ||
sitekey: "<%= recaptcha %>", | ||
callback: verifyCallback, | ||
theme: "dark", | ||
}); | ||
}; | ||
</script> | ||
</div> | ||
<button class="link-button green" style="margin-top: 50px; margin-left: 0px" type="submit">Send</button> | ||
<% } else { %> | ||
<p>You must be logged in to contact us!</p> | ||
</div> | ||
<a href="<%= secure_connection %><%= domain %><%= port %>/login" style="margin-left: 0" class="link-button green">Login</a> | ||
<% if (config.support_server) { %> | ||
<a href="<%= secure_connection %><%= domain %><%= port %>/server" style="margin-left: 0; display: flex; padding: 10px 17px;" class="link-button"><%- include('includes/icons/new_tab.ejs') %> Discord</a> | ||
<% } %> | ||
<form action="/contact" class="contact-form validate-form" method="POST"> | ||
<input type="hidden" name="_csrf" value="<%= csrfToken %>"> | ||
<span class="contact-form-title"></span> | ||
<% if (user) { %> | ||
<input type="hidden" name="id" value="<%= user.id %>"> | ||
<input type="hidden" name="name" value="<%= user.username %>#<%= user.discriminator %>"> | ||
<div class="wrap-input rs1-wrap-input"> | ||
<span class="label">Name</span> | ||
<input disabled class="input" maxlenght="100" autocomplete="off" spellcheck="false" title="You can't change your nickname here!" type="text" name="name_invi" placeholder="Name" value="<%= user.username %>#<%= user.discriminator %>" /> | ||
</div> | ||
<div class="wrap-input rs1-wrap-input"> | ||
<span class="label">Email</span> | ||
<input class="input" type="email" maxlenght="100" title="E-mail through which we can contact you" spellcheck="false" name="email" placeholder="[email protected]" required="true"/> | ||
</div> | ||
<div class="wrap-input"> | ||
<span class="label">Message</span> | ||
<textarea class="input" name="message" maxlenght="1000" title="Message we have to read <3"spellcheck="true" placeholder="Your looong message" required="true"></textarea> | ||
</div> | ||
<div class="wrap-input"> | ||
<span class="label">Why are you contacting us?</span> | ||
<select class="input" title="Why are you contacting us?" style="height: 40px;margin-top: 10px;width: 100%;margin-bottom: 30px;" name="reason"> | ||
<option value="select_disabled" disabled selected>Select option</option> | ||
<option value="feature_request">Feauture Request</option> | ||
<option value="bug_report">Bug report</option> | ||
<option value="general_question">General question</option> | ||
<option value="developer_question">Developer question</option> | ||
<option value="partnership">Partnership</option> | ||
<option value="other">Other</option> | ||
</select> | ||
</div> | ||
<% } else { %> | ||
<div class="wrap-input rs1-wrap-input noactive"> | ||
<span class="label">Name</span> | ||
<input class="input" title="Please login to contact us!" maxlenght="100" autocomplete="off" spellcheck="false" type="text" name="tmp_name" placeholder="Wumpus#0001" disabled /> | ||
</div> | ||
<div class="wrap-input rs1-wrap-input noactive"> | ||
<span class="label">Email</span> | ||
<input class="input" title="Please login to contact us!" maxlenght="100" autocomplete="off" spellcheck="false" type="email" name="tmp_email" placeholder="[email protected]" disabled /> | ||
</div> | ||
<div class="wrap-input noactive"> | ||
<span class="label">Message</span> | ||
<textarea class="input" title="Please login to contact us!" maxlenght="2000" autocomplete="off" spellcheck="true" name="tmp_message" placeholder="Your looong message" disabled></textarea> | ||
</div> | ||
<div class="wrap-input noactive"> | ||
<span class="label">Why are you contacting us?</span> | ||
<select class="input" disabled title="Please login to contact us!" style="height: 40px;margin-top: 10px;width: 100%;margin-bottom: 30px;" name="reason"></select> | ||
</div> | ||
<% } %> | ||
<div class="container-contact-form-btn"> | ||
<% if (user) { %> | ||
<script src="https://js.hcaptcha.com/1/api.js" async defer></script> | ||
<div class="h-captcha" data-sitekey="<%= recaptcha %>" data-theme="dark"></div> | ||
<div id="captcha"></div> | ||
</div> | ||
<button class="link-button green" style="margin-top: 20px; margin-left: 0px" type="submit">Send</button> | ||
<% } else { %> | ||
<p>You must be logged in to contact us!</p> | ||
</div> | ||
<a href="<%= secure_connection %><%= domain %><%= port %>/login" style="margin-left: 0" class="link-button green">Login</a> | ||
<% if (config.support_server) { %> | ||
<a href="<%= secure_connection %><%= domain %><%= port %>/server" style="margin-left: 0; display: flex; padding: 10px 17px;" class="link-button"><%- include('includes/icons/new_tab.ejs') %> Discord</a> | ||
<% } %> | ||
</form> | ||
<% } %> | ||
</form> | ||
</div> | ||
</div> | ||
<% if (user) { %> | ||
<script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" async defer></script> | ||
<% } %> | ||
<%- include("includes/footer") %> |
Oops, something went wrong.