Advertisement
Filosss

Untitled

May 26th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.26 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html xmlns:th="http://www.thymeleaf.org" itemscope itemtype="http://schema.org/Article">
  3.  
  4. <head>
  5. <title>MyCinema</title>
  6. <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css"
  7. integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
  8. <link rel="stylesheet" th:href="@{/stylesheets/Login.css}">
  9. <meta charset="utf-8">
  10. <meta content="width=device-width, initial-scale=1.0" name="viewport">
  11. <!-- BEGIN Pre-requisites -->
  12. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js">
  13. </script>
  14. <script src="https://apis.google.com/js/client:platform.js?onload=start" async defer>
  15. </script>
  16. <script src="https://apis.google.com/js/platform.js" async defer></script>
  17. <meta name="google-signin-client_id"
  18. content="568733693778-dsdcs602d8va4b7u9p5fv0rn2rppddl4.apps.googleusercontent.com">
  19.  
  20. </head>
  21.  
  22.  
  23. <body>
  24.  
  25. <div class="image-container"></div>
  26.  
  27. <div class="flex-white-container"></div>
  28. <div class="white-contanier">
  29.  
  30.  
  31. <div class="title-container"> My Cinema</div>
  32. <div class="subtitle-container">Welcome back! Please login to your account.</div>
  33. <div class="login-container">
  34.  
  35. <form action="#" id="myform" name="myform" th:object="${LoginInput}" method="post" th:action="@{/goToHome}">
  36. <div class="alert" id="feedback" style="display: none">
  37.  
  38. <div class="pair">
  39. <h4 id="error_login">
  40. Error:Invalid credentials
  41. </h4>
  42. <i class="fas fa-times" id="symbol"></i>
  43.  
  44. </div>
  45. </div>
  46. <div class="alert" id="feedback2" style="display: none">
  47.  
  48. <div class="pair">
  49. <h4 id="error_login2">
  50. Error:Email is not verified.Plese go email and verify your email<!doctype html>
  51. <html lang="en">
  52. <head>
  53. <meta charset="UTF-8">
  54. <meta name="viewport"
  55. content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  56. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  57. <title>Document</title>
  58. </head>
  59. <body>
  60.  
  61. </body>
  62. </html>
  63. </h4>
  64. <i class="fas fa-times" id="symbol2"></i>
  65.  
  66. </div>
  67. </div>
  68. <input id="username" placeholder="Username" required th:field="*{username}" type="text"/>
  69. <input id="password" placeholder="Password" required th:field="*{password}" type="password">
  70.  
  71. <div class="checkbox-forgpass-container">
  72. <div class="checkbox-container">
  73. <input form="myform" id="RememberMe" th:field="*{remainConnected}" type="checkbox">
  74. <label for="RememberMe"> Remember Me</label>
  75.  
  76. </div>
  77.  
  78. <a class="forgot-password-container" href="/ForgotPassword"> Forgot Password</a>
  79.  
  80.  
  81. </div>
  82.  
  83. <div class="button-container">
  84. <input class="button" id="btn-login" type="submit" value="Login">
  85. <input class="button" type="button" value="SignUp" onclick="location.href='signUp'">
  86.  
  87. </div>
  88.  
  89. </form>
  90. <!-- <form action="/connect/google" method="POST">-->
  91. <!-- <input type="hidden" name="scope" value="profile" />-->
  92. <!-- <div class="formInfo">-->
  93. <!-- <p>You aren't connected to Google yet. Click the button to connect this application with your account.</p>-->
  94. <!-- </div>-->
  95. <!-- <p><button type="submit">Connect to Google</button></p>-->
  96. <!-- </form>-->
  97.  
  98.  
  99. </div>
  100.  
  101.  
  102. </div>
  103. <div class="flex-white-container"></div>
  104. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
  105.  
  106.  
  107. <script>
  108. var input = document.getElementById('username');
  109. input.onclick = function deleteInput() {
  110. // var inputPass=document.getElementById("username");
  111. // var inputPass=document.getElementById("password");
  112. var feedback = $('#feedback');
  113. feedback.textContent = "";
  114. }
  115. </script>
  116. <script>
  117. function close() {
  118. $("#feedback").css('display', 'none');
  119. }
  120.  
  121. </script>
  122. <script>
  123. $("#myform").submit(function (event) {
  124.  
  125.  
  126. //stop submit the form event.
  127. event.preventDefault();
  128.  
  129. var loginForm = {}
  130. loginForm["username"] = $("#username").val();
  131. loginForm["password"] = $("#password").val();
  132.  
  133. $("#btn-login").prop("disabled", true);
  134.  
  135. $.ajax({
  136. type: "POST",
  137. contentType: "application/json",
  138. url: "/api/login",
  139. data: JSON.stringify(loginForm),
  140. dataType: 'json',
  141. cache: false,
  142. timeout: 600000,
  143. success: function (data) {
  144. console.log(data);
  145. if (data.msg == 'Corect') {
  146. $("#myform").unbind('submit');
  147. document.myform.submit();
  148.  
  149. } else {
  150. if (data.msg == 'email') {
  151. var x = document.getElementById("feedback2");
  152. if (x.style.display === "none") {
  153. x.style.display = "block";
  154. }
  155. } else {
  156. var x = document.getElementById("feedback");
  157. if (x.style.display === "none") {
  158. x.style.display = "block";
  159. }
  160.  
  161. }
  162. }
  163. // JSON.stringify(data, null, 4);
  164.  
  165.  
  166. $("#btn-login").prop("disabled", false);
  167.  
  168. },
  169. error: function (e) {
  170.  
  171. var json = "<h4>Ajax Response Error</h4><pre>"
  172. + e.responseText + "</pre>";
  173. $('#feedback').html(json);
  174.  
  175. console.log("ERROR : ", e);
  176. $("#btn-login").prop("disabled", false);
  177.  
  178. }
  179. });
  180.  
  181. });
  182.  
  183. $("#symbol").click(function () {
  184. $("#feedback").css('display', 'none');
  185. });
  186. $("#symbol2").click(function () {
  187. $("#feedback2").css('display', 'none');
  188. });
  189.  
  190.  
  191. $("#password").click(function () {
  192. if ($("#feedback").css('display') == 'block') {
  193. $("#feedback").css('display', 'none');
  194. }
  195. if ($("#feedback2").css('display') == 'block') {
  196. $("#feedback2").css('display', 'none');
  197. }
  198. });
  199. $("#username").click(function () {
  200. if ($("#feedback").css('display') == 'block') {
  201. $("#feedback").css('display', 'none');
  202. }
  203. if ($("#feedback2").css('display') == 'block') {
  204. $("#feedback2").css('display', 'none');
  205. }
  206. });
  207.  
  208. </script>
  209. <script th:src="@{/scripts/alert.js}"></script>
  210. </body>
  211. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement