feat: job application modal

This commit is contained in:
Jannat Patel
2024-02-19 16:54:07 +05:30
parent 084eeba2ed
commit 36c4e2f4dc
5 changed files with 64 additions and 11 deletions

View File

@@ -0,0 +1,49 @@
<template>
<Dialog
:options="{
title: __('Apply for this job'),
size: '2xl',
actions: [
{
label: 'Submit',
variant: 'solid',
onClick: (close) => submitResume(close),
},
],
}"
>
<template #body-content>
<div class="flex flex-col gap-4">
<div>
<div class="mb-1.5 text-sm text-gray-600">
{{ __('Title') }}
</div>
<FileUploader
:fileTypes="['pdf']"
:validateFile="validateFile"
@success="(file) => (resume.value = file.file_url)"
/>
</div>
</div>
</template>
</Dialog>
</template>
<script setup>
import { Dialog, FileUploader } from 'frappe-ui'
const props = defineProps({
email: {
type: String,
required: true,
},
})
const resume = ref(null)
const validateFile = (file) => {
let extension = file.name.split('.').pop().toLowerCase()
if (extension != 'pdf') {
return 'Only PDF file is allowed'
}
}
</script>

View File

@@ -10,7 +10,7 @@
<div class="grid grid-cols-2 gap-4">
<div v-for="evl in upcoming_evals.data">
<div class="border rounded-md p-3">
<div class="font-medium mb-3">
<div class="font-semibold mb-3">
{{ evl.course_title }}
</div>
<div class="flex items-center mb-2">

View File

@@ -23,7 +23,7 @@
</template>
{{ __('Report') }}
</Button>
<Button variant="solid">
<Button variant="solid" @click="openApplicationModal()">
<template #prefix>
<SendHorizonal class="h-4 w-4" />
</template>
@@ -96,4 +96,8 @@ const job = createResource({
cache: ['job', props.job],
auto: true,
})
const openApplicationModal = () => {
console.log('openApplicationModal')
}
</script>

View File

@@ -21,7 +21,7 @@
"company_website",
"column_break_11",
"company_logo",
"application_link"
"company_email_address"
],
"fields": [
{
@@ -100,23 +100,24 @@
"label": "Company Logo",
"reqd": 1
},
{
"fieldname": "application_link",
"fieldtype": "Data",
"label": "Application Form Link",
"reqd": 1
},
{
"default": "0",
"fieldname": "disabled",
"fieldtype": "Check",
"label": "Disabled"
},
{
"fieldname": "company_email_address",
"fieldtype": "Data",
"label": "Company Email Address",
"options": "Email",
"reqd": 1
}
],
"index_web_pages_for_search": 1,
"links": [],
"make_attachments_public": 1,
"modified": "2024-02-01 23:14:17.444811",
"modified": "2024-02-07 23:02:06.102120",
"modified_by": "Administrator",
"module": "Job",
"name": "Job Opportunity",

View File

@@ -17,7 +17,6 @@ class JobOpportunity(Document):
def validate_urls(self):
frappe.utils.validate_url(self.company_website, True)
frappe.utils.validate_url(self.application_link, True)
@frappe.whitelist()