diff --git a/school/job/doctype/job_opportunity/job_opportunity.json b/school/job/doctype/job_opportunity/job_opportunity.json index 60331764..6397d2a1 100644 --- a/school/job/doctype/job_opportunity/job_opportunity.json +++ b/school/job/doctype/job_opportunity/job_opportunity.json @@ -9,10 +9,10 @@ "field_order": [ "job_title", "location", + "disabled", "column_break_5", "type", "status", - "job_opportunity_status", "section_break_6", "description", "company_details_section", @@ -51,19 +51,12 @@ "reqd": 1 }, { - "default": "Pending", + "default": "Open", "fieldname": "status", "fieldtype": "Select", "in_list_view": 1, "in_standard_filter": 1, "label": "Status", - "options": "Pending\nApproved\nRejected" - }, - { - "default": "Open", - "fieldname": "job_opportunity_status", - "fieldtype": "Select", - "label": "Job Opportunity Status", "options": "Open\nClosed" }, { @@ -109,11 +102,17 @@ "fieldtype": "Data", "label": "Application Form Link", "reqd": 1 + }, + { + "default": "0", + "fieldname": "disabled", + "fieldtype": "Check", + "label": "Disabled" } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2021-12-30 12:10:08.849547", + "modified": "2022-01-11 14:56:42.509351", "modified_by": "Administrator", "module": "Job", "name": "Job Opportunity", diff --git a/school/job/doctype/job_opportunity/job_opportunity.py b/school/job/doctype/job_opportunity/job_opportunity.py index 994f6e29..3812910e 100644 --- a/school/job/doctype/job_opportunity/job_opportunity.py +++ b/school/job/doctype/job_opportunity/job_opportunity.py @@ -1,8 +1,29 @@ # Copyright (c) 2021, Frappe and contributors # For license information, please see license.txt -# import frappe +import frappe from frappe.model.document import Document +from frappe.utils.user import get_system_managers +from frappe import _ +from frappe.utils import get_link_to_form class JobOpportunity(Document): pass + +@frappe.whitelist() +def report(job, reason): + args = { + "job": job, + "job_url": get_link_to_form("Job Opportunity", job), + "user": frappe.session.user + } + system_managers = get_system_managers(only_name=True) + user = frappe.db.get_value("User", frappe.session.user, "full_name") + subject = _("User {0} has reported the job post {1}").format(user, job) + frappe.sendmail( + recipients = system_managers, + subject=subject, + header=[subject, "green"], + template = "job_report", + args=args, + now=True) diff --git a/school/public/css/style.css b/school/public/css/style.css index 6cabda07..ad2f83f8 100644 --- a/school/public/css/style.css +++ b/school/public/css/style.css @@ -1479,16 +1479,26 @@ pre { } .job-card-info { - padding: 0 1.5rem; flex: 1; } .company-logo { background-position: center; - background-size: 88px; + background-size: 37px; } .job-card-parent { display: grid; row-gap: 1rem; } + +.job-card-logo-section { + display: flex; + flex-direction: column; + align-items: flex-end; + justify-content: space-between; +} + +.job-detail-card { + flex-direction: column; +} diff --git a/school/templates/emails/job_report.html b/school/templates/emails/job_report.html new file mode 100644 index 00000000..82896d36 --- /dev/null +++ b/school/templates/emails/job_report.html @@ -0,0 +1,7 @@ +{% set job_link = "" + job + "" %} + + +
{{ _("Hey,") }}
+{{ _("{0} has reported a job post for the following reason.").format(user) }}
+{{ reason }}
+{{ _("Please take appropriate action at {0}").format(job_link) }}
diff --git a/school/templates/job_card.html b/school/templates/job_card.html new file mode 100644 index 00000000..1ad7ec7c --- /dev/null +++ b/school/templates/job_card.html @@ -0,0 +1,21 @@ +