Frontend support for role selection in user create, read and update.

This commit is contained in:
frederikpyt 2020-06-30 08:03:42 +02:00
parent a4ff9a3590
commit c803d12299
6 changed files with 27 additions and 11 deletions

View File

@ -57,7 +57,8 @@ form {
display: inline-flex; display: inline-flex;
} }
input { input,
select {
border: grey solid 2px; border: grey solid 2px;
border-radius: 4px; border-radius: 4px;
background-color: transparent; background-color: transparent;

View File

@ -57,7 +57,8 @@ form {
display: inline-flex; display: inline-flex;
} }
input { input,
select {
border: grey solid 2px; border: grey solid 2px;
border-radius: 4px; border-radius: 4px;
background-color: transparent; background-color: transparent;

View File

@ -37,7 +37,7 @@ form {
display: inline-flex; display: inline-flex;
} }
input{ input, select{
border: grey solid 2px; border: grey solid 2px;
border-radius: 4px; border-radius: 4px;
background-color: transparent; background-color: transparent;

View File

@ -25,6 +25,12 @@
<input type="password" id="password2" placeholder="Bekræft Password" required> <input type="password" id="password2" placeholder="Bekræft Password" required>
<label for="tel">Telefon nr:</label> <label for="tel">Telefon nr:</label>
<input type="tel" name="phone" id="tel" placeholder="12345678" pattern="[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{2}" required> <input type="tel" name="phone" id="tel" placeholder="12345678" pattern="[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{2}" required>
<label for="role">Rolle:</label>
<select name="role" id="role" class="mb-2" required>
<option value="admin">Admin</option>
<option value="staff">Personale</option>
<option value="resident">Beboer</option>
</select>
<input type="submit" class="btn btn-dark text-white" value="Opret"> <input type="submit" class="btn btn-dark text-white" value="Opret">
</form> </form>
@endsection @endsection

View File

@ -26,6 +26,12 @@
<input type="password" id="password2" value="" required> <input type="password" id="password2" value="" required>
<label for="tel">Telefon nr:</label> <label for="tel">Telefon nr:</label>
<input type="tel" name="phone" id="tel" value="{{ $user->phone }}" required> <input type="tel" name="phone" id="tel" value="{{ $user->phone }}" required>
<label for="role">Rolle:</label>
<select name="role" id="role" class="mb-2" required>
<option value="admin">Admin</option>
<option value="staff">Personale</option>
<option value="resident">Beboer</option>
</select>
<input type="submit" class="btn btn-dark text-white" value="Rediger"> <input type="submit" class="btn btn-dark text-white" value="Rediger">
</form> </form>
@endsection @endsection

View File

@ -16,6 +16,7 @@
<th>Efternavn</th> <th>Efternavn</th>
<th>Email</th> <th>Email</th>
<th>Tlf nr</th> <th>Tlf nr</th>
<th>Rolle</th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th> <th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th> <th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th>
</tr> </tr>
@ -25,6 +26,7 @@
<td>{{ $user->name_last }}</td> <td>{{ $user->name_last }}</td>
<td>{{ $user->email }}</td> <td>{{ $user->email }}</td>
<td>{{ $user->phone }}</td> <td>{{ $user->phone }}</td>
<td>{{ $user->roles }}</td>
<td><a href="{{ route("users.edit", [ "user" => $user->id ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td> <td><a href="{{ route("users.edit", [ "user" => $user->id ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
<td><a href="{{ route("users.destroy", [ "user" => $user ]) }}"><img class="w-100" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></a></td> <td><a href="{{ route("users.destroy", [ "user" => $user ]) }}"><img class="w-100" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></a></td>
</tr> </tr>