slink/laravel/resources/views/profile.blade.php

54 lines
2.2 KiB
PHP
Raw Normal View History

2024-06-09 22:03:34 +00:00
@extends('default')
@section('title')
Profile
@endsection
@section('content')
2025-03-06 16:13:47 +00:00
<div id="profile-container" class="form-container"> <!-- TODO: Add ability to change & reverify email -->
2025-03-02 19:04:31 +00:00
<h1>Profile</h1>
2025-03-06 16:13:47 +00:00
<form method="post" action="profile/update">
@csrf
<label for="name">Username</label>
<input type="text" name="name" id="name" value="{{ Auth::user()->name }}" required>
<label for="email">Email</label>
<input type="email" name="email" id="email" value="{{ Auth::user()->email }}" required>
<label for="created_at">Created On</label>
<input type="text" name="created_at" id="created_at" class="unmodifiable" value="{{ explode( " ", Auth::user()->created_at)[0] }}" required readonly>
<div class="button-row">
<button type="submit">Save</button>
<a href="profile/change-password"><button type="button">Change Password</button></a>
</div>
@if ($errors->any())
<p class="error">{{ $errors->first() }}</p>
@endif
@if (session('success'))
<p class="success">{{ session('success') }}</p>
@endif
</form>
2025-03-02 19:04:31 +00:00
</div>
<div id="table-container" class="container">
2025-03-02 20:10:42 +00:00
<h2>My Short URLs</h2>
2025-03-02 19:04:31 +00:00
<table>
2025-03-02 20:10:42 +00:00
<tbody>
2025-03-02 19:04:31 +00:00
<tr>
2025-03-02 20:10:42 +00:00
<th>Link</th>
<th>Destination</th>
<th>Created at</th>
2025-03-02 19:04:31 +00:00
</tr>
2025-03-02 20:10:42 +00:00
@foreach ($shortlinks as $shortlink)
<tr>
<td><a href="{{ url()->to("l/" . $shortlink->shortid) }}">{{ $shortlink['shortid'] }}</a></td>
<td class="table-truncate"><div class="destination">{{ $shortlink['destination'] }}</div></td>
<td>{{ Carbon\Carbon::parse($shortlink->created_at)->format('M jS Y') }}</td>
</tr>
@endforeach
</tbody>
<tfoot>
<tr>
<td colspan="3"><a href="/home">Shorten a new link</a></td>
</tr>
</tfoot>
2025-03-02 19:04:31 +00:00
</table>
</div>
2024-06-09 22:03:34 +00:00
@endsection