mirror of
https://gitlab.com/CodeSolutionsProject/CodeShare.git
synced 2026-02-14 17:11:34 +01:00
#15 finished
This commit is contained in:
@@ -54,6 +54,10 @@ p{
|
||||
background-color: #b2dbfb !important
|
||||
}
|
||||
|
||||
.loginMessage {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.codebox{
|
||||
margin-top: 2em;
|
||||
margin-bottom: 2em;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<script src="{{ app.frontjs }}/highlight.pack.js"></script>
|
||||
<script src="{{ app.frontjs }}/jquery-3.2.1.min.js"></script>
|
||||
<script src="{{ app.frontjs }}/jquery.form.min.js"></script>
|
||||
<script src="{{ app.frontjs }}/bootstrap.min.js"></script>
|
||||
<script src='https://www.google.com/recaptcha/api.js'></script>
|
||||
<script src="{{ app.frontjs }}/functions.js"></script>
|
||||
|
||||
@@ -8,20 +8,15 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
{% if page.state == 'BAD_CREDENTIAL' %}
|
||||
<p class="text-danger">Bad credentials</p>
|
||||
{% elseif page.state == 'POST_ERROR' %}
|
||||
<p class="text-danger">Error during sign-up, check your data</p>
|
||||
{% elseif page.state == 'MAIL_IN_USE' %}
|
||||
<p class="text-danger">The e-mail is currently in use</p>
|
||||
{% elseif page.state == 'NICK_IN_USE' %}
|
||||
<p class="text-danger">The nickname is currently in use</p>
|
||||
{% endif %}
|
||||
<p class="text-danger loginMessage" id="BAD_CREDENTIAL">Bad credentials</p>
|
||||
<p class="text-danger loginMessage" id="POST_ERROR">Error during sign-up, check your data</p>
|
||||
<p class="text-danger loginMessage" id="MAIL_IN_USE">The e-mail is currently in use</p>
|
||||
<p class="text-danger loginMessage" id="NICK_IN_USE">The nickname is currently in use</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="login">
|
||||
<form class="form-horizontal" method="post">
|
||||
<form class="form-horizontal" method="post" id="loginForm">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="email">Email:</label>
|
||||
<div class="col-sm-10">
|
||||
@@ -45,7 +40,7 @@
|
||||
</form>
|
||||
</div>
|
||||
<div id="register" style="display:none;">
|
||||
<form class="form-horizontal" method="post">
|
||||
<form class="form-horizontal" method="post" id="regForm">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="emailre">Email:</label>
|
||||
<div class="col-sm-10">
|
||||
@@ -98,6 +93,28 @@
|
||||
{% block js %}
|
||||
<script>
|
||||
|
||||
doneFun = function(data){
|
||||
console.log(data);
|
||||
if (data == 'redirect'){
|
||||
window.location.href = '{{path('home')}}';
|
||||
}
|
||||
var todos = $(".text-danger").each(function (){
|
||||
$(this).css("display","none");
|
||||
});
|
||||
$("#"+data).css('display',"block");
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
var options = {success: doneFun,
|
||||
url: '{{ path("login")}}',
|
||||
beforeSubmit: function(arr, $form, options){
|
||||
console.log(arr);
|
||||
}} ;
|
||||
$("#regForm").ajaxForm(options);
|
||||
|
||||
$("#loginForm").ajaxForm(options);
|
||||
});
|
||||
|
||||
function checkPassword() {
|
||||
if ($('#pwdre').val() != $("#pwdre-re").val()) {
|
||||
$("#pwdre-re")[0].setCustomValidity('Password do not match');
|
||||
|
||||
11
Source/assets/js/jquery.form.min.js
vendored
Normal file
11
Source/assets/js/jquery.form.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user