Added login form to /account/ and fixes for other forms.

This commit is contained in:
Johannes Findeisen 2024-12-20 01:47:29 +01:00
commit 4482f69836
3 changed files with 109 additions and 26 deletions

View file

@ -1,12 +1,14 @@
// Contact form
#contactform {
padding: 20px;
border: 1px solid $grey-color;
background: $grey-color-light;
//padding: 20px;
//border: 1px solid $grey-color;
//background: $grey-color-light;
//display: inline;
}
#contactform label, #contactform input, #contactform textarea {
display: block;
width: 97%;
width: 98%;
resize: none;
}
@ -40,15 +42,55 @@
background: $headline-color;
}
#searchform {
padding: 20px;
// Login form
#loginform {
//background: $grey-color-light;
//border: 1px solid $grey-color;
display: inline;
//padding: 20px;
//width: 380px;
}
#loginform label, #loginform input{
//display: block;
resize: none;
}
#loginform label { margin: 10px 0; }
#loginform label:first-child { margin-top: 0; }
#loginform input {
border: 1px solid $grey-color;
background: $grey-color-light;
font-family: $base-font-family;
line-height: $base-line-height;
font-size: $base-font-size;
//font-weight: 300;
margin: 10px;
padding: 10px;
}
#loginform input[type=submit] {
border: 0;
background: $brand-color;
color: #fff;
cursor: pointer;
}
#loginform input[type=submit]:hover {
background: $headline-color;
}
// Search form
#searchform {
//padding: 20px;
//border: 1px solid $grey-color;
//background: $grey-color-light;
}
#searchform label, #searchform input, #searchform textarea {
display: block;
width: 97%;
width: 98%;
resize: none;
}

View file

@ -9,4 +9,43 @@ subtitle: Manage your account here...
permalink: /account/
---
<h2>TODO! :P :D :)</h2>
<h2>Login</h2>
<script>
function doSubmit() {
window.alert("Not implemented yet... ;)");
//$("#loader").removeClass("hidden");
event.preventDefault();
var form = $('#loginform')[0];
var data = new FormData(form);
$.ajax({
type: "POST",
enctype: 'multipart/form-data',
data: data,
url: "/cgi/login/",
processData: false,
contentType: false,
cache: false,
success: function(data){
//window.alert(data);
//$("#challenge").load("/cgi/challenge/");
$("#loader").addClass("hidden");
}
});
return false;
}
//$(document).ready(function(){
// $("#challenge").load("/cgi/challenge/");
//});
</script>
<div style="margin:0;padding0;text-align:center;">
<form id="loginform" method="post" onsubmit="return doSubmit();">
<div style="margin:0;padding0;"><label>Username:</label>
<input type="text" name="username" id="username" required></div>
<div style="margin:0;padding0;"><label>Password:</label>
<input type="password" name="password" id="password" required></div>
<div style="margin:0;padding0;text-align:right;"><input type="submit" value="Login!" id="button"></div>
</form>
</div>

View file

@ -39,28 +39,30 @@ $(document).ready(function(){
});
</script>
<form id="contactform" method="post" onsubmit="return doSubmit();">
<div><label>Name:<span style="color:red;">*</span></label>
<input type="text" name="name" id="name" required></div>
<div style="margin:0;padding0;text-align:left;">
<form id="contactform" method="post" onsubmit="return doSubmit();">
<div><label>Name:<span style="color:red;">*</span></label>
<input type="text" name="name" id="name" required></div>
<div><label>Email:</label>
<input type="email" name="email" id="email"></div>
<div><label>Email:</label>
<input type="email" name="email" id="email"></div>
<div><label>Website:</label>
<input type="text" name="website" id="website"></div>
<div><label>Website:</label>
<input type="text" name="website" id="website"></div>
<div><label>Subject:</label>
<input type="text" name="subject" id="subject"></div>
<div><label>Subject:</label>
<input type="text" name="subject" id="subject"></div>
<div><label>Message:<span style="color:red;">*</span></label>
<textarea name="message" id="message" required style="font-size:1em;font-family:OpenSans-Regular;"></textarea></div>
<div><label>Message:<span style="color:red;">*</span></label>
<textarea name="message" id="message" required style="font-size:1em;font-family:OpenSans-Regular;"></textarea></div>
<div style="text-align:left;width:50%;float:left;"><label>Challenge: <span id="challenge" name="challenge">NULL</span>?
<span style="color:red;">*</span></label>
<input style="width:10%;text-align:center;" type="text" name="sum" id="sum" required></div>
<div style="text-align:left;width:50%;float:left;"><label>Challenge: <span id="challenge" name="challenge">NULL</span>?
<span style="color:red;">*</span></label>
<input style="width:10%;text-align:center;" type="text" name="sum" id="sum" required></div>
<div style="text-align:right;width:50%;float:right;"><span style="color:red;">*</span> = Required fields</div>
<div style="text-align:right;width:50%;float:right;"><span style="color:red;">*</span> = Required fields</div>
<div><input type="submit" value="Send!" id="button"></div>
</form>
<div><input type="submit" value="Send!" id="button"></div>
</form>
</div>