Skip to content

Commit

Permalink
feat: render fields conditionally
Browse files Browse the repository at this point in the history
(cherry picked from commit a013069)
  • Loading branch information
krantheman authored and mergify[bot] committed Dec 12, 2023
1 parent ffe6d48 commit 7bf0766
Showing 1 changed file with 76 additions and 66 deletions.
142 changes: 76 additions & 66 deletions hrms/templates/generators/job_opening.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,83 +38,93 @@ <h1 class="mt-0 mb-3" style="font-size: 3rem">{{ job_title }}</h1>
</div>
</div>
</div>
<div class="col-4 mb-8">
<div class="card flex flex-row align-items-center">
<div class="rounded-circle p-4" style="background: var(--blue-50)">
<svg class="icon"
style="height: 28px;
width: 28px"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16">
<g stroke="var(--gray-700)" 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>
</div>
<div class="ml-5">
<div class="text-secondary" style="font-size: 13px">Location</div>
<div class="font-weight-bold">{{ location }}</div>
{%- if location -%}
<div class="col-4 mb-8">
<div class="card flex flex-row align-items-center">
<div class="rounded-circle p-4" style="background: var(--blue-50)">
<svg class="icon"
style="height: 28px;
width: 28px"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16">
<g stroke="var(--gray-700)" 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>
</div>
<div class="ml-5">
<div class="text-secondary" style="font-size: 13px">Location</div>
<div class="font-weight-bold">{{ location }}</div>
</div>
</div>
</div>
</div>
<div class="col-4 mb-8">
<div class="card flex flex-row align-items-center">
<div class="rounded-circle p-4" style="background: var(--green-50)">
<svg class="icon" style="height: 28px; width: 28px;">
<use href="#icon-income" style="height: 28px; width: 28px"></use>
</svg>
</div>
<div class="ml-5">
<div class="text-secondary" style="font-size: 14px">Salary Range</div>
<div class="font-weight-bold">
{{ frappe.format_value(frappe.utils.flt(lower_range) ,
currency=currency) }} - {{ frappe.format_value(frappe.utils.flt(upper_range) ,
currency=currency) }} / {{ salary_per.lower() }}
{% endif %}
{%- if publish_salary_range -%}
<div class="col-4 mb-8">
<div class="card flex flex-row align-items-center">
<div class="rounded-circle p-4" style="background: var(--green-50)">
<svg class="icon" style="height: 28px; width: 28px;">
<use href="#icon-income" style="height: 28px; width: 28px"></use>
</svg>
</div>
<div class="ml-5">
<div class="text-secondary" style="font-size: 14px">Salary Range</div>
<div class="font-weight-bold">
{{ frappe.format_value(frappe.utils.flt(lower_range) ,
currency=currency) }} - {{ frappe.format_value(frappe.utils.flt(upper_range) ,
currency=currency) }} / {{ salary_per.lower() }}
</div>
</div>
</div>
</div>
</div>
<div class="col-4 mb-8">
<div class="card flex flex-row align-items-center">
<div class="rounded-circle p-4" style="background: var(--yellow-50)">
<svg class="icon" style="height: 28px; width: 28px;">
<use href="#icon-branch" style="height: 28px; width: 28px"></use>
</svg>
</div>
<div class="ml-5">
<div class="text-secondary" style="font-size: 13px">Department</div>
<div class="font-weight-bold">{{ department }}</div>
{% endif %}
{%- if department -%}
<div class="col-4 mb-8">
<div class="card flex flex-row align-items-center">
<div class="rounded-circle p-4" style="background: var(--yellow-50)">
<svg class="icon" style="height: 28px; width: 28px;">
<use href="#icon-branch" style="height: 28px; width: 28px"></use>
</svg>
</div>
<div class="ml-5">
<div class="text-secondary" style="font-size: 13px">Department</div>
<div class="font-weight-bold">{{ department }}</div>
</div>
</div>
</div>
</div>
<div class="col-4 mb-8">
<div class="card flex flex-row align-items-center">
<div class="rounded-circle p-4" style="background: var(--orange-50)">
<svg class="icon" style="height: 28px; width: 28px;">
<use href="#icon-hr" style="height: 28px; width: 28px"></use>
</svg>
</div>
<div class="ml-5">
<div class="text-secondary" style="font-size: 13px">Employment Type</div>
<div class="font-weight-bold">{{ employment_type }}</div>
{% endif %}
{%- if employment_type -%}
<div class="col-4 mb-8">
<div class="card flex flex-row align-items-center">
<div class="rounded-circle p-4" style="background: var(--orange-50)">
<svg class="icon" style="height: 28px; width: 28px;">
<use href="#icon-hr" style="height: 28px; width: 28px"></use>
</svg>
</div>
<div class="ml-5">
<div class="text-secondary" style="font-size: 13px">Employment Type</div>
<div class="font-weight-bold">{{ employment_type }}</div>
</div>
</div>
</div>
</div>
<div class="col-4 mb-8">
<div class="card flex flex-row align-items-center">
<div class="rounded-circle p-4" style="background: var(--red-50)">
<svg class="icon" style="height: 28px; width: 28px;">
<use href="#icon-calendar" style="height: 28px; width: 28px"></use>
</svg>
</div>
<div class="ml-5">
<div class="text-secondary" style="font-size: 13px">Closes On</div>
<div class="font-weight-bold">{{ frappe.format_date(closes_on, "d MMM, YYYY") }}</div>
{% endif %}
{%- if closes_on -%}
<div class="col-4 mb-8">
<div class="card flex flex-row align-items-center">
<div class="rounded-circle p-4" style="background: var(--red-50)">
<svg class="icon" style="height: 28px; width: 28px;">
<use href="#icon-calendar" style="height: 28px; width: 28px"></use>
</svg>
</div>
<div class="ml-5">
<div class="text-secondary" style="font-size: 13px">Closes On</div>
<div class="font-weight-bold">{{ frappe.format_date(closes_on, "d MMM, YYYY") }}</div>
</div>
</div>
</div>
</div>
{% endif %}
</div>
</div>
</div>
Expand Down

0 comments on commit 7bf0766

Please sign in to comment.