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..db9d4475 100644 --- a/school/job/doctype/job_opportunity/job_opportunity.py +++ b/school/job/doctype/job_opportunity/job_opportunity.py @@ -1,8 +1,30 @@ # 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): + 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) + args = { + "job": job, + "job_url": get_link_to_form("Job Opportunity", job), + "user": user, + "reason": reason + } + frappe.sendmail( + recipients = system_managers, + subject=subject, + header=[subject, "green"], + template = "job_report", + args=args, + now=True) diff --git a/school/job/doctype/job_settings/__init__.py b/school/job/doctype/job_settings/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/school/job/doctype/job_settings/job_settings.js b/school/job/doctype/job_settings/job_settings.js new file mode 100644 index 00000000..7234fdf2 --- /dev/null +++ b/school/job/doctype/job_settings/job_settings.js @@ -0,0 +1,8 @@ +// Copyright (c) 2022, Frappe and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Job Settings', { + // refresh: function(frm) { + + // } +}); diff --git a/school/job/doctype/job_settings/job_settings.json b/school/job/doctype/job_settings/job_settings.json new file mode 100644 index 00000000..aac7e3aa --- /dev/null +++ b/school/job/doctype/job_settings/job_settings.json @@ -0,0 +1,42 @@ +{ + "actions": [], + "allow_rename": 1, + "creation": "2022-01-10 17:16:46.598673", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "allow_posting" + ], + "fields": [ + { + "default": "0", + "fieldname": "allow_posting", + "fieldtype": "Check", + "label": "Allow Job Posting From Website" + } + ], + "index_web_pages_for_search": 1, + "issingle": 1, + "links": [], + "modified": "2022-01-10 18:45:26.646438", + "modified_by": "Administrator", + "module": "Job", + "name": "Job Settings", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "print": 1, + "read": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/school/job/doctype/job_settings/job_settings.py b/school/job/doctype/job_settings/job_settings.py new file mode 100644 index 00000000..48d20ea9 --- /dev/null +++ b/school/job/doctype/job_settings/job_settings.py @@ -0,0 +1,8 @@ +# Copyright (c) 2022, Frappe and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + +class JobSettings(Document): + pass diff --git a/school/job/doctype/job_settings/test_job_settings.py b/school/job/doctype/job_settings/test_job_settings.py new file mode 100644 index 00000000..65294592 --- /dev/null +++ b/school/job/doctype/job_settings/test_job_settings.py @@ -0,0 +1,8 @@ +# Copyright (c) 2022, Frappe and Contributors +# See license.txt + +# import frappe +import unittest + +class TestJobSettings(unittest.TestCase): + pass diff --git a/school/public/css/style.css b/school/public/css/style.css index 212c5388..0f567103 100644 --- a/school/public/css/style.css +++ b/school/public/css/style.css @@ -63,9 +63,8 @@ input[type=checkbox] { text-align: center; letter-spacing: 0.011em; text-transform: uppercase; - color: #2C5477; font-weight: bold; - box-shadow: 0px 5px 10px rgb(0 0 0 / 10%); + box-shadow: var(--shadow-base); } .dark-pills { @@ -119,9 +118,7 @@ input[type=checkbox] { .card-heading { font-weight: 600; - font-size: 1.5rem; - line-height: 156%; - letter-spacing: -0.014em; + font-size: var(--text-3xl); color: var(--text-color-dark); } @@ -1478,20 +1475,30 @@ pre { .job-card { display: flex; - justify-content: space-between; - align-items: center; - padding-right: 1rem; -} - -.job-card-info { - padding: 2rem 1rem 1rem; -} - -.job-description-section { padding: 1rem; } -.company-logo { - background-position: left; - background-size: 88px; +.job-card-info { + flex: 1; +} + +.company-logo { + background-position: center; + 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..dcbe77f9 --- /dev/null +++ b/school/templates/emails/job_report.html @@ -0,0 +1,6 @@ +{% 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_url) }}

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 @@ +
+
+
+
{{ _(job.type) }}
+
{{ job.location }}
+
+
{{ _(job.job_title) }}
+ + {% if show_edit_link and job.owner == frappe.session.user %} + Edit + {% endif %} +
+
+
Posted on: {{ frappe.utils.format_date(job.creation, "medium") }}
+
+ +
+
+
diff --git a/school/www/community/index.html b/school/www/community/index.html index c07a106b..6178c89d 100644 --- a/school/www/community/index.html +++ b/school/www/community/index.html @@ -1,5 +1,4 @@ {% extends "templates/base.html" %} -{% from "www/hackathons/macros/card.html" import null_card %} {% block title %}{{ _('Community') }}{% endblock %} {% block content %} diff --git a/school/www/courses/index.html b/school/www/courses/index.html index ea9d53d4..0f1139df 100644 --- a/school/www/courses/index.html +++ b/school/www/courses/index.html @@ -1,5 +1,4 @@ {% extends "templates/base.html" %} -{% from "www/hackathons/macros/card.html" import null_card %} {% block title %}{{ 'Courses' }}{% endblock %} {% block head_include %}