Refactor HTML structure and improve indentation in login template

1 parent dee5edc6
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en" <html lang="en" tal:define="home request.home;">
tal:define="home request.home;">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<!-- SmartAdmin Styles : Caution! DO NOT change the order --> <!-- SmartAdmin Styles : Caution! DO NOT change the order -->
<link rel="stylesheet" type="text/css" media="screen" <link rel="stylesheet" type="text/css" media="screen"
href="${home}/static/v3/css/smartadmin-production-plugins.min.css"> href="${home}/static/v3/css/smartadmin-production-plugins.min.css">
<link rel="stylesheet" type="text/css" media="screen" href="${home}/static/v3/css/smartadmin-production.min.css"> <link rel="stylesheet" type="text/css" media="screen" href="${home}/static/v3/css/smartadmin-production.min.css">
<link rel="stylesheet" type="text/css" media="screen" href="${home}/static/v3/css/smartadmin-skins.min.css"> <link rel="stylesheet" type="text/css" media="screen" href="${home}/static/v3/css/smartadmin-skins.min.css">
...@@ -31,184 +31,181 @@ ...@@ -31,184 +31,181 @@
</head> </head>
<body> <body>
<div id="content" class="container"> <div id="content" class="container">
<div class="row"> <div class="row">
<div class="col-xs-12 col-sm-12 col-md-6 col-md-offset-3 col-lg-4 col-lg-offset-4" style="margin-top:50px"> <div class="col-xs-12 col-sm-12 col-md-6 col-md-offset-3 col-lg-4 col-lg-offset-4" style="margin-top:50px">
<div class="well no-padding"> <div class="well no-padding">
<form id="deform" method="POST" enctype="multipart/form-data" accept-charset="utf-8" <form id="deform" method="POST" enctype="multipart/form-data" accept-charset="utf-8"
class="smart-form client-form panel form-signin" style="border:0px;"> class="smart-form client-form panel form-signin" style="border:0px;">
<header class="bg-color-blue"> <header class="bg-color-blue">
<h1 class="txt-color-white login-header-big" align="center" <h1 class="txt-color-white login-header-big" align="center" style="letter-spacing:1px;">
style="letter-spacing:1px;">${request.app_name}</h1> ${request.app_name}</h1>
</header> </header>
<fieldset class="deformFormFieldset"> <fieldset class="deformFormFieldset">
<input type="hidden" name="_charset_"/> <input type="hidden" name="_charset_" />
<input type="hidden" name="__formid__" value="deform"/> <input type="hidden" name="__formid__" value="deform" />
<div tal:condition="request.session.peek_flash()"> <div tal:condition="request.session.peek_flash()">
<div class="alert alert-success" tal:repeat="message request.session.pop_flash()"><i <div class="alert alert-success" tal:repeat="message request.session.pop_flash()"><i
class="fa fa-fw fa-lg fa-check-circle"></i>&nbsp;${message} class="fa fa-fw fa-lg fa-check-circle"></i>&nbsp;${message}
</div> </div>
</div>
<div tal:condition="request.session.peek_flash('error')">
<div class="alert alert-danger" tal:repeat="message request.session.pop_flash('error')"><i
class="fa fa-fw fa-lg fa-times-circle"></i>&nbsp;${message}
</div> </div>
</div> <div tal:condition="request.session.peek_flash('error')">
<div class="alert alert-danger" tal:repeat="message request.session.pop_flash('error')"><i
<div class="col-md-12" align="center"> class="fa fa-fw fa-lg fa-times-circle"></i>&nbsp;${message}
<img src="${home}/static/img/logo.png"
class="img-float img-thumbnail" style="height:auto;width:auto;border:none;"/>
</div>
<div class="clearfix"></div>
<section>
<label class="label">USERNAME</label>
<label class="input"> <i class="icon-append fa fa-user"></i>
<input id="username" type="text" name="username" class="form-control">
<b class="tooltip tooltip-top-right">
<i class="fa fa-user txt-color-teal"></i>
ISI DENGAN USERNAME ANDA</b></label>
</section>
<section>
<label class="label">PASSWORD</label>
<label class="input"> <i class="icon-append fa fa-lock"></i>
<input id="password" type="password" name="password" class="form-control">
<b class="tooltip tooltip-top-right"><i class="fa fa-lock txt-color-teal"></i> ISI
DENGAN PASSWORD ANDA</b> </label>
</section>
<section>
<div class="form-group">
<label class=" checkbox checkbox-inline">
<input id="show_password" type="checkbox" style="left: 20px;">Show Password</label>
<div class="note">
<a href="${home}/reset-password" id="lupa" >Lupa Password?</a>
</div> </div>
</div> </div>
</section>
<section tal:condition="'captcha' in form"> <div class="col-md-12" align="center">
<div tal:define="field form['captcha']"> <img src="${home}/static/img/logo.png" class="img-float img-thumbnail"
${structure:field.serialize()} style="height:auto;width:auto;border:none;" />
</div> </div>
</section>
<section tal:condition="'csrf_token' in form"> <div class="clearfix"></div>
<div tal:define="field form['csrf_token']" style="display: none;">
<section>
<label class="label">USERNAME</label>
<label class="input"> <i class="icon-append fa fa-user"></i>
<input id="username" type="text" name="username" class="form-control">
<b class="tooltip tooltip-top-right">
<i class="fa fa-user txt-color-teal"></i>
ISI DENGAN USERNAME ANDA</b></label>
</section>
<section>
<label class="label">PASSWORD</label>
<label class="input"> <i class="icon-append fa fa-lock"></i>
<input id="password" type="password" name="password" class="form-control">
<b class="tooltip tooltip-top-right"><i class="fa fa-lock txt-color-teal"></i> ISI
DENGAN PASSWORD ANDA</b> </label>
</section>
<section>
<div class="form-group">
<label class=" checkbox checkbox-inline">
<input id="show_password" type="checkbox" style="left: 20px;">Show Password</label>
<div class="note">
<a href="${home}/reset-password" id="lupa">Lupa Password?</a>
</div>
</div>
</section>
<section tal:condition="'captcha' in form">
<div tal:define="field form['captcha']">
${structure:field.serialize()} ${structure:field.serialize()}
</div> </div>
</section> </section>
</fieldset> <section tal:condition="'csrf_token' in form">
<footer> <div tal:define="field form['csrf_token']" style="display: none;">
<section> ${structure:field.serialize()}
<div class="row" style="float:right"> </div>
<button type="submit" id="login-btn" name="login" </section>
class="btn btn-primary" style="float:left"
value="Login"> </fieldset>
Login <footer>
</button> <section>
<button tal:condition="request.allow_register" <div class="row" style="float:right">
id="register" name="register" class="btn btn-info" <button type="submit" id="login-btn" name="login" class="btn btn-primary" style="float:left"
value="Login">
Login
</button>
<button tal:condition="request.allow_register" id="register" name="register" class="btn btn-info"
value="Register" style="float:left"> value="Register" style="float:left">
Register Register
</button> </button>
<!--? <div class="clearfix"></div>--> <!--? <div class="clearfix"></div>-->
</div>
</section>
</footer>
<footer>
<section>
<div class="row" tal:condition="request.google_signin_client_id and allow_register(request)">
<div id="g_id_onload"
data-client_id="${request.google_signin_client_id}"
data-callback="onSignIn">
</div> </div>
<div class="g_id_signin" data-type="standard"></div> </section>
</div> </footer>
</section> <footer>
<section> <section>
<input id="provider_name" type="hidden" name="provider_name" class="form-control"> <div class="row" tal:condition="request.google_signin_client_id and request.allow_register">
<input id="id_token" type="hidden" name="id_token" class="form-control"> <div id="g_id_onload" data-client_id="${request.google_signin_client_id}" data-callback="onSignIn">
</section> </div>
</footer> <div class="g_id_signin" data-type="standard"></div>
</div>
</section>
<section>
<input id="provider_name" type="hidden" name="provider_name" class="form-control">
<input id="id_token" type="hidden" name="id_token" class="form-control">
</section>
</footer>
</form> </form>
</div>
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- Bootstrap core JavaScript <!-- Bootstrap core JavaScript
================================================== --> ================================================== -->
<!-- Placed at the end of the document so the pages load faster --> <!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="${home}/deform_static/scripts/jquery-2.0.3.min.js"></script> <script type="text/javascript" src="${home}/deform_static/scripts/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="${home}/deform_static/scripts/bootstrap.min.js"></script> <script type="text/javascript" src="${home}/deform_static/scripts/bootstrap.min.js"></script>
<script type="text/javascript" src="${home}/deform_static/scripts/deform.js"></script> <script type="text/javascript" src="${home}/deform_static/scripts/deform.js"></script>
<!--? <script tal:condition="request.google_signin_client_id"--> <!--? <script tal:condition="request.google_signin_client_id"-->
<!--? src="https://apis.google.com/js/platform.js" async defer></script>--> <!--? src="https://apis.google.com/js/platform.js" async defer></script>-->
<script tal:condition="request.google_signin_client_id" <script tal:condition="request.google_signin_client_id" src="https://accounts.google.com/gsi/client" async
src="https://accounts.google.com/gsi/client" async defer></script> defer></script>
<script tal:condition="request.google_signin_client_id"> <script tal:condition="request.google_signin_client_id">
window.onload = function (e) { window.onload = function (e) {
const value = document.cookie; const value = document.cookie;
const parts = value.split(`g_state=`); const parts = value.split(`g_state=`);
if (parts.length === 2) { if (parts.length === 2) {
document.cookie = document.cookie + ";max-age=0"; document.cookie = document.cookie + ";max-age=0";
}
}
function onSignIn(googleUser) {
// var profile = googleUser.getBasicProfile();
// console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.
// console.log('Name: ' + profile.getName());
// console.log('Image URL: ' + profile.getImageUrl());
// console.log('Email: ' + profile.getEmail()); // This is null if the 'email' scope is not present.
//getId(), getName(), getGivenName(), getFamilyName(), getImageUrl(), getEmail() methods, and
// console.log(googleUser);
// console.log(googleUser.getId());
// console.log(googleUser.getName());
// var id_token = googleUser.getAuthResponse().id_token;
document.getElementById('provider_name').value = "google";
document.getElementById('id_token').value = JSON.stringify(googleUser);
document.getElementById("deform").submit();
// var xhr = new XMLHttpRequest();
// xhr.open('POST', '/googlesignin');
// xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
// xhr.onload = function() {
// console.log('Signed in as: ' + xhr.responseText);
// };
// xhr.send('idtoken=' + id_token);
}
$(document).ready(function () {
$("form#deform").keypress(function (event) {
var keycode = (event.keyCode ? event.keyCode : event.which);
if (keycode == '13') {
event.preventDefault();
$("button#login-btn").click();
} }
}
function onSignIn(googleUser) {
// var profile = googleUser.getBasicProfile();
// console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.
// console.log('Name: ' + profile.getName());
// console.log('Image URL: ' + profile.getImageUrl());
// console.log('Email: ' + profile.getEmail()); // This is null if the 'email' scope is not present.
//getId(), getName(), getGivenName(), getFamilyName(), getImageUrl(), getEmail() methods, and
// console.log(googleUser);
// console.log(googleUser.getId());
// console.log(googleUser.getName());
// var id_token = googleUser.getAuthResponse().id_token;
document.getElementById('provider_name').value = "google";
document.getElementById('id_token').value = JSON.stringify(googleUser);
document.getElementById("deform").submit();
// var xhr = new XMLHttpRequest();
// xhr.open('POST', '/googlesignin');
// xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
// xhr.onload = function() {
// console.log('Signed in as: ' + xhr.responseText);
// };
// xhr.send('idtoken=' + id_token);
}
$(document).ready(function () {
$("form#deform").keypress(function (event) {
var keycode = (event.keyCode ? event.keyCode : event.which);
if (keycode == '13') {
event.preventDefault();
$("button#login-btn").click();
}
});
}); });
}); </script>
</script> <script>
<script> $(document).ready(function () {
$(document).ready(function () { $("#show_password").on("click", function () {
$("#show_password").on("click", function () { var x = $("#password");
var x = $("#password"); if (x.attr("type") === "password") {
if (x.attr("type") === "password") { x.attr("type", "text");
x.attr("type","text"); } else {
} else { x.attr("type", "password");
x.attr("type","password"); }
} });
}); });
}); </script>
</script>
</body> </body>
</html> </html>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!