Upload beautify

This commit is contained in:
2026-02-14 15:14:12 +01:00
parent e129618910
commit 79192345e3
249 changed files with 24436 additions and 1021 deletions

View File

@@ -1,153 +1,247 @@
@extends('layouts.legacy')
@extends('layouts.nova')
@section('content')
<div class="container-fluid legacy-page">
<div class="effect2 page-header-wrap">
<header class="page-heading">
<h1 class="page-header">Edit profile</h1>
<p>update your user account</p>
</header>
</div>
@if(session('status'))
<div class="alert alert-success">{{ session('status') }}</div>
@endif
@if(session('error'))
<div class="alert alert-danger">{{ session('error') }}</div>
@endif
<div class="min-h-screen bg-deep text-white py-12">
<form enctype="multipart/form-data" method="post" action="{{ route('legacy.user') }}" id="editUserProfileForm" role="form">
@csrf
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label><i class="fa fa-envelope"></i> Email:</label>
<input type="text" name="email" class="form-control" readonly value="{{ $user->email }}" />
</div>
<!-- Container -->
<div class="max-w-5xl mx-auto px-4">
<div class="form-group">
<label><i class="fa fa-user"></i> Username:</label>
<input type="text" name="uname" class="form-control" readonly value="{{ $user->uname ?? $user->name }}" />
</div>
<!-- Page Title -->
<h1 class="text-3xl font-semibold mb-8">
Edit Profile
</h1>
<div class="form-group">
<label>Real name:</label>
<input type="text" name="real_name" class="form-control" value="{{ $user->real_name ?? '' }}" />
</div>
@if ($errors->any())
<div class="mb-4 rounded-lg bg-red-700/10 border border-red-700/20 p-3 text-sm text-red-300">
<div class="font-semibold mb-2">Please fix the following errors:</div>
<ul class="list-disc pl-5 space-y-1">
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<div class="form-group">
<label><i class="fa fa-link"></i> Home page:</label>
<input type="text" name="web" class="form-control" value="{{ $user->web ?? '' }}" />
</div>
<div class="form-inline">
<label><i class="fa fa-birthday-cake"></i> Birthday</label><br>
<input maxlength="2" name="date1" class="form-control" size="2" placeholder="Day" value="{{ $birthDay ?? '' }}"> :
<select name="date2" class="form-control">
@for($i=1;$i<=12;$i++)
@php $mVal = str_pad($i, 2, '0', STR_PAD_LEFT); @endphp
<option value="{{ $mVal }}" {{ (isset($birthMonth) && $birthMonth == $mVal) ? 'selected' : '' }}>{{ DateTime::createFromFormat('!m',$i)->format('F') }}</option>
@endfor
</select> :
<input maxlength="4" class="form-control" name="date3" size="4" placeholder="year" value="{{ $birthYear ?? '' }}">
</div>
<!-- ================= Profile Card ================= -->
<div class="bg-panel rounded-xl shadow-lg p-8 mb-10">
<br>
<div class="form-group well">
<label>Gender:</label><br>
<input name="gender" type="radio" value="M" {{ ($user->gender ?? '') == 'M' ? 'checked' : '' }}> Male<br>
<input name="gender" type="radio" value="F" {{ ($user->gender ?? '') == 'F' ? 'checked' : '' }}> Female<br>
<input name="gender" type="radio" value="X" {{ ($user->gender ?? '') == 'X' ? 'checked' : '' }}> N/A
</div>
<form method="POST" action="{{ route('profile.update') }}" enctype="multipart/form-data">
@csrf
@method('PUT')
<div class="form-group">
<label>Country:</label>
@if(isset($countries) && $countries->count())
<select name="country_code" class="form-control">
@foreach($countries as $c)
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
<!-- LEFT COLUMN -->
<div class="space-y-5">
<!-- Email -->
<div>
<label class="form-label">Email</label>
<input type="email" name="email"
class="form-input"
value="{{ old('email', auth()->user()->email) }}">
</div>
<!-- Username -->
<div>
<label class="form-label">Username</label>
<input type="text" name="username"
class="form-input"
value="{{ old('username', auth()->user()->username) }}"
readonly>
</div>
<!-- Real Name -->
<div>
<label class="form-label">Real Name</label>
<input type="text" name="name"
class="form-input"
value="{{ old('name', auth()->user()->name) }}">
</div>
<!-- Homepage -->
<div>
<label class="form-label">Homepage</label>
<input type="url" name="homepage"
class="form-input"
placeholder="https://"
value="{{ old('homepage', auth()->user()->homepage ?? auth()->user()->website ?? '') }}">
</div>
<!-- Birthday -->
<div>
<label class="form-label">Birthday</label>
<div class="grid grid-cols-3 gap-3">
@php
$code = $c->country_code ?? ($c->code ?? null);
$label = $c->country_name ?? ($c->name ?? $code);
$currentYear = date('Y');
$startYear = $currentYear - 100;
$months = ['January','February','March','April','May','June','July','August','September','October','November','December'];
@endphp
<option value="{{ $code }}" {{ ($user->country_code ?? '') == $code ? 'selected' : '' }}>{{ $label }}</option>
@endforeach
</select>
@else
<input type="text" name="country_code" class="form-control" value="{{ $user->country_code ?? '' }}">
@endif
<select name="day" class="form-input" aria-label="Day">
<option value="">Day</option>
@for($d = 1; $d <= 31; $d++)
<option value="{{ $d }}" @if(intval(old('day', $birthDay)) == $d) selected @endif>{{ $d }}</option>
@endfor
</select>
<select name="month" class="form-input" aria-label="Month">
<option value="">Month</option>
@foreach($months as $idx => $m)
@php $val = $idx + 1; @endphp
<option value="{{ $val }}" @if(intval(old('month', $birthMonth)) == $val) selected @endif>{{ $m }}</option>
@endforeach
</select>
<select name="year" class="form-input" aria-label="Year">
<option value="">Year</option>
@for($y = $currentYear; $y >= $startYear; $y--)
<option value="{{ $y }}" @if(intval(old('year', $birthYear)) == $y) selected @endif>{{ $y }}</option>
@endfor
</select>
</div>
</div>
<!-- Gender -->
<div>
<label class="form-label">Gender</label>
<div class="flex gap-6 mt-2 text-soft">
<label><input type="radio" name="gender" value="m" @if(old('gender', strtolower(auth()->user()->gender ?? '')) == 'm') checked @endif> Male</label>
<label><input type="radio" name="gender" value="f" @if(old('gender', strtolower(auth()->user()->gender ?? '')) == 'f') checked @endif> Female</label>
<label><input type="radio" name="gender" value="x" @if(old('gender', strtolower(auth()->user()->gender ?? '')) == 'x') checked @endif> N/A</label>
</div>
</div>
<!-- Country -->
<div>
<label class="form-label">Country</label>
<input type="text" name="country"
class="form-input"
value="{{ old('country', auth()->user()->country ?? auth()->user()->country_code ?? '') }}">
</div>
<!-- Preferences -->
<div class="flex gap-6 text-soft">
<label>
<input type="checkbox" name="mailing" @if(old('mailing', auth()->user()->mlist ?? false)) checked @endif>
Mailing List
</label>
<label>
<input type="checkbox" name="notify" @if(old('notify', auth()->user()->friend_upload_notice ?? false)) checked @endif>
Upload Notifications
</label>
</div>
</div>
<!-- RIGHT COLUMN -->
<div class="space-y-5">
<!-- Avatar -->
<div>
<label class="form-label">Avatar</label>
<input type="file" name="avatar" class="form-file">
</div>
<!-- Emoticon -->
<div>
<label class="form-label">Emoticon</label>
<input type="file" name="emoticon" class="form-file">
</div>
<!-- Personal Picture -->
<div>
<label class="form-label">Personal Picture</label>
<input type="file" name="photo" class="form-file">
</div>
<!-- About -->
<div>
<label class="form-label">About Me</label>
<textarea name="about" rows="4"
class="form-textarea">{{ old('about', auth()->user()->about ?? auth()->user()->about_me ?? '') }}</textarea>
</div>
<!-- Signature -->
<div>
<label class="form-label">Signature</label>
<textarea name="signature" rows="3"
class="form-textarea">{{ old('signature', auth()->user()->signature ?? '') }}</textarea>
</div>
<!-- Description -->
<div>
<label class="form-label">Description</label>
<textarea name="description" rows="4"
class="form-textarea">{{ old('description', auth()->user()->description ?? '') }}</textarea>
</div>
</div>
</div>
<div class="form-group well">
<input name="newsletter" type="checkbox" value="1" {{ ($user->mlist ?? 0) ? 'checked' : '' }}> Mailing list<br>
<input name="friend_upload_notice" type="checkbox" value="1" {{ ($user->friend_upload_notice ?? 0) ? 'checked' : '' }}> Friends upload notice
<!-- Save Button -->
<div class="mt-8 text-right">
<button type="submit"
class="btn-primary">
Update Profile
</button>
</div>
<div class="form-group">
<label>Signature</label>
<textarea name="signature" class="form-control" style="width:100%; height:100px;">{{ $user->signature ?? '' }}</textarea>
</div>
</form>
<div class="form-group">
<label>Description</label>
<textarea name="description" class="form-control" style="width:100%; height:100px;">{{ $user->description ?? '' }}</textarea>
</div>
</div>
<div class="col-md-6">
<div class="form-group well">
<label>Avatar:</label><br>
<input type="file" name="avatar" class="form-control">
@if(!empty($user->icon))
<div style="margin-top:10px"><img src="/avatar/{{ $user->id }}/{{ $user->icon }}" width="50"></div>
@endif
</div>
<div class="form-group well">
<label>Emotion Icon:</label><br>
<input type="file" name="emotion_icon" class="form-control">
</div>
<div class="form-group well">
<label>Personal picture:</label><br>
<input type="file" name="personal_picture" class="form-control">
@if(!empty($user->picture))
<div style="margin-top:10px"><img src="/user-picture/{{ $user->picture }}" style="max-width:300px"></div>
@endif
</div>
</div>
</div>
<div class="form-group">
<label>About Me</label>
<textarea name="about_me" class="summernote form-control" style="width:100%; height:100px;">{{ $user->about_me ?? '' }}</textarea>
<!-- ================= PASSWORD CARD ================= -->
<div class="bg-panel rounded-xl shadow-lg p-8">
<h2 class="text-xl font-semibold mb-6">
Change Password
</h2>
<form method="POST" action="{{ route('profile.password') }}">
@csrf
@method('PUT')
<div class="space-y-5 max-w-md">
<div>
<label class="form-label">Current Password</label>
<input type="password" name="current_password"
class="form-input">
</div>
<div>
<label class="form-label">New Password</label>
<input type="password" name="password"
class="form-input">
</div>
<div>
<label class="form-label">Repeat Password</label>
<input type="password" name="password_confirmation"
class="form-input">
</div>
<button class="btn-secondary">
Change Password
</button>
</div>
</form>
</div>
<input type="hidden" name="confirm" value="true">
<input type="submit" class="btn btn-success" value="Update my profile">
</form>
<hr>
<h3>Change password</h3>
<form action="{{ route('legacy.user') }}" method="post">
@csrf
<div class="form-group">
<label>Current password</label>
<input type="password" name="oldpass" class="form-control">
</div>
<div class="form-group">
<label>New password</label>
<input type="password" name="newpass" class="form-control">
</div>
<div class="form-group">
<label>Retype new password</label>
<input type="password" name="newpass2" class="form-control">
</div>
<input type="hidden" name="confirm" value="true_password">
<input type="submit" class="btn btn-success" value="Change Password">
</form>
</div>
</div>
@endsection