Skip to content

Commit

Permalink
Added delete button for profile picture
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianPrieber committed Feb 3, 2023
1 parent bc656fb commit a7d5959
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions resources/views/panel/edit-user.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,19 @@

<div class="form-group col-lg-8">
@if(file_exists(base_path("img/" . $user->id . ".png")))
<img src="{{ asset("img/" . $user->id . ".png") }}" srcset="{{ asset("img/$user->littlelink_name" . "@2x.png 2x") }}" width="128px" height="128px" style="object-fit: cover;">
<img src="{{ asset("img/" . $user->id . ".png") }}" srcset="{{ asset("img/$user->id" . "@2x.png 2x") }}" width="128px" height="128px" style="object-fit: cover;">
@elseif(file_exists(base_path("littlelink/images/").findFile('avatar')))
<img class="rounded-avatar" src="{{ asset('littlelink/images/'.findFile('avatar')) }}" srcset="{{ asset('littlelink/images/avatar@2x.png 2x') }}" width="128px" height="128px" style="object-fit: cover;">
@else
<img src="{{ asset('littlelink/images/logo.svg') }}" srcset="{{ asset('littlelink/images/avatar@2x.png 2x') }}" width="128px" height="128px" style="object-fit: cover;">
@endif
@if(file_exists(base_path("img/" . $user->id . ".png")))<br><a title="Remove icon" class="hvr-grow p-1 text-danger" style="padding-left:5px;" href="?delete"><i class="bi bi-trash-fill"></i> Delete</a>@endif
@if($_SERVER['QUERY_STRING'] === 'delete' and File::exists(base_path('img/' . $user->id . '.png')))@php File::delete(base_path('img/' . $user->id . '.png')); header("Location: ".url()->current()); die(); @endphp @endif
</div>

<!--<div class="form-group col-lg-8">
<label>Littlelink name </label>
<input type="text" class="form-control" name="littlelink_name" value="{{ $user->littlelink_name }}">
<input type="text" class="form-control" name="littlelink_name" value="{{ $user->id }}">
</div>-->

<div class="form-group col-lg-8">
Expand Down

0 comments on commit a7d5959

Please # to comment.