Ekapp/skolehjem/resources/views/admin/users/edit.blade.php

88 lines
3.7 KiB
PHP
Raw Normal View History

2020-06-16 07:04:25 +00:00
@extends("admin.layout.base")
@extends("admin.layout.header")
@section("title")
Bruger - Rediger
@endsection
@section("path")
2020-06-29 07:08:49 +00:00
<a href="{{ route('users.edit', ['user' => $user]) }}" class="text-white">Rediger Bruger</a> /
2020-06-16 07:04:25 +00:00
@endsection
@section("content")
2020-06-17 09:28:48 +00:00
<h1>Rediger Bruger:</h1>
{!! session()->get('error#passnotsame') !!}
<form method="post" action="{{ route("users.update", ['user' => $user]) }}" style="display: inline-table;">
2020-06-22 08:08:18 +00:00
@csrf
2020-06-29 06:50:50 +00:00
@method("put")
2020-06-17 09:28:48 +00:00
<label for="name_first">Fornavn:</label>
<input type="text" name="name_first" id="name_first" value="{{ $user->name_first }}" required>
2020-06-17 09:28:48 +00:00
<label for="name_last">Efternavn:</label>
<input type="text" name="name_last" id="name_last" value="{{ $user->name_last }}" required>
2020-06-17 09:28:48 +00:00
<label for="email">Email:</label>
2020-07-27 08:20:29 +00:00
<input type="email" name="email" id="email" value="{{ $user->email }}" required>
2020-07-27 11:35:00 +00:00
<label for="password1">Password: (Forblives blank, hvis password ikke skal ændres)</label>
<input type="password" name="password" id="password1" value="" placeholder="******">
<span toggle="#password-field" class="fa fa-fw fa-eye field-icon toggle-password" id="fa-new" onclick="show('password1', 'fa-new')"></span>
2020-07-27 11:35:00 +00:00
<label for="password2">Confirm Password: (Forblives blank, hvis password ikke skal ændres)</label>
<input type="password" name="password2" id="password2" value="" placeholder="******">
<span toggle="#password-field" class="fa fa-fw fa-eye field-icon toggle-password" id="fa-confirm" onclick="show('password2', 'fa-confirm')"></span>
2020-06-17 09:28:48 +00:00
<label for="tel">Telefon nr:</label>
<input type="tel" name="phone" id="tel" value="{{ $user->phone }}" required>
2020-07-27 11:35:00 +00:00
<label for="role">Rolle: (Brug ctrl og shift til at vælge flere)</label>
<select class="w-100" name="roles[]" id="roles" class="mb-2" multiple="multiple" required>
2020-07-27 11:35:00 +00:00
@if(count($user->roles) == 0)
<option disabled selected> -- Vælg Rolle(r) -- </option>
<option value>Ingen Rolle</option>
@foreach($roles as $role)
<option value="{{ $role->name }}">{{ $role->name }}</option>
@endforeach
@else
<option disabled> -- Vælg Rolle(r) -- </option>
<option value>Ingen Rolle</option>
@foreach($roles as $role)
{{ $selected = "" }}
@foreach($user->roles as $userRole)
@if($userRole->id == $role->id)
{{ $selected = "selected" }}
@endif
@endforeach
<option {{ $selected }} value="{{ $role->name }}">{{ $role->name }}</option>
@endforeach
@endif
</select>
2020-06-17 09:28:48 +00:00
<input type="submit" class="btn btn-dark text-white" value="Rediger">
</form>
<style>
input {
width: calc(100% - 8px);
}
.fa-eye {
position: absolute;
font-size: 25px;
color: grey;
margin: 7.5px 0 0 -45px;
}
</style>
@endsection
@section("scripts")
<script>
function show($passID, $faID) {
var inputPass = document.getElementById($passID);
var faEye = document.getElementById($faID);
if (inputPass.type === "password") {
inputPass.type = "text";
faEye.style.color = "#000";
} else {
inputPass.type = "password";
faEye.style.color = "#808080";
}
}
</script>
2020-06-16 07:04:25 +00:00
@endsection