Skip to content
Snippets Groups Projects
Commit 1c088337 authored by Jonas Leder's avatar Jonas Leder
Browse files

hide domain select and recaptcha if not in use

parent 5bd179c0
No related branches found
No related tags found
No related merge requests found
Pipeline #24 passed
......@@ -3,12 +3,14 @@
<head>
<link href="{{ url_for('static', filename='style.css') }}" rel="stylesheet">
<title>URL shorter</title>
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<script>
function onSubmit(token) {
document.getElementById("form").submit();
}
</script>
{% if recaptchaPrivateKey %}
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<script>
function onSubmit(token) {
document.getElementById("form").submit();
}
</script>
{% endif %}
</head>
<body>
......@@ -17,12 +19,21 @@
{% if not short_url %}
<form method="post" id= "form" class="login-form" action="">
<input id="url" name="url" type="url" placeholder="long url" value="{{long_url_prefilled}}"/>
{% if showDomainSelect %}
Domain: <select name="domain" id="domain">
{{domain | safe}}
</select>
<br><p> </p>
{% else %}
<input type="hidden" name="domain" id="domain" value={{domain}}>
{% endif %}
<input id="short" name="short" type="text" placeholder="short name" value="{{short_url_prefilled}}"/>
{% if recaptchaPrivateKey %}
<button class="g-recaptcha" data-sitekey="{{recaptchaPublicKey}}" data-callback='onSubmit'>short</button>
{% else %}
<button>short</button>
{% endif %}
</form>
{% else %}
<h3>Your shortened URL is: <a href="http://{{short_url}}"> {{short_url}}</a></h3>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment