feat: job posting

This commit is contained in:
Jannat Patel
2021-12-28 22:26:52 +05:30
parent fcfda68d88
commit b1b8f202c9
22 changed files with 539 additions and 24 deletions

View File

View File

@@ -0,0 +1,34 @@
{% extends "templates/base.html" %}
{% from "www/hackathons/macros/card.html" import null_card %}
{% block title %}{{ 'Job Openings' }}{% endblock %}
{% block content %}
<div class="common-page-style">
<div class="container">
<a class="button is-primary pull-right" href="/job-opportunity?new=1">Post a Job</a>
<div class="course-home-headings"> Job Openings </div>
<div class="cards-parent">
{% for job in jobs %}
<div class="common-card-style course-card">
<div class="job-card">
<div>
<div class="course-tags">
<div class="course-card-pills">{{ job.type }}</div>
<div class="course-card-pills">{{ job.location }}</div>
</div>
<div class="job-card-info">
<div class="bold-title">{{ job.job_title }}</div>
<small>{{ job.company_name }}</small>
</div>
</div>
<div class="avatar avatar-large" title="{{ job.company_name}}">
<span class="avatar-frame company-logo" style="background-image: url( {{ job.company_logo | urlencode }} );"></span>
</div>
</div>
<a class="stretched-link" href="/jobs/{{ job.name }}"></a>
</div>
{% endfor %}
</div>
</div>
</div>
{% endblock %}

12
school/www/jobs/index.py Normal file
View File

@@ -0,0 +1,12 @@
import frappe
def get_context(context):
context.jobs = frappe.get_all("Job Opportunity",
{
"status": "Approved"
},
[
"job_title", "location", "type", "company_name",
"company_logo", "name"
])

43
school/www/jobs/job.html Normal file
View File

@@ -0,0 +1,43 @@
{% extends "templates/base.html" %}
{% from "www/hackathons/macros/card.html" import null_card %}
{% block title %}{{ 'Job Openings' }}{% endblock %}
{% block content %}
<div class="common-page-style">
<div class="container">
{{ BreadCrumb(job) }}
<div class="common-card-style thread-card">
<div class="job-card">
<div>
<span class="course-tags">
<div class="course-card-pills">{{ job.type }}</div>
<div class="course-card-pills">{{ job.location }}</div>
</span>
<div class="job-card-info">
<div class="card-heading">{{ job.job_title }}</div>
<a class="dark-links" href="{{ job.company_website }}">{{ job.company_name }}</a>
<div class="small mt-1">Posted On: {{ frappe.utils.format_date(job.creation, "medium") }}</div>
</div>
</div>
<div class="avatar avatar-large" title="{{ job.company_name}}">
<span class="avatar-frame company-logo" style="background-image: url( {{ job.company_logo | urlencode }} );"></span>
</div>
</div>
<div class="job-description-section">
<div>{{ job.description }}</div>
<a class="button is-primary mt-5" href="{{ job.application_link }}">Apply Now</a>
</div>
</div>
</div>
</div>
{% endblock %}
{% macro BreadCrumb(job) %}
<div class="breadcrumb">
<a class="dark-links" href="/jobs">Job Openings</a>
<img class="ml-1 mr-1" src="/assets/school/icons/chevron-right.svg">
<span class="muted-text">{{ job.job_title }}</span>
</div>
{% endmacro %}

9
school/www/jobs/job.py Normal file
View File

@@ -0,0 +1,9 @@
import frappe
def get_context(context):
try:
job = frappe.form_dict["job"]
except KeyError:
frappe.local.flags.redirect_location = "/jobs"
raise frappe.Redirect
context.job = frappe.get_doc("Job Opportunity", job)

View File

@@ -32,6 +32,9 @@
{% if member.get_authored_courses() | length %}
<div class="creator-badge"> Creator </div>
{% endif %}
{% if member.looking_for_job %}
<div class="creator-badge"> Open Network </div>
{% endif %}
</div>
{% if frappe.session.user == member.email %}
@@ -78,20 +81,20 @@
<div class="common-card-style overview-card small-title">
{% if enrollment %}
<div class="overview-item">
<img class="icon-background mr-1" src="/assets/school/icons/user.svg" />
{{ enrollment }} Enrolled
<img class="icon-background mr-1" src="/assets/school/icons/course.svg" />
{{ enrollment }} {% if enrollment > 1 %} Courses {% else %} Course {% endif %} Taken
</div>
{% endif %}
{% if reviews %}
<div class="overview-item">
<img class="icon-background mr-1" src="/assets/school/icons/rating.svg" />
{{ reviews }} Created
{{ reviews }} {% if reviews > 1 %} Courses {% else %} Course {% endif %} Reviewed
</div>
{% endif %}
{% if mentorship %}
<div class="overview-item">
<img class="icon-background mr-1" src="/assets/school/icons/calendar.svg" />
{{ mentorship }} Mentored
{{ mentorship }} {% if mentorship > 1 %} Courses {% else %} Course {% endif %} Mentored
</div>
{% endif %}
</div>
@@ -288,7 +291,7 @@
<div class="common-card-style profile-card">
{% for edu in member.education %}
<div class="profile-card-row">
<div class="institute-name"> {{ edu.institution_name }} </div>
<div class="bold-title"> {{ edu.institution_name }} </div>
<div class="profile-item"> {{ edu.degree_type }} <span></span> {{ edu.major }}
{% if not member.hide_private %}
<!-- {% if edu.grade_type %} {{ edu.grade_type }} {% endif %} -->
@@ -316,7 +319,7 @@
<div class="common-card-style profile-card">
{% for work in work_details %}
<div class="">
<div class="institute-name"> {{ work.title }} </div>
<div class="bold-title"> {{ work.title }} </div>
<div class="profile-item"> {{ work.company }} </div>
<div> {{ frappe.utils.format_date(work.from_date, "MMM YYYY") }} -
{% if work.to_date %} {{ frappe.utils.format_date(work.to_date, "MMM YYYY") }} {% else %} Present {% endif %} </div>
@@ -336,7 +339,7 @@
<div class="common-card-style profile-card">
{% for cert in member.certification %}
<div class="">
<div class="institute-name"> {{ cert.certification_name }} </div>
<div class="bold-title"> {{ cert.certification_name }} </div>
<div class="profile-item"> {{ cert.organization }} </div>
<div> {{ frappe.utils.format_date(cert.issue_date, "MMM YYYY") }}
{% if cert.expiration_date %} - {{ frappe.utils.format_date(cert.expiration_date, "MMM YYYY") }} {% endif %} </div>