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

View File

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

View File

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

View File

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