diff --git a/app/templates/home.html b/app/templates/home.html index dd75a2a78256a03b02dccbbacefad2d54023747f..2ca97ffab4f9d2cbe228c77ae7555bd7797a3b3d 100644 --- a/app/templates/home.html +++ b/app/templates/home.html @@ -1,93 +1,98 @@ <!DOCTYPE html> <html lang="en"> - <head> - <link href="/static/style.css" rel="stylesheet"> - <link href="/static/font.css" rel="stylesheet"> - <link href="/static/darkmode.css" rel="stylesheet"> - <title>URL shorter</title> - {% if cookieNotice %} - <script src="/static/cookie.js"></script> - {% endif %} - {% if recaptchaPublicKey %} - <script src="https://www.google.com/recaptcha/api.js" async defer></script> - <script> - function onSubmit(token) { - document.getElementById("form").submit(); - } - </script> - {% endif %} - </head> - <body> - {% if loginEnabled %} - <div id="loginbar">{{loginbar | safe}}</div> - {% endif %} - <div class="login-page"> - <div class="form"> - {% 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" maxlength="256" value="{{short_url_prefilled}}"/> - {% if passwordProtected %} - <input id="password" name="password" type="password" placeholder="Password"/> - {% endif %} +<head> + <link href="/static/style.css" rel="stylesheet"> + <link href="/static/font.css" rel="stylesheet"> + <link href="/static/darkmode.css" rel="stylesheet"> + <title>URL shorter</title> + {% if cookieNotice %} + <script src="/static/cookie.js"></script> + {% endif %} + {% if recaptchaPublicKey %} + <script src="https://www.google.com/recaptcha/api.js" async defer></script> + <script> + function onSubmit(token) { + document.getElementById("form").submit(); + } + </script> + {% endif %} +</head> - {% if recaptchaPublicKey %} - <button class="g-recaptcha" data-sitekey="{{recaptchaPublicKey}}" data-callback='onSubmit'>short</button> - {% else %} - <button>short</button> - {% endif %} - </form> +<body> + {% if loginEnabled %} + <div id="loginbar">{{loginbar | safe}}</div> + {% endif %} + <div class="login-page"> + <div class="form"> + {% if short_url %} + <h3>Your shortened URL is: <a href="http://{{short_url}}"> {{short_url}}</a></h3> + <img src="/makeqr?link={{short_url}}"> + <p><a href="/">create another link</a></p> + {% else %} + <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 %} - <h3>Your shortened URL is: <a href="http://{{short_url}}"> {{short_url}}</a></h3> - <img src="/makeqr?link={{short_url}}"> - <p><a href="/">create another link</a></p> + <input type="hidden" name="domain" id="domain" value={{domain}}> + {% endif %} + <input id="short" name="short" type="text" placeholder="short name" maxlength="256" + value="{{short_url_prefilled}}" /> + {% if passwordProtected %} + <input id="password" name="password" type="password" placeholder="Password" /> {% endif %} - <p class="message">© Made by <a href="https://jonasled.de">jonasled</a><br> + + {% if recaptchaPublicKey %} + <button class="g-recaptcha" data-sitekey="{{recaptchaPublicKey}}" data-callback='onSubmit'>short</button> + {% else %} + <button>short</button> + {% endif %} + </form> + {% endif %} + <p class="message">© Made by <a href="https://jonasled.de">jonasled</a><br> Sourcecode is available <a href="https://gitlab.jonasled.de/jonasled/url_shorter_docker">here</a><br> {% if builddate %} - Builddate: {{builddate}}<br> + Builddate: {{builddate}}<br> {% endif %} - </p> - </div> + </p> </div> - <div id="snackbar">{{snackbar}}</div> - {% if cookieNotice %} - <div class="cookieinfo"> - <div class="cookieinfo-close" onclick="acceptCookie()"> - ✖ - </div> - <span class="cookieinfo-text"> - We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies. <a class="cookieinfo-link" href="http://wikipedia.org/wiki/HTTP_cookie">More info</a> - </span> - </div> - <script> - checkHide(); - </script> - {% endif %} + </div> + <div id="snackbar">{{snackbar}}</div> + {% if cookieNotice %} + <div class="cookieinfo"> + <div class="cookieinfo-close" onclick="acceptCookie()"> + ✖ + </div> + <span class="cookieinfo-text"> + We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies. <a + class="cookieinfo-link" href="http://wikipedia.org/wiki/HTTP_cookie">More info</a> + </span> + </div> + <script> + checkHide(); + </script> + {% endif %} + + {% if snackbar %} + <script> + document.getElementById("snackbar").className = "show"; + setTimeout(function () { document.getElementById("snackbar").className = x.className.replace("show", ""); }, 10000); + </script> + {% endif %} - {% if snackbar %} - <script> - document.getElementById("snackbar").className = "show"; - setTimeout(function(){ document.getElementById("snackbar").className = x.className.replace("show", ""); }, 10000); - </script> - {% endif %} + {% if domain_prefilled %} + <script> + var x = document.getElementById("domain"); + x.selectedIndex = {{ domain_prefilled }}; + </script> + {% endif %} +</body> - {% if domain_prefilled %} - <script> - var x = document.getElementById("domain"); - x.selectedIndex = {{domain_prefilled}}; - </script> - {% endif %} - </body> </html> \ No newline at end of file