lots of design improvements
This commit is contained in:
@@ -1,152 +1,221 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">Edit Profile</div>
|
||||
<div class="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
|
||||
<!-- Header -->
|
||||
<div class="mb-8">
|
||||
<h1 class="text-3xl font-bold text-gray-900">Edit Profile</h1>
|
||||
<p class="mt-2 text-sm text-gray-600">Update your profile information and social links</p>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('success'))
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
{{ session('success') }}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
@endif
|
||||
<div class="bg-white rounded-lg shadow-sm border border-gray-200">
|
||||
<div class="px-6 py-8">
|
||||
<form method="POST" action="{{ route('profile.update') }}" enctype="multipart/form-data" class="space-y-8">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<form method="POST" action="{{ route('profile.update') }}" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<!-- Avatar Section -->
|
||||
<div class="mb-4">
|
||||
<label class="form-label">Profile Picture</label>
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="me-3">
|
||||
@if ($user->avatar)
|
||||
<img src="{{ $user->avatar_url }}" alt="{{ $user->name }}" class="rounded-circle" style="width: 100px; height: 100px; object-fit: cover;">
|
||||
@else
|
||||
<div class="bg-secondary text-white rounded-circle d-flex align-items-center justify-content-center" style="width: 100px; height: 100px; font-size: 36px;">
|
||||
{{ strtoupper(substr($user->name, 0, 1)) }}
|
||||
</div>
|
||||
@endif
|
||||
<!-- Avatar Section -->
|
||||
<div>
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-4">Profile Picture</h3>
|
||||
<div class="flex items-center gap-6">
|
||||
<div class="flex-shrink-0">
|
||||
@if($user->avatar_url)
|
||||
<img src="{{ $user->avatar_url }}"
|
||||
alt="{{ $user->name }}"
|
||||
class="h-24 w-24 rounded-full object-cover ring-4 ring-gray-100">
|
||||
@else
|
||||
<div class="h-24 w-24 rounded-full bg-gradient-to-br from-primary-500 to-accent-500 flex items-center justify-center text-white text-3xl font-bold ring-4 ring-gray-100">
|
||||
{{ strtoupper(substr($user->name, 0, 1)) }}
|
||||
</div>
|
||||
<div class="flex-grow-1">
|
||||
<input type="file" class="form-control @error('avatar') is-invalid @enderror" id="avatar" name="avatar" accept="image/*">
|
||||
@error('avatar')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
<small class="form-text text-muted">JPG, PNG, or GIF. Max size 2MB.</small>
|
||||
@if ($user->avatar)
|
||||
<div class="mt-2">
|
||||
<form method="POST" action="{{ route('profile.avatar.delete') }}" class="d-inline">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-sm btn-danger" onclick="return confirm('Are you sure you want to delete your avatar?')">
|
||||
Delete Avatar
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<!-- Name -->
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">Name</label>
|
||||
<input type="text" class="form-control @error('name') is-invalid @enderror" id="name" name="name" value="{{ old('name', $user->name) }}" required>
|
||||
@error('name')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
<div class="flex-1">
|
||||
<input type="file"
|
||||
id="avatar"
|
||||
name="avatar"
|
||||
accept="image/*"
|
||||
class="block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-semibold file:bg-primary-50 file:text-primary-700 hover:file:bg-primary-100 @error('avatar') border-red-300 @enderror">
|
||||
@error('avatar')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
<p class="mt-2 text-sm text-gray-500">JPG, PNG, or GIF. Max size 2MB.</p>
|
||||
|
||||
@if($user->avatar)
|
||||
<form method="POST" action="{{ route('profile.avatar.delete') }}" class="mt-3" onsubmit="return confirm('Are you sure you want to delete your avatar?')">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="text-sm font-medium text-red-600 hover:text-red-700">
|
||||
Delete Avatar
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Basic Information -->
|
||||
<div class="border-t border-gray-200 pt-8">
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-4">Basic Information</h3>
|
||||
<div class="grid grid-cols-1 gap-6 sm:grid-cols-2">
|
||||
<!-- Name -->
|
||||
<div>
|
||||
<label for="name" class="block text-sm font-medium text-gray-700">
|
||||
Name <span class="text-red-600">*</span>
|
||||
</label>
|
||||
<div class="mt-1">
|
||||
<input type="text"
|
||||
id="name"
|
||||
name="name"
|
||||
value="{{ old('name', $user->name) }}"
|
||||
required
|
||||
class="appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm @error('name') border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500 @enderror">
|
||||
@error('name')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Email -->
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">Email</label>
|
||||
<input type="email" class="form-control @error('email') is-invalid @enderror" id="email" name="email" value="{{ old('email', $user->email) }}" required>
|
||||
@error('email')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
<div>
|
||||
<label for="email" class="block text-sm font-medium text-gray-700">
|
||||
Email <span class="text-red-600">*</span>
|
||||
</label>
|
||||
<div class="mt-1">
|
||||
<input type="email"
|
||||
id="email"
|
||||
name="email"
|
||||
value="{{ old('email', $user->email) }}"
|
||||
required
|
||||
class="appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm @error('email') border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500 @enderror">
|
||||
@error('email')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Bio -->
|
||||
<div class="mb-3">
|
||||
<label for="bio" class="form-label">Bio</label>
|
||||
<textarea class="form-control @error('bio') is-invalid @enderror" id="bio" name="bio" rows="4" maxlength="1000">{{ old('bio', $user->bio) }}</textarea>
|
||||
<!-- Bio -->
|
||||
<div class="mt-6">
|
||||
<label for="bio" class="block text-sm font-medium text-gray-700">
|
||||
Bio
|
||||
</label>
|
||||
<div class="mt-1">
|
||||
<textarea id="bio"
|
||||
name="bio"
|
||||
rows="4"
|
||||
maxlength="1000"
|
||||
placeholder="Tell us a bit about yourself..."
|
||||
class="appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm @error('bio') border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500 @enderror">{{ old('bio', $user->bio) }}</textarea>
|
||||
@error('bio')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
<small class="form-text text-muted">Max 1000 characters</small>
|
||||
<p class="mt-2 text-sm text-gray-500">Max 1000 characters</p>
|
||||
</div>
|
||||
|
||||
<!-- Website -->
|
||||
<div class="mb-3">
|
||||
<label for="website" class="form-label">Website</label>
|
||||
<input type="url" class="form-control @error('website') is-invalid @enderror" id="website" name="website" value="{{ old('website', $user->website) }}" placeholder="https://example.com">
|
||||
@error('website')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<!-- Social Links -->
|
||||
<div class="mb-3">
|
||||
<label for="twitter" class="form-label">Twitter Username</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">@</span>
|
||||
<input type="text" class="form-control @error('twitter') is-invalid @enderror" id="twitter" name="twitter" value="{{ old('twitter', $user->twitter) }}" placeholder="username">
|
||||
@error('twitter')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="github" class="form-label">GitHub Username</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">github.com/</span>
|
||||
<input type="text" class="form-control @error('github') is-invalid @enderror" id="github" name="github" value="{{ old('github', $user->github) }}" placeholder="username">
|
||||
@error('github')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="linkedin" class="form-label">LinkedIn Username</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">linkedin.com/in/</span>
|
||||
<input type="text" class="form-control @error('linkedin') is-invalid @enderror" id="linkedin" name="linkedin" value="{{ old('linkedin', $user->linkedin) }}" placeholder="username">
|
||||
@error('linkedin')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between">
|
||||
<a href="{{ route('profile.show', $user) }}" class="btn btn-secondary">Cancel</a>
|
||||
<button type="submit" class="btn btn-primary">Update Profile</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Website & Social Links -->
|
||||
<div class="border-t border-gray-200 pt-8">
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-4">Website & Social Links</h3>
|
||||
<div class="space-y-6">
|
||||
<!-- Website -->
|
||||
<div>
|
||||
<label for="website" class="block text-sm font-medium text-gray-700">
|
||||
Website
|
||||
</label>
|
||||
<div class="mt-1">
|
||||
<input type="url"
|
||||
id="website"
|
||||
name="website"
|
||||
value="{{ old('website', $user->website) }}"
|
||||
placeholder="https://example.com"
|
||||
class="appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm @error('website') border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500 @enderror">
|
||||
@error('website')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Twitter -->
|
||||
<div>
|
||||
<label for="twitter" class="block text-sm font-medium text-gray-700">
|
||||
Twitter Username
|
||||
</label>
|
||||
<div class="mt-1 flex rounded-md shadow-sm">
|
||||
<span class="inline-flex items-center px-3 rounded-l-md border border-r-0 border-gray-300 bg-gray-50 text-gray-500 sm:text-sm">
|
||||
@
|
||||
</span>
|
||||
<input type="text"
|
||||
id="twitter"
|
||||
name="twitter"
|
||||
value="{{ old('twitter', $user->twitter) }}"
|
||||
placeholder="username"
|
||||
class="flex-1 min-w-0 block w-full px-3 py-2 rounded-none rounded-r-md border-gray-300 focus:ring-primary-500 focus:border-primary-500 sm:text-sm @error('twitter') border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500 @enderror">
|
||||
</div>
|
||||
@error('twitter')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<!-- GitHub -->
|
||||
<div>
|
||||
<label for="github" class="block text-sm font-medium text-gray-700">
|
||||
GitHub Username
|
||||
</label>
|
||||
<div class="mt-1 flex rounded-md shadow-sm">
|
||||
<span class="inline-flex items-center px-3 rounded-l-md border border-r-0 border-gray-300 bg-gray-50 text-gray-500 text-sm">
|
||||
github.com/
|
||||
</span>
|
||||
<input type="text"
|
||||
id="github"
|
||||
name="github"
|
||||
value="{{ old('github', $user->github) }}"
|
||||
placeholder="username"
|
||||
class="flex-1 min-w-0 block w-full px-3 py-2 rounded-none rounded-r-md border-gray-300 focus:ring-primary-500 focus:border-primary-500 sm:text-sm @error('github') border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500 @enderror">
|
||||
</div>
|
||||
@error('github')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<!-- LinkedIn -->
|
||||
<div>
|
||||
<label for="linkedin" class="block text-sm font-medium text-gray-700">
|
||||
LinkedIn Username
|
||||
</label>
|
||||
<div class="mt-1 flex rounded-md shadow-sm">
|
||||
<span class="inline-flex items-center px-3 rounded-l-md border border-r-0 border-gray-300 bg-gray-50 text-gray-500 text-sm">
|
||||
linkedin.com/in/
|
||||
</span>
|
||||
<input type="text"
|
||||
id="linkedin"
|
||||
name="linkedin"
|
||||
value="{{ old('linkedin', $user->linkedin) }}"
|
||||
placeholder="username"
|
||||
class="flex-1 min-w-0 block w-full px-3 py-2 rounded-none rounded-r-md border-gray-300 focus:ring-primary-500 focus:border-primary-500 sm:text-sm @error('linkedin') border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500 @enderror">
|
||||
</div>
|
||||
@error('linkedin')
|
||||
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Form Actions -->
|
||||
<div class="border-t border-gray-200 pt-6 flex items-center justify-between">
|
||||
<a href="{{ route('profile.show', $user) }}"
|
||||
class="inline-flex items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500">
|
||||
Cancel
|
||||
</a>
|
||||
<button type="submit"
|
||||
class="inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500">
|
||||
<svg class="mr-2 h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path>
|
||||
</svg>
|
||||
Update Profile
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,93 +1,195 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<span>{{ $user->name }}'s Profile</span>
|
||||
@auth
|
||||
@if (Auth::id() === $user->id)
|
||||
<a href="{{ route('profile.edit') }}" class="btn btn-sm btn-primary">Edit Profile</a>
|
||||
@endif
|
||||
@endauth
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-3 text-center">
|
||||
@if ($user->avatar)
|
||||
<img src="{{ $user->avatar_url }}" alt="{{ $user->name }}" class="img-fluid rounded-circle mb-3" style="max-width: 150px;">
|
||||
@else
|
||||
<div class="bg-secondary text-white rounded-circle d-flex align-items-center justify-content-center mb-3" style="width: 150px; height: 150px; font-size: 48px; margin: 0 auto;">
|
||||
{{ strtoupper(substr($user->name, 0, 1)) }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="col-md-9">
|
||||
<h3>{{ $user->name }}</h3>
|
||||
<p class="text-muted">{{ $user->email }}</p>
|
||||
|
||||
@if ($user->bio)
|
||||
<div class="mt-3">
|
||||
<h5>Bio</h5>
|
||||
<p>{{ $user->bio }}</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($user->website || $user->twitter || $user->github || $user->linkedin)
|
||||
<div class="mt-4">
|
||||
<h5>Links</h5>
|
||||
<ul class="list-unstyled">
|
||||
@if ($user->website)
|
||||
<li class="mb-2">
|
||||
<strong>Website:</strong>
|
||||
<a href="{{ $user->website }}" target="_blank" rel="noopener">{{ $user->website }}</a>
|
||||
</li>
|
||||
@endif
|
||||
@if ($user->twitter)
|
||||
<li class="mb-2">
|
||||
<strong>Twitter:</strong>
|
||||
<a href="https://twitter.com/{{ $user->twitter }}" target="_blank" rel="noopener">@{{ $user->twitter }}</a>
|
||||
</li>
|
||||
@endif
|
||||
@if ($user->github)
|
||||
<li class="mb-2">
|
||||
<strong>GitHub:</strong>
|
||||
<a href="https://github.com/{{ $user->github }}" target="_blank" rel="noopener">{{ $user->github }}</a>
|
||||
</li>
|
||||
@endif
|
||||
@if ($user->linkedin)
|
||||
<li class="mb-2">
|
||||
<strong>LinkedIn:</strong>
|
||||
<a href="https://linkedin.com/in/{{ $user->linkedin }}" target="_blank" rel="noopener">{{ $user->linkedin }}</a>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($user->roles->isNotEmpty())
|
||||
<div class="mt-4">
|
||||
<h5>Roles</h5>
|
||||
<div>
|
||||
@foreach ($user->roles as $role)
|
||||
<span class="badge bg-primary me-1">{{ $role->name }}</span>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="mt-3 text-muted">
|
||||
<small>Member since {{ $user->created_at->format('F Y') }}</small>
|
||||
<div class="bg-white">
|
||||
<!-- Profile Header -->
|
||||
<div class="bg-gradient-to-br from-primary-50 to-white border-b border-gray-200">
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
|
||||
<div class="md:flex md:items-center md:justify-between md:space-x-8">
|
||||
<!-- Avatar & Name -->
|
||||
<div class="flex items-center space-x-6">
|
||||
<div class="flex-shrink-0">
|
||||
@if($user->avatar_url)
|
||||
<img src="{{ $user->avatar_url }}"
|
||||
alt="{{ $user->name }}"
|
||||
class="h-24 w-24 rounded-full object-cover ring-4 ring-white shadow-lg">
|
||||
@else
|
||||
<div class="h-24 w-24 rounded-full bg-gradient-to-br from-primary-500 to-accent-500 flex items-center justify-center text-white text-3xl font-bold ring-4 ring-white shadow-lg">
|
||||
{{ strtoupper(substr($user->name, 0, 1)) }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div>
|
||||
<h1 class="text-3xl font-bold text-gray-900">{{ $user->name }}</h1>
|
||||
<p class="mt-1 text-base text-gray-500">{{ $user->email }}</p>
|
||||
@if($user->roles->isNotEmpty())
|
||||
<div class="mt-2 flex items-center gap-2">
|
||||
@foreach($user->roles as $role)
|
||||
<span class="inline-flex items-center px-2.5 py-0.5 rounded-md text-xs font-medium bg-primary-100 text-primary-800">
|
||||
{{ ucfirst($role->name) }}
|
||||
</span>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Edit Profile Button -->
|
||||
@auth
|
||||
@if(Auth::id() === $user->id)
|
||||
<div class="mt-6 md:mt-0">
|
||||
<a href="{{ route('profile.edit') }}"
|
||||
class="inline-flex items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500">
|
||||
<svg class="mr-2 h-5 w-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path>
|
||||
</svg>
|
||||
Edit Profile
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
@endauth
|
||||
</div>
|
||||
|
||||
<!-- Bio -->
|
||||
@if($user->bio)
|
||||
<div class="mt-6 max-w-3xl">
|
||||
<p class="text-gray-700 text-base leading-relaxed">{{ $user->bio }}</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Stats -->
|
||||
<div class="mt-8 grid grid-cols-3 gap-4 sm:gap-6">
|
||||
<div class="bg-white rounded-lg border border-gray-200 p-4 text-center">
|
||||
<div class="text-2xl font-bold text-gray-900">{{ $stats['products_count'] }}</div>
|
||||
<div class="mt-1 text-sm text-gray-600">{{ Str::plural('Product', $stats['products_count']) }}</div>
|
||||
</div>
|
||||
<div class="bg-white rounded-lg border border-gray-200 p-4 text-center">
|
||||
<div class="text-2xl font-bold text-gray-900">{{ $stats['total_upvotes'] }}</div>
|
||||
<div class="mt-1 text-sm text-gray-600">{{ Str::plural('Upvote', $stats['total_upvotes']) }}</div>
|
||||
</div>
|
||||
<div class="bg-white rounded-lg border border-gray-200 p-4 text-center">
|
||||
<div class="text-2xl font-bold text-gray-900">{{ $stats['comments_count'] }}</div>
|
||||
<div class="mt-1 text-sm text-gray-600">{{ Str::plural('Comment', $stats['comments_count']) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Social Links -->
|
||||
@if($user->website || $user->twitter || $user->github || $user->linkedin)
|
||||
<div class="mt-6 flex flex-wrap gap-3">
|
||||
@if($user->website)
|
||||
<a href="{{ $user->website }}"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="inline-flex items-center px-3 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50">
|
||||
<svg class="mr-2 h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"></path>
|
||||
</svg>
|
||||
Website
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if($user->twitter)
|
||||
<a href="https://twitter.com/{{ $user->twitter }}"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="inline-flex items-center px-3 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50">
|
||||
<svg class="mr-2 h-4 w-4" fill="currentColor" viewBox="0 0 24 24">
|
||||
<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"></path>
|
||||
</svg>
|
||||
Twitter
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if($user->github)
|
||||
<a href="https://github.com/{{ $user->github }}"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="inline-flex items-center px-3 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50">
|
||||
<svg class="mr-2 h-4 w-4" fill="currentColor" viewBox="0 0 24 24">
|
||||
<path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path>
|
||||
</svg>
|
||||
GitHub
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if($user->linkedin)
|
||||
<a href="https://linkedin.com/in/{{ $user->linkedin }}"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="inline-flex items-center px-3 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50">
|
||||
<svg class="mr-2 h-4 w-4" fill="currentColor" viewBox="0 0 24 24">
|
||||
<path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"></path>
|
||||
</svg>
|
||||
LinkedIn
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Member Since -->
|
||||
<div class="mt-6">
|
||||
<p class="text-sm text-gray-500">
|
||||
<svg class="inline-block h-4 w-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"></path>
|
||||
</svg>
|
||||
Member since {{ $user->created_at->format('F Y') }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Products Section -->
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
|
||||
<div class="mb-8">
|
||||
<h2 class="text-2xl font-bold text-gray-900">
|
||||
Products by {{ $user->name }}
|
||||
</h2>
|
||||
<p class="mt-2 text-sm text-gray-600">
|
||||
@if($products->total() > 0)
|
||||
Showing {{ $products->count() }} of {{ $products->total() }} {{ Str::plural('product', $products->total()) }}
|
||||
@else
|
||||
No products yet
|
||||
@endif
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@if($products->count() > 0)
|
||||
<div class="grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3">
|
||||
@foreach($products as $product)
|
||||
@include('components.product-card', ['product' => $product])
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<!-- Pagination -->
|
||||
@if($products->hasPages())
|
||||
<div class="mt-8">
|
||||
{{ $products->links() }}
|
||||
</div>
|
||||
@endif
|
||||
@else
|
||||
<div class="text-center py-12 bg-gray-50 rounded-lg border border-gray-200">
|
||||
<svg class="mx-auto h-12 w-12 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"></path>
|
||||
</svg>
|
||||
<h3 class="mt-2 text-sm font-medium text-gray-900">No products</h3>
|
||||
<p class="mt-1 text-sm text-gray-500">
|
||||
{{ Auth::id() === $user->id ? "You haven't submitted any products yet." : "{$user->name} hasn't submitted any products yet." }}
|
||||
</p>
|
||||
@auth
|
||||
@if(Auth::id() === $user->id)
|
||||
<div class="mt-6">
|
||||
<a href="{{ route('products.create') }}"
|
||||
class="inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-primary-600 hover:bg-primary-700">
|
||||
<svg class="mr-2 h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"></path>
|
||||
</svg>
|
||||
Submit Your First Product
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
@endauth
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user