This commit is contained in:
Doar Mihai
2026-04-04 18:19:34 +03:00
parent 5fb17f717d
commit 7c09846bd6
22 changed files with 1229 additions and 94 deletions
+103 -9
View File
@@ -2,7 +2,7 @@
@section('title', $job->title . ' at ' . $job->company . ' - JobifyGarden')
@section('description', Str::limit(strip_tags($job->description), 155))
@section('canonical', route('jobs.show', $job->id))
@section('canonical', route('jobs.show', $job))
@push('structured_data')
<script type="application/ld+json">
@@ -20,7 +20,7 @@
$breadcrumbsArray[] = ['name' => $job->category->name, 'url' => route('jobs.category', $job->category->slug)];
}
$breadcrumbsArray[] = ['name' => $job->title, 'url' => route('jobs.show', $job->id)];
$breadcrumbsArray[] = ['name' => $job->title, 'url' => route('jobs.show', $job)];
@endphp
{!! json_encode(app(\App\Services\SeoService::class)->generateBreadcrumbStructuredData($breadcrumbsArray), JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT) !!}
@@ -111,10 +111,24 @@
</div>
<!-- Job Description -->
<div class="prose prose-emerald max-w-none mb-8">
<div class="mb-8">
<h3 class="text-xl font-semibold text-gray-900 mb-4">Job Description</h3>
<div class="text-gray-700 leading-relaxed">
{!! nl2br(e($job->description)) !!}
<div class="prose prose-emerald prose-lg max-w-none text-gray-700">
{!! Str::of($job->description)
->pipe(function($desc) {
// Allow safe HTML tags
return strip_tags($desc, '<p><br><ul><ol><li><strong><b><em><i><h1><h2><h3><h4><h5><h6><a><div><span>');
})
->pipe(function($desc) {
// Convert remaining newlines to paragraphs if no HTML structure
if (!str_contains($desc, '<p>') && !str_contains($desc, '<div>')) {
$paragraphs = array_filter(explode("\n\n", $desc));
return '<p>' . implode('</p><p>', array_map(fn($p) => nl2br(trim($p)), $paragraphs)) . '</p>';
}
return $desc;
})
->toString()
!!}
</div>
</div>
@@ -159,12 +173,12 @@
<div class="bg-white rounded-lg shadow-sm border border-gray-200 p-6">
<h3 class="text-sm font-semibold text-gray-900 mb-3">Share this job</h3>
<div class="flex gap-2">
<a href="https://twitter.com/intent/tweet?text={{ urlencode($job->title . ' at ' . $job->company) }}&url={{ urlencode(route('jobs.show', $job->id)) }}"
<a href="https://twitter.com/intent/tweet?text={{ urlencode($job->title . ' at ' . $job->company) }}&url={{ urlencode(route('jobs.show', $job)) }}"
target="_blank"
class="flex-1 px-3 py-2 bg-blue-500 hover:bg-blue-600 text-white text-center rounded text-sm">
Twitter
</a>
<a href="https://www.linkedin.com/sharing/share-offsite/?url={{ urlencode(route('jobs.show', $job->id)) }}"
<a href="https://www.linkedin.com/sharing/share-offsite/?url={{ urlencode(route('jobs.show', $job)) }}"
target="_blank"
class="flex-1 px-3 py-2 bg-blue-700 hover:bg-blue-800 text-white text-center rounded text-sm">
LinkedIn
@@ -173,10 +187,90 @@
</div>
<!-- Report -->
<div class="bg-white rounded-lg shadow-sm border border-gray-200 p-6">
<button class="text-sm text-red-600 hover:text-red-700">
<div class="bg-white rounded-lg shadow-sm border border-gray-200 p-6" x-data="{ showReportModal: false }">
<button @click="showReportModal = true" class="text-sm text-red-600 hover:text-red-700">
Report this job
</button>
<!-- Report Modal -->
<div x-show="showReportModal"
x-cloak
@click.away="showReportModal = false"
@keydown.escape.window="showReportModal = false"
class="fixed inset-0 z-50 flex items-center justify-center p-4"
style="display: none;">
<!-- Overlay -->
<div class="fixed inset-0 bg-black bg-opacity-50"></div>
<!-- Modal -->
<div class="relative bg-white rounded-lg shadow-xl max-w-md w-full p-6">
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-semibold text-gray-900">Report this job</h3>
<button @click="showReportModal = false" class="text-gray-400 hover:text-gray-600">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
</svg>
</button>
</div>
<p class="text-sm text-gray-600 mb-4">
Please select a reason for reporting this job posting:
</p>
<form action="#" method="POST" class="space-y-4">
@csrf
<input type="hidden" name="job_id" value="{{ $job->id }}">
<div class="space-y-2">
<label class="flex items-center">
<input type="radio" name="reason" value="expired" class="mr-2" required>
<span class="text-sm">Job posting has expired</span>
</label>
<label class="flex items-center">
<input type="radio" name="reason" value="scam" class="mr-2" required>
<span class="text-sm">Suspected scam or fraud</span>
</label>
<label class="flex items-center">
<input type="radio" name="reason" value="duplicate" class="mr-2" required>
<span class="text-sm">Duplicate posting</span>
</label>
<label class="flex items-center">
<input type="radio" name="reason" value="inappropriate" class="mr-2" required>
<span class="text-sm">Inappropriate content</span>
</label>
<label class="flex items-center">
<input type="radio" name="reason" value="other" class="mr-2" required>
<span class="text-sm">Other</span>
</label>
</div>
<div>
<label for="details" class="block text-sm font-medium text-gray-700 mb-1">
Additional details (optional)
</label>
<textarea id="details" name="details" rows="3"
class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500"
placeholder="Provide more information..."></textarea>
</div>
<div class="flex gap-3">
<button type="button"
@click="showReportModal = false"
class="flex-1 px-4 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50">
Cancel
</button>
<button type="submit"
class="flex-1 px-4 py-2 bg-red-600 hover:bg-red-700 text-white rounded-lg">
Submit Report
</button>
</div>
<p class="text-xs text-gray-500 text-center">
Thank you for helping us maintain quality job listings.
</p>
</form>
</div>
</div>
</div>
</div>
</div>