Skip to content

Commit

Permalink
feat: add portal page
Browse files Browse the repository at this point in the history
(cherry picked from commit 7d5baff)

# Conflicts:
#	hrms/hooks.py
  • Loading branch information
krantheman authored and mergify[bot] committed Dec 12, 2023
1 parent 434991a commit 0f6c47d
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 84 deletions.
6 changes: 6 additions & 0 deletions hrms/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,16 @@
# automatically create page for each record of this doctype
website_generators = ["Job Opening"]

<<<<<<< HEAD
website_route_rules = [
{"from_route": "/jobs", "to_route": "Job Opening"},
{"from_route": "/hrms/<path:app_path>", "to_route": "hrms"},
]
=======
# website_route_rules = [
# {"from_route": "/jobs", "to_route": "Job Opening"},
# ]
>>>>>>> 7d5baff78 (feat: add portal page)
# Jinja
# ----------

Expand Down
152 changes: 68 additions & 84 deletions hrms/templates/generators/job_opening.html
Original file line number Diff line number Diff line change
@@ -1,85 +1,69 @@
{% extends "templates/web.html" %} {% block breadcrumbs %} {% include
"templates/includes/breadcrumbs.html" %} {% endblock %} {% block page_content %}

<div class="py-20">
<div class="flex mb-16">
<h1 class="my-0 mr-32" style="font-size: 3rem">{{ job_title }}</h1>
<div class="ml-auto">
{%- if job_application_route -%}
<a
class="btn btn-primary btn-lg"
href="/{{ job_application_route }}/new?job_title={{ doc.name }}"
>{{ _("Apply Now") }}</a
>
{% else %}
<a
class="btn btn-primary btn-lg"
href="/job_application/new?job_title={{ doc.name }}"
>{{ _("Apply Now") }}</a
>
{% endif %}
</div>
</div>

<div class="mb-16" style="font-size: 18px">
<div
class="flex mt-3 align-items-center mb-4"
style="--icon-stroke: var(--primary)"
>
{%- if department -%}
<svg class="icon icon-lg ml-0 mr-1">
<use href="#icon-branch"></use>
</svg>
<p class="mr-3 mb-0">{{ doc.department }}</p>
{% endif %} {%- if location -%}
<svg
class="icon icon-lg 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">{{ doc.location }}</p>
{% endif %} {%- if employment_type -%}
<svg class="icon icon-lg ml-0 mr-1">
<use href="#icon-hr"></use>
</svg>
<p class="mr-3 mb-0">{{ doc.employment_type }}</p>
{% endif %}
</div>

{%- if doc.publish_salary_range -%}
<p>
{{ _("Salary range " + doc.salary_type.lower() ) }}:
<b
>{{ frappe.format_value(frappe.utils.flt(doc.lower_range) ,
currency=doc.currency) }} - {{
frappe.format_value(frappe.utils.flt(doc.upper_range) ,
currency=doc.currency) }}
</b>
</p>
{% endif %}

<p>
<i>
{%- if doc.closes_on -%} {{ _("Closes on " +
frappe.format_date(doc.closes_on) ) }} {%- if no_of_applications -%} {{
" - " }}{% endif %} {% endif %} {%- if no_of_applications -%} {{
no_of_applications }} {{ _("application received!" if no_of_applications
== 1 else "applications received!") }} {% endif %}
</i>
</p>
</div>

{%- if doc.description -%}
<p>{{ description }}</p>
{% endif %}
{% extends "templates/web.html" %}
{% block page_content %}
<div class="py-20">
<div class="flex mb-16">
<h1 class="my-0 mr-32" style="font-size: 3rem">{{ job_title }}</h1>
<div class="ml-auto">
{%- if job_application_route -%}
<a class="btn btn-primary btn-lg"
href="/{{ job_application_route }}/new?job_title={{ doc.name }}">{{ _("Apply Now") }}</a>
{% else %}
<a class="btn btn-primary btn-lg"
href="/job_application/new?job_title={{ doc.name }}">{{ _("Apply Now") }}</a>
{% endif %}
</div>
</div>
<div class="mb-16" style="font-size: 18px">
<div class="flex mt-3 align-items-center mb-4"
style="--icon-stroke: var(--primary)">
{%- if department -%}
<svg class="icon icon-lg ml-0 mr-1">
<use href="#icon-branch"></use>
</svg>
<p class="mr-3 mb-0">{{ doc.department }}</p>
{% endif %}
{%- if location -%}
<svg class="icon icon-lg 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">{{ doc.location }}</p>
{% endif %}
{%- if employment_type -%}
<svg class="icon icon-lg ml-0 mr-1">
<use href="#icon-hr"></use>
</svg>
<p class="mr-3 mb-0">{{ doc.employment_type }}</p>
{% endif %}
</div>
{%- if doc.publish_salary_range -%}
<p>
{{ _("Salary range " + doc.salary_type.lower() ) }}:
<b>{{ frappe.format_value(frappe.utils.flt(doc.lower_range) ,
currency=doc.currency) }} - {{ frappe.format_value(frappe.utils.flt(doc.upper_range) ,
currency=doc.currency) }}
</b>
</p>
{% endif %}
<p>
<i>
{%- if doc.closes_on -%} {{ _("Closes on " +
frappe.format_date(doc.closes_on, "d MMM, YYYY") ) }} {%- if
no_of_applications -%} {{ " - " }}
{% endif %}
{% endif %}
{%- if
no_of_applications -%} {{ no_of_applications }} {{ _("application
received!" if no_of_applications == 1 else "applications received!") }}
{% endif %}
</i>
</p>
</div>
{%- if doc.description -%}<p>{{ description }}</p>{% endif %}
</div>
{% endblock %}
{% endblock page_content %}
5 changes: 5 additions & 0 deletions hrms/www/jobs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% extends "templates/web.html" %}
{% block header %}
{% endblock header %}
{% block page_content %}
{% endblock page_content %}
4 changes: 4 additions & 0 deletions hrms/www/jobs/index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import frappe

def get_context(context):
context.parents = [{"name": frappe._("My Account"), "route": "/"}]

0 comments on commit 0f6c47d

Please sign in to comment.