saved jobs
This commit is contained in:
@@ -181,6 +181,27 @@
|
||||
</svg>
|
||||
</a>
|
||||
<p class="text-xs text-gray-500 text-center mt-3">You will be redirected to the company's application page</p>
|
||||
@auth
|
||||
<form method="POST" action="{{ route('jobs.bookmark', $job) }}" class="mt-3"
|
||||
x-data="{ saved: {{ auth()->user()->savedJobs()->where('job_id', $job->id)->exists() ? 'true' : 'false' }} }">
|
||||
@csrf
|
||||
<button type="submit" @click="saved = !saved"
|
||||
class="flex items-center justify-center w-full px-6 py-3 border rounded-lg font-semibold transition-colors duration-200"
|
||||
:class="saved ? 'border-emerald-600 text-emerald-600 bg-emerald-50 hover:bg-emerald-100' : 'border-gray-300 text-gray-700 hover:border-emerald-400 hover:text-emerald-600'">
|
||||
<svg class="w-5 h-5 mr-2" :fill="saved ? 'currentColor' : 'none'" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-4.5L5 21V5z"/>
|
||||
</svg>
|
||||
<span x-text="saved ? 'Bookmarked' : 'Bookmark'"></span>
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
<a href="{{ route('login') }}" class="flex items-center justify-center w-full mt-3 px-6 py-3 border border-gray-300 text-gray-500 rounded-lg text-sm hover:border-emerald-400 hover:text-emerald-600 transition-colors duration-200">
|
||||
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-4.5L5 21V5z"/>
|
||||
</svg>
|
||||
Log in to bookmark
|
||||
</a>
|
||||
@endauth
|
||||
</div>
|
||||
|
||||
<!-- Share -->
|
||||
|
||||
Reference in New Issue
Block a user