v1.5.14 - Added Allow Actions (Registering)
Fixed User Pictures
This commit is contained in:
@@ -45,12 +45,79 @@
|
||||
letter-spacing: 1.2px;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
/* The switch - the box around the slider */
|
||||
.switch {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 60px;
|
||||
height: 28px;
|
||||
}
|
||||
|
||||
/* Hide default HTML checkbox */
|
||||
.switch input {
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/* The slider */
|
||||
.slider {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: #ccc;
|
||||
transition: .4s;
|
||||
}
|
||||
|
||||
.slider:before {
|
||||
position: absolute;
|
||||
content: "";
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
left: 4px;
|
||||
bottom: 4px;
|
||||
background-color: white;
|
||||
transition: .4s;
|
||||
}
|
||||
|
||||
input:checked + .slider {
|
||||
background-color: #00788A;
|
||||
}
|
||||
|
||||
input:focus + .slider {
|
||||
box-shadow: 0 0 1px #00788A;
|
||||
}
|
||||
|
||||
input:checked + .slider:before {
|
||||
transform: translateX(32px);
|
||||
}
|
||||
|
||||
/* Rounded sliders */
|
||||
.slider.round {
|
||||
border-radius: 34px;
|
||||
}
|
||||
|
||||
.slider.round:before {
|
||||
border-radius: 50%;
|
||||
}
|
||||
</style>
|
||||
<div class="row align-items-center">
|
||||
@if(auth()->user()->can('user.create'))
|
||||
<a class="btn btn-inline btn-sde-blue mb-0" href="{{ route('users.create') }}"><img src="{{ asset('/images/icons/plus.svg') }}" alt="Create">Opret Bruger</a>
|
||||
@endif
|
||||
</div>
|
||||
<table class="tbl mt-2 letterSpaceTable fixOverflow" id="table_id">
|
||||
<div class="pb-4 mt-1">
|
||||
<label>Åben for registrering:</label>
|
||||
<label class="switch">
|
||||
<input type="checkbox" onclick="AllowActionRegistering(this)" @if(\App\AllowAction::query()->where('action', '=', 'Registering')->first()->allow == true) checked @endif>
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</div>
|
||||
<table class="tbl mt-2 letterSpaceTable" id="table_id">
|
||||
<thead>
|
||||
<th>Fornavn</th>
|
||||
<th>Efternavn</th>
|
||||
@@ -82,9 +149,9 @@
|
||||
@endfor
|
||||
</td>
|
||||
@if($user->resource_id !== null)
|
||||
<td class="overflow-visible"><a class="showUsers"><img src="{{ asset('/images/icons/eye-dark.svg') }}"><img src="{{ asset(\App\Resource::query()->where("id", "=", $user->resource_id)->first()->filename) }}" class="showUserImages"></a></td>
|
||||
<td style="overflow: visible"><a class="showUsers"><img src="{{ asset('/images/icons/eye-dark.svg') }}"><img src="{{ asset(\App\Resource::query()->where("id", "=", $user->resource_id)->first()->filename) }}" class="showUserImages"></a></td>
|
||||
@else
|
||||
<td class="overflow-visible"><a class="showUsers noImages"><img src="{{ asset('/images/icons/eye-dark.svg') }}"><img src="" class="showUserImages"></a></td>
|
||||
<td style="overflow: visible"><a class="showUsers noImages"><img src="{{ asset('/images/icons/eye-dark.svg') }}"><img src="" class="showUserImages"></a></td>
|
||||
@endif
|
||||
@if(auth()->user()->can('user.edit'))
|
||||
<td><a href="{{ route("users.edit", [ "user" => $user->id ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
|
||||
@@ -153,5 +220,35 @@
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function AllowActionRegistering(el) {
|
||||
if (el.hasAttribute('checked')) {
|
||||
axios.post("{{ route("allowaction.allowactionregistering") }}", null, { params: { id: {{ \App\AllowAction::query()->where('action', '=', 'Registering')->first()->id }}, allow: '0' }}
|
||||
).then(function (response) {
|
||||
el.removeAttribute('checked');
|
||||
|
||||
Swal.fire(
|
||||
'Der er nu lukket for registrering af brugere!',
|
||||
'',
|
||||
'success'
|
||||
)
|
||||
}).catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
} else {
|
||||
axios.post("{{ route("allowaction.allowactionregistering") }}", null, { params: { id: {{ \App\AllowAction::query()->where('action', '=', 'Registering')->first()->id }}, allow: '1' }}
|
||||
).then(function (response) {
|
||||
el.setAttribute('checked', 'checked');
|
||||
|
||||
Swal.fire(
|
||||
'Der er nu åbnet for registrering af brugere!',
|
||||
'',
|
||||
'success'
|
||||
)
|
||||
}).catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -30,7 +30,9 @@
|
||||
{!! session()->get('error#wrongcredentials') !!}
|
||||
{!! session()->get('success#loggedout') !!}
|
||||
<input class="btn btn-dark" type="submit" value="Sign in">
|
||||
<button type="button" class="btn btn-dark lh-2" onclick="location.href = '{{ route("users.signup") }}'">Register</button>
|
||||
@if (\App\AllowAction::query()->where('action', '=', 'Registering')->first()->allow == true)
|
||||
<button type="button" class="btn btn-dark lh-2" onclick="location.href = '{{ route("users.signup") }}'">Register</button>
|
||||
@endif
|
||||
</form>
|
||||
<a class="text-white text-center" href="{{ route('users.show-forgot') }}">Forgot password?</a>
|
||||
</main>
|
||||
|
||||
@@ -10,20 +10,24 @@
|
||||
<div class="brand">
|
||||
<img src="{{URL::asset('/images/logos/Logo-hvid.svg')}}" alt="Syddansk Erhvervsskole">
|
||||
</div>
|
||||
<form action="{{ route("users.signupStore") }}" method="post" onsubmit="return checkInputs()">
|
||||
@csrf
|
||||
<label hidden id="erroremail">E-mail already exists</label>
|
||||
<label hidden id="errornotsamepass" for="errormesseages">Password dosen't match</label>
|
||||
<label hidden id="errorphone">Phone number already in use</label>
|
||||
<input class="appinput" type="text" name="name_first" placeholder="Firstname" required>
|
||||
<input class="appinput" type="text" name="name_last" placeholder="Lastname" required>
|
||||
<input class="appinput" type="email" id="email" name="email" placeholder="E-mail" required>
|
||||
<input class="appinput" type="password" pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" title="Must contain at least one number and one uppercase and lowercase letter, and at least 8 or more characters" name="password" id="password1" placeholder="Password" required>
|
||||
<input class="appinput" type="password" name="password2" id="password2" placeholder="Confirm password" required>
|
||||
<input class="appinput" type="tel" id="phone" name="phone" placeholder="Phone number" pattern="[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{2}" required class="mb-2rem">
|
||||
<input class="btn btn-dark" type="submit" id="disable" value="Sign up">
|
||||
<input onclick="window.history.back()" class="btn btn-dark text-center " value="Back">
|
||||
</form>
|
||||
@if (\App\AllowAction::query()->where('action', '=', 'Registering')->first()->allow == true)
|
||||
<form action="{{ route("users.signupStore") }}" method="post" onsubmit="return checkInputs()">
|
||||
@csrf
|
||||
<label hidden id="erroremail">E-mail already exists</label>
|
||||
<label hidden id="errornotsamepass" for="errormesseages">Password dosen't match</label>
|
||||
<label hidden id="errorphone">Phone number already in use</label>
|
||||
<input class="appinput" type="text" name="name_first" placeholder="Firstname" required>
|
||||
<input class="appinput" type="text" name="name_last" placeholder="Lastname" required>
|
||||
<input class="appinput" type="email" id="email" name="email" placeholder="E-mail" required>
|
||||
<input class="appinput" type="password" pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" title="Must contain at least one number and one uppercase and lowercase letter, and at least 8 or more characters" name="password" id="password1" placeholder="Password" required>
|
||||
<input class="appinput" type="password" name="password2" id="password2" placeholder="Confirm password" required>
|
||||
<input class="appinput" type="tel" id="phone" name="phone" placeholder="Phone number" pattern="[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{2}" required class="mb-2rem">
|
||||
<input class="btn btn-dark" type="submit" id="disable" value="Sign up">
|
||||
<input onclick="window.history.back()" class="btn btn-dark text-center" value="Back">
|
||||
</form>
|
||||
@else
|
||||
<h3 class="text-white text-center mt-3">Der er ikke åbent for registrering af elever lige nu</h3>
|
||||
@endif
|
||||
</main>
|
||||
|
||||
<script>
|
||||
|
||||
Reference in New Issue
Block a user