Rollback Fix
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
+36
-29
@@ -82,15 +82,11 @@
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<a id="AdminPanel" type="button" class="nav-link RightNavButton" style="display: none;">
|
||||
Admin Panel
|
||||
</a>
|
||||
<a id="NavLogin" type="button" class="nav-link RightNavButton" data-bs-toggle="modal" data-bs-target="#LoginModal" style="display: block;">
|
||||
<a id="NavLogin" type="button" class="nav-link LoginButton" data-bs-toggle="modal" data-bs-target="#LoginModal" style="display: block;">
|
||||
Login
|
||||
</a>
|
||||
<a id="NavUser" class="nav-link RightNavText" style="display: none;"></a>
|
||||
<a id="UserLogout" type="button" class="nav-link RightNavButton" style="display: none;">
|
||||
Logout
|
||||
<a id="NavUser" type="button" class="nav-link LoginButton" style="display: none;">
|
||||
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -124,56 +120,67 @@
|
||||
<div class="modal-body">
|
||||
<div class="tab-content" id="ModalLoginTabContent">
|
||||
<div class="tab-pane fade show active" id="Login" role="tabpanel" aria-labelledby="LoginTab">
|
||||
<form class="box">
|
||||
<form id="LoginForm" class="box">
|
||||
<h1 class="text-muted">
|
||||
Team Login
|
||||
</h1>
|
||||
|
||||
<input id="loginUsername" type="text" name="groupName" placeholder="Gruppe navn">
|
||||
<input id="loginPassword" type="password" name="password" placeholder="Password">
|
||||
|
||||
<input id="LoginBtn" type="submit" name="login" value="Login">
|
||||
<input id="AdminLoginBtn" type="submit" name="aLogin" value="Login som admin">
|
||||
</form>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="Registrer" role="tabpanel" aria-labelledby="RegistrerTab">
|
||||
<form class="box">
|
||||
<form id="RegisterForm" method="POST" class="box">
|
||||
<h1 class="text-muted">
|
||||
Team Registrering
|
||||
</h1>
|
||||
<input id="username" type="text" name="" placeholder="Gruppe navn">
|
||||
<input id="pass1" type="password" class="" name="" placeholder="Password">
|
||||
<input id="pass2" type="password" name="" placeholder="Gentag Password">
|
||||
<div class="form-check" style="display: table; margin: auto;">
|
||||
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault">
|
||||
<label class="form-check-label" for="flexCheckDefault">
|
||||
Jeg accepterer Vilkår og betingelser
|
||||
</label>
|
||||
<input id="username" type="text" name="groupName" placeholder="Unikt gruppe navn">
|
||||
<input id="pass1" type="password" class="" placeholder="Password">
|
||||
<input id="pass2" type="password" class="" name="password" placeholder="Gentag Password">
|
||||
<select id="GameJamSelect" class="form-select" aria-label="Default select example">
|
||||
|
||||
</select>
|
||||
|
||||
<input type="hidden" name="groupAmount" id="groupAmount">
|
||||
<input type="hidden" name="gameJamId" id="gameJamId">
|
||||
<div id="NUD" class="btn-group" role="group" aria-label="Basic example">
|
||||
<button id="NUDMinus" type="button" class="btn btn-primary">
|
||||
<i class="fas fa-minus"></i>
|
||||
</button>
|
||||
<button disabled id="NUDDisplay" type="button" class="btn btn-primary">
|
||||
Antal medlemmer
|
||||
</button>
|
||||
<button id="NUDPlus" type="button" class="btn btn-primary">
|
||||
<i class="fas fa-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div id="pass_info">
|
||||
<h5>Passsword skal opfylde følgende krav :</h5>
|
||||
<ul>
|
||||
<li id="letter" class="invalid">
|
||||
Mindst 1 <strong>bogstave
|
||||
</strong>
|
||||
Mindst 1 <strong>lille bogstave</strong>
|
||||
</li>
|
||||
<li id="capital" class="invalid">
|
||||
Mindst 1 <strong>stort bogstave
|
||||
</strong>
|
||||
Mindst 1 <strong>stort bogstave</strong>
|
||||
</li>
|
||||
<li id="number" class="invalid">
|
||||
Mindst 1 <strong>tal
|
||||
</strong>
|
||||
Mindst 1 <strong>tal</strong>
|
||||
</li>
|
||||
<li id="length" class="invalid">
|
||||
Mindst <strong>8 tegn langt
|
||||
</strong>
|
||||
<li id="special" class="invalid">
|
||||
Mindst 1 <strong>special tegn</strong>
|
||||
</li>
|
||||
<li id="min-length" class="invalid">
|
||||
Mindst <strong>8 tegn langt</strong>
|
||||
</li>
|
||||
<li id="max-length" class="invalid">
|
||||
Maksimalt <strong>255 tegn langt</strong>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<input type="submit" name="" value="Registrer" href="#">
|
||||
<input id="RegisterBtn" type="submit" name="regGroup" value="Registrer">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,36 +1,28 @@
|
||||
$(document).ready(function () {
|
||||
// Register Start
|
||||
let selectedGameJam;
|
||||
let MemberSize = $('#NUDDisplay').text();
|
||||
let displayValue = 0;
|
||||
let AvailableJams = [
|
||||
let arr = [
|
||||
{"id": "-1", "Gamejam": "Vælg aktivt GameJam"}
|
||||
];
|
||||
|
||||
let GroupName = getCookie('groupName');
|
||||
let GroupId = getCookie('groupId');
|
||||
|
||||
// Control Logged in users
|
||||
if (GroupId != null)
|
||||
{
|
||||
LoggedInUser();
|
||||
}
|
||||
//
|
||||
|
||||
// Register Start
|
||||
|
||||
// Populate select with options from the database
|
||||
axios.get('/Backend/Controllers/GameJam/GetGameJam.php')
|
||||
.then(function(res) {
|
||||
let resArr = res.data.data;
|
||||
let resArr = res.data;
|
||||
|
||||
for(let i = 0; i < resArr.length; i++)
|
||||
//console.log(res.data.data);
|
||||
|
||||
for(let i = 0; i < res.data.data.length; i++)
|
||||
{
|
||||
AvailableJams.push({
|
||||
id: resArr[i].id,
|
||||
Gamejam: resArr[i].name
|
||||
arr.push({
|
||||
id: res.data.data[i].id,
|
||||
Gamejam: res.data.data[i].name
|
||||
});
|
||||
}
|
||||
|
||||
$.each(AvailableJams, function(i, data) {
|
||||
$.each(arr, function(i, data) {
|
||||
if (i === 0)
|
||||
{
|
||||
$('#GameJamSelect').append('<option disabled selected value="' + data.id + '">' + data.Gamejam + '</option>');
|
||||
@@ -162,15 +154,7 @@ $(document).ready(function () {
|
||||
axios.post(URL, formData, {
|
||||
header: 'multipart/form-data'
|
||||
}).then(res => {
|
||||
if (res.status == 201)
|
||||
{
|
||||
let LoginModalElem = document.getElementById('LoginModal')
|
||||
let LoginModal = bootstrap.Modal.getInstance(LoginModalElem);
|
||||
|
||||
LoginModal.hide();
|
||||
|
||||
LoggedInUser();
|
||||
}
|
||||
console.log(res);
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
@@ -205,14 +189,20 @@ $(document).ready(function () {
|
||||
$('#NUDDisplay').text(displayValue);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
async function GetGroupNames() {
|
||||
const res = await axios.get('/Backend/Controllers/Group/GetGroup.php');
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
// Register end
|
||||
|
||||
// Login start
|
||||
$('#LoginForm').submit(function(e) {
|
||||
let URL = "/Backend/Controllers/Group/Login.php";
|
||||
|
||||
$('#loginUsername').attr('name') = "groupName";
|
||||
|
||||
let form = $('#LoginForm')[0];
|
||||
let formData = new FormData(form);
|
||||
|
||||
@@ -221,17 +211,13 @@ $(document).ready(function () {
|
||||
|
||||
formData.append(id, value);
|
||||
|
||||
|
||||
axios.post(URL, formData, {
|
||||
header: 'multipart/form-data'
|
||||
}).then(res => {
|
||||
if (res.status === 200)
|
||||
{
|
||||
let LoginModalElem = document.getElementById('LoginModal')
|
||||
let LoginModal = bootstrap.Modal.getInstance(LoginModalElem);
|
||||
|
||||
LoginModal.hide();
|
||||
|
||||
LoggedInUser();
|
||||
console.log('Logged in');
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
@@ -240,94 +226,4 @@ $(document).ready(function () {
|
||||
e.preventDefault();
|
||||
})
|
||||
// Login end
|
||||
|
||||
// Admin Login Start
|
||||
$('#AdminLoginBtn').submit(function(e) {
|
||||
let URL = "/Backend/Controllers/Admin/AdminLogin.php";
|
||||
|
||||
$('#loginUsername').attr('name') = "userName";
|
||||
|
||||
let form = $('#LoginForm')[0];
|
||||
let formData = new FormData(form);
|
||||
|
||||
let id = $('#LoginBtn').attr('name');
|
||||
let value = $('#LoginBtn').val();
|
||||
|
||||
formData.append(id, value);
|
||||
|
||||
axios.post(URL, formData, {
|
||||
header: 'multipart/form-data'
|
||||
}).then(res => {
|
||||
if (res.status === 200)
|
||||
{
|
||||
let LoginModalElem = document.getElementById('LoginModal')
|
||||
let LoginModal = bootstrap.Modal.getInstance(LoginModalElem);
|
||||
|
||||
LoginModal.hide();
|
||||
|
||||
LoggedInUser();
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
e.preventDefault();
|
||||
});
|
||||
// Admin Login End
|
||||
|
||||
// Logout Start
|
||||
$('#UserLogout').click(function() {
|
||||
axios.get('/Backend/Controllers/Group/Logout.php').then(res => {
|
||||
if(res.status === 200)
|
||||
{
|
||||
UserLoggedOut();
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
});
|
||||
// Logout End
|
||||
|
||||
// Functions Start
|
||||
function LoggedInUser() {
|
||||
$('#NavLogin').css({
|
||||
"display": "none"
|
||||
});
|
||||
|
||||
$('#UserLogout').css({
|
||||
"display": "block"
|
||||
});
|
||||
|
||||
$('#NavUser').text(`Logget ind som: ${GroupName}`);
|
||||
$('#NavUser').css({
|
||||
"display": "block"
|
||||
});
|
||||
}
|
||||
|
||||
function UserLoggedOut() {
|
||||
$('#NavLogin').css({
|
||||
"display": "block"
|
||||
});
|
||||
|
||||
$('#UserLogout').css({
|
||||
"display": "None"
|
||||
});
|
||||
|
||||
$('#NavUser').css({
|
||||
"display": "none"
|
||||
});
|
||||
}
|
||||
|
||||
async function GetGroupNames() {
|
||||
const res = await axios.get('/Backend/Controllers/Group/GetGroup.php');
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
function getCookie(name) {
|
||||
const value = `; ${document.cookie}`;
|
||||
const parts = value.split(`; ${name}=`);
|
||||
if (parts.length === 2) return parts.pop().split(';').shift();
|
||||
}
|
||||
// Functions End
|
||||
});
|
||||
+69
-26
@@ -118,15 +118,11 @@ a:hover {
|
||||
margin: 1vw 10vw 0;
|
||||
}
|
||||
|
||||
.RightNavText {
|
||||
color: rgba(255, 255, 255, .75);
|
||||
}
|
||||
|
||||
.RightNavButton {
|
||||
.LoginButton {
|
||||
color: rgba(255, 255, 255, .55);
|
||||
}
|
||||
|
||||
.RightNavButton:hover {
|
||||
.LoginButton:hover {
|
||||
color: rgba(255, 255, 255, .75);
|
||||
}
|
||||
|
||||
@@ -263,7 +259,7 @@ a:hover {
|
||||
|
||||
.modal-body {
|
||||
padding: 0 0;
|
||||
margin: 1vh 1vw;
|
||||
margin: 2vh 2vw;
|
||||
background-color: rgb(18, 18, 18);
|
||||
}
|
||||
|
||||
@@ -355,6 +351,65 @@ a:hover {
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
.box #NUDMinus {
|
||||
color: rgba(255, 255, 255, .55);
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.box #NUDMinus:focus {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.box #NUDMinus:focus-visible {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.box #NUDDisplay {
|
||||
color: rgba(255, 255, 255, .55);
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
cursor: text;
|
||||
width: 65%;
|
||||
}
|
||||
|
||||
.box #NUDDisplay:focus {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.box #NUDDisplay:focus-visible {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.box #NUDPlus {
|
||||
color: rgba(255, 255, 255, .55);
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.box #NUDPlus:focus {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.box #NUDPlus:focus-visible {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.box #GameJamSelect:focus {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.box #GameJamSelect:hover {
|
||||
color: rgba(255, 255, 255, .75);
|
||||
}
|
||||
|
||||
.box #GameJamSelect ul {
|
||||
background-color: red;
|
||||
}
|
||||
|
||||
|
||||
.box {
|
||||
background-color: rgb(18, 18, 18);
|
||||
}
|
||||
@@ -397,12 +452,11 @@ a:hover {
|
||||
color: rgba(255, 255, 255, .75);
|
||||
}
|
||||
|
||||
.box #LoginBtn,
|
||||
.box #RegisterBtn {
|
||||
.box input[type="submit"] {
|
||||
border: 0;
|
||||
background: none;
|
||||
display: block;
|
||||
margin: 20px auto 0 auto;
|
||||
margin: 20px auto;
|
||||
text-align: center;
|
||||
border: 2px solid rgb(46, 204, 113);
|
||||
padding: 14px 40px;
|
||||
@@ -413,22 +467,7 @@ a:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.box #AdminLoginBtn {
|
||||
border: 0;
|
||||
background: transparent;
|
||||
color: rgba(255, 255, 255, .55);
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
padding: 14px 10px;
|
||||
outline: none;
|
||||
border-radius: 24px;
|
||||
transition: 0.25s;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.box #LoginBtn:hover,
|
||||
.box #RegisterBtn:hover {
|
||||
.box input[type="submit"]:hover {
|
||||
background: rgb(46, 204, 113);
|
||||
color: rgba(255, 255, 255, .75);
|
||||
}
|
||||
@@ -690,6 +729,10 @@ image_gruppenavn{
|
||||
background-color: #01579b;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.hasEvent {
|
||||
background-color: red;;
|
||||
}
|
||||
/*Kalender slut*/
|
||||
|
||||
#return-to-top {
|
||||
|
||||
Reference in New Issue
Block a user