fix: new ui for job list

This commit is contained in:
Jannat Patel
2025-04-08 22:39:42 +05:30
parent d6738b86c9
commit 57b6433dc0
4 changed files with 50 additions and 41 deletions

View File

@@ -1,41 +1,37 @@
<template> <template>
<div class="flex space-x-4 border rounded-md p-2"> <div class="border rounded-md p-4">
<img :src="job.company_logo" class="size-10 rounded-full object-contain" /> <div class="flex space-x-4">
<div class="flex flex-col space-y-2 flex-1"> <img
:src="job.company_logo"
class="size-10 rounded-full object-contain"
/>
<div class="flex flex-col space-y-1 flex-1">
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<span class="font-semibold text-ink-gray-9"> <span class="text-lg font-semibold text-ink-gray-9">
{{ job.job_title }} {{ job.job_title }}
</span> </span>
</div> </div>
<div class="flex items-center space-x-2 text-ink-gray-5"> <div class="text-xs text-ink-gray-5">
<Building2 class="w-4 h-4 stroke-1.5" />
<span>
{{ job.company_name }} {{ job.company_name }}
</span>
</div> </div>
<div class="flex items-center space-x-2 text-ink-gray-5"> </div>
<MapPin class="w-4 h-4 stroke-1.5" /> </div>
<span> <div class="space-x-4 mt-2">
<Badge>
{{ job.location }} {{ job.location }}
</span> </Badge>
</div> <Badge>
<div class="flex items-center space-x-2 text-ink-gray-5">
<Shapes class="w-4 h-4 stroke-1.5" />
<span>
{{ job.type }} {{ job.type }}
</span> </Badge>
</div> <Badge>
<div class="flex items-center space-x-2 text-ink-gray-5"> {{ dayjs(job.creation).fromNow() }}
<Calendar class="w-4 h-4 stroke-1.5" /> </Badge>
<span> {{ __('posted') }} {{ dayjs(job.creation).fromNow() }} </span>
</div>
</div> </div>
</div> </div>
</template> </template>
<script setup> <script setup>
import { Building2, Calendar, MapPin, Shapes } from 'lucide-vue-next'
import { inject } from 'vue' import { inject } from 'vue'
import { Avatar } from 'frappe-ui' import { Badge } from 'frappe-ui'
const dayjs = inject('$dayjs') const dayjs = inject('$dayjs')
const props = defineProps({ const props = defineProps({

View File

@@ -16,7 +16,7 @@
}, },
]" ]"
/> />
<div v-if="user.data?.name" class="flex"> <div v-if="user.data?.name" class="flex space-x-2">
<router-link <router-link
v-if="user.data.name == job.data?.owner" v-if="user.data.name == job.data?.owner"
:to="{ :to="{
@@ -24,13 +24,19 @@
params: { jobName: job.data?.name }, params: { jobName: job.data?.name },
}" }"
> >
<Button class="mr-2"> <Button>
<template #prefix> <template #prefix>
<Pencil class="h-4 w-4 stroke-1.5" /> <Pencil class="h-4 w-4 stroke-1.5" />
</template> </template>
{{ __('Edit') }} {{ __('Edit') }}
</Button> </Button>
</router-link> </router-link>
<Button @click="redirectToWebsite(job.data?.company_website)">
<template #prefix>
<SquareArrowOutUpRight class="h-4 w-4 stroke-1.5" />
</template>
{{ __('Visit Website') }}
</Button>
<Button <Button
v-if="!jobApplication.data?.length" v-if="!jobApplication.data?.length"
variant="solid" variant="solid"
@@ -56,10 +62,11 @@
<div class="flex items-center"> <div class="flex items-center">
<img <img
:src="job.data.company_logo" :src="job.data.company_logo"
class="w-16 h-16 rounded-lg object-contain mr-4" class="w-16 h-16 rounded-lg object-contain cursor-pointer mr-4"
:alt="job.data.company_name" :alt="job.data.company_name"
@click="redirectToWebsite(job.data.company_website)"
/> />
<div class="text-2xl text-ink-gray-9 font-semibold mb-4"> <div class="text-2xl text-ink-gray-9 font-semibold">
{{ job.data.job_title }} {{ job.data.job_title }}
</div> </div>
</div> </div>
@@ -69,7 +76,7 @@
> >
<div class="flex items-center space-x-4"> <div class="flex items-center space-x-4">
<Building2 class="h-4 w-4 text-ink-green-2" /> <Building2 class="h-4 w-4 text-ink-green-2" />
<div class="flex flex-col space-y-2 text-ink-gray-7"> <div class="flex flex-col space-y-1 text-ink-gray-7">
<span class="text-xs text-ink-gray-5 font-medium uppercase"> <span class="text-xs text-ink-gray-5 font-medium uppercase">
{{ __('Organisation') }} {{ __('Organisation') }}
</span> </span>
@@ -80,7 +87,7 @@
</div> </div>
<div class="flex items-center space-x-4"> <div class="flex items-center space-x-4">
<MapPin class="size-4 text-ink-red-3" /> <MapPin class="size-4 text-ink-red-3" />
<div class="flex flex-col space-y-2 text-ink-gray-7"> <div class="flex flex-col space-y-1 text-ink-gray-7">
<span class="text-xs font-medium uppercase"> <span class="text-xs font-medium uppercase">
{{ __('Location') }} {{ __('Location') }}
</span> </span>
@@ -91,7 +98,7 @@
</div> </div>
<div class="flex items-center space-x-4"> <div class="flex items-center space-x-4">
<ClipboardType class="h-4 w-4 text-yellow-500" /> <ClipboardType class="h-4 w-4 text-yellow-500" />
<div class="flex flex-col space-y-2 text-ink-gray-7"> <div class="flex flex-col space-y-1 text-ink-gray-7">
<span class="text-xs font-medium uppercase"> <span class="text-xs font-medium uppercase">
{{ __('Category') }} {{ __('Category') }}
</span> </span>
@@ -102,7 +109,7 @@
</div> </div>
<div class="flex items-center space-x-4"> <div class="flex items-center space-x-4">
<CalendarDays class="h-4 w-4 text-ink-blue-2" /> <CalendarDays class="h-4 w-4 text-ink-blue-2" />
<div class="flex flex-col space-y-2 text-ink-gray-7"> <div class="flex flex-col space-y-1 text-ink-gray-7">
<span class="text-xs font-medium uppercase"> <span class="text-xs font-medium uppercase">
{{ __('Posted on') }} {{ __('Posted on') }}
</span> </span>
@@ -116,7 +123,7 @@
class="flex items-center space-x-4" class="flex items-center space-x-4"
> >
<SquareUserRound class="h-4 w-4 text-purple-500" /> <SquareUserRound class="h-4 w-4 text-purple-500" />
<div class="flex flex-col space-y-2 text-ink-gray-7"> <div class="flex flex-col space-y-1 text-ink-gray-7">
<span class="text-xs font-medium uppercase"> <span class="text-xs font-medium uppercase">
{{ __('Applications Received') }} {{ __('Applications Received') }}
</span> </span>
@@ -154,6 +161,7 @@ import {
CalendarDays, CalendarDays,
ClipboardType, ClipboardType,
SquareUserRound, SquareUserRound,
SquareArrowOutUpRight,
} from 'lucide-vue-next' } from 'lucide-vue-next'
const user = inject('$user') const user = inject('$user')
@@ -216,6 +224,10 @@ const redirectToLogin = (job) => {
window.location.href = `/login?redirect-to=/job-openings/${job}` window.location.href = `/login?redirect-to=/job-openings/${job}`
} }
const redirectToWebsite = (url) => {
window.open(url, '_blank')
}
usePageMeta(() => { usePageMeta(() => {
return { return {
title: job.data?.job_title, title: job.data?.job_title,

View File

@@ -25,7 +25,7 @@
</router-link> </router-link>
</header> </header>
<div> <div>
<div class="lg:w-3/4 mx-auto p-5"> <div class="p-5">
<div <div
class="flex flex-col lg:flex-row space-y-4 lg:space-y-0 lg:items-center justify-between mb-5" class="flex flex-col lg:flex-row space-y-4 lg:space-y-0 lg:items-center justify-between mb-5"
> >
@@ -60,7 +60,7 @@
<div <div
v-if="jobs.data?.length" v-if="jobs.data?.length"
class="grid grid-cols-1 lg:grid-cols-2 gap-5" class="grid grid-cols-1 lg:grid-cols-3 gap-5"
> >
<router-link <router-link
v-for="job in jobs.data" v-for="job in jobs.data"

View File

@@ -281,6 +281,7 @@ def get_job_details(job):
"type", "type",
"company_name", "company_name",
"company_logo", "company_logo",
"company_website",
"name", "name",
"creation", "creation",
"description", "description",