[minor] fixes to job opening

This commit is contained in:
Rushabh Mehta 2016-12-19 17:06:26 +05:30
parent c3d8479443
commit 827588adf2
4 changed files with 188 additions and 184 deletions

View File

@ -20,7 +20,7 @@ class JobApplicant(Document):
self.get("__onload").offer_letter = offer_letter[0].name
def autoname(self):
keys = filter(None, (self.applicant_name, self.email_id))
keys = filter(None, (self.applicant_name, self.email_id, self.job_title))
if not keys:
frappe.throw(_("Name or Email is mandatory"), frappe.NameError)
self.name = " - ".join(keys)

View File

@ -2,7 +2,7 @@
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"autoname": "field:job_title",
"autoname": "field:route",
"beta": 0,
"creation": "2013-01-15 16:13:36",
"custom": 0,
@ -165,7 +165,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-11-07 05:29:33.272398",
"modified": "2016-12-19 05:54:38.298496",
"modified_by": "Administrator",
"module": "HR",
"name": "Job Opening",

View File

@ -16,6 +16,10 @@ class JobOpening(WebsiteGenerator):
page_title_field = "job_title",
)
def validate(self):
if not self.route:
self.route = frappe.scrub(self.job_title).replace('_', '-')
def get_context(self, context):
context.parents = [{'name': 'jobs', 'title': _('All Jobs') }]

View File

@ -13,7 +13,7 @@
{%- if description -%}
<div>{{ description }}</div>
{% endif %}
<p>
<p style='margin-top: 30px'>
<a class='btn btn-primary'
href='/job_application?job_title={{ doc.name }}'>
{{ _("Apply Now") }}</a>