Skip to content

Commit

Permalink
feat: add branch and employment type to portal page
Browse files Browse the repository at this point in the history
(cherry picked from commit 9082da7)
  • Loading branch information
krantheman authored and mergify[bot] committed Dec 12, 2023
1 parent b989090 commit 5060bf4
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 19 deletions.
2 changes: 1 addition & 1 deletion hrms/hr/doctype/job_opening/job_opening.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def autoname(self):

def validate(self):
if not self.route:
self.route = frappe.scrub(self.job_title).replace("_", "-")
self.route = f"jobs/{frappe.scrub(self.job_title).replace('_', '-')}"
self.validate_dates()
self.validate_current_vacancies()
self.update_job_requisition_status()
Expand Down
6 changes: 5 additions & 1 deletion hrms/templates/generators/job_opening.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ <h1 class="my-0 mr-32" style="font-size: 3rem">{{ job_title }}</h1>
<div class="mb-16" style="font-size: 18px">
<div class="flex mt-3 align-items-center mb-4"
style="--icon-stroke: var(--primary)">
<svg class="icon icon-lg ml-0 mr-1">
<use href="#icon-organization"></use>
</svg>
<p class="mr-3 mb-0">{{ doc.company }}</p>
{%- if department -%}
<svg class="icon icon-lg ml-0 mr-1">
<use href="#icon-branch"></use>
Expand Down Expand Up @@ -59,7 +63,7 @@ <h1 class="my-0 mr-32" style="font-size: 3rem">{{ job_title }}</h1>
{% endif %}
{%- if
no_of_applications -%} {{ no_of_applications }} {{ _("application
received!" if no_of_applications == 1 else "applications received!") }}
received" if no_of_applications == 1 else "applications received") }}
{% endif %}
</i>
</p>
Expand Down
3 changes: 3 additions & 0 deletions hrms/www/jobs/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.primary-stroke {
--icon-stroke: var(--primary);
}
60 changes: 43 additions & 17 deletions hrms/www/jobs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,47 @@
{% block page_content %}
<div class="pt-12">
{% for jo in job_openings %}
<div class="pb-12">
<h4 class="mt-0">
{{ jo.job_title }} {%- if jo.location -%}<small class="text-secondary ml-2">({{ jo.location }})</small>{% endif %}
</h4>
{%- if jo.publish_salary_range -%}
<p>
{{ _("Salary range " + jo.salary_type.lower() ) }}:
<b>{{ frappe.format_value(frappe.utils.flt(jo.lower_range) ,
currency=jo.currency) }} - {{ frappe.format_value(frappe.utils.flt(jo.upper_range) ,
currency=jo.currency) }}
</b>
</p>
{% endif %}
<a href="{{ jo.route }}">{{ _("Learn More →") }}</a>
</div>
{% endfor %}
</div>
<div class="mb-12 card border p-6">
<div>
<h4 class="mt-0 mb-3">{{ jo.job_title }}</h4>
<div class="flex mb-3 align-items-center primary-stroke">
{%- if jo.department -%}
<svg class="icon icon-md ml-0 mr-1">
<use href="#icon-branch"></use>
</svg>
<p class="mr-3 mb-0">{{ jo.department }}</p>
{% endif %}
{%- if jo.location -%}
<svg class="icon icon-md ml-0 mr-1"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16">
<g stroke="var(--primary)" stroke-miterlimit="10">
<path d="M11.467 3.458c1.958 1.957 1.958 5.088.027 7.02L7.97 14l-3.523-3.523a4.945 4.945 0 010-6.993l.026-.026a4.922 4.922 0 016.993 0zm0 0c-.026-.026-.026-.026 0 0z">
</path>
<path d="M7.971 8.259a1.305 1.305 0 100-2.61 1.305 1.305 0 000 2.61z"></path>
</g>
</svg>
<p class="mr-3 mb-0">{{ jo.location }}</p>
{% endif %}
{%- if jo.employment_type -%}
<svg class="icon icon-md ml-0 mr-1">
<use href="#icon-hr"></use>
</svg>
<p class="mr-3 mb-0">{{ jo.employment_type }}</p>
{% endif %}
</div>
{%- if jo.publish_salary_range -%}
<p>
{{ _("Salary range " + jo.salary_type.lower() ) }}:
<b>{{ frappe.format_value(frappe.utils.flt(jo.lower_range) ,
currency=jo.currency) }} - {{ frappe.format_value(frappe.utils.flt(jo.upper_range) ,
currency=jo.currency) }}
</b>
</p>
{% endif %}
<a href="{{ jo.route }}">{{ _("Learn More →") }}</a>
</div>
</div>
{% endfor %}
</div>
{% endblock page_content %}
2 changes: 2 additions & 0 deletions hrms/www/jobs/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def get_job_openings(txt=None, filters=None, limit_start=0, limit_page_length=20
"salary_type",
"route",
"location",
"department",
"employment_type",
]

filters = filters or {}
Expand Down

0 comments on commit 5060bf4

Please sign in to comment.