Merge branch 'main' of https://github.com/frappe/lms into lms-frappe-ui
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<p align="center">
|
||||
<a href="https://www.frappelms.com/">
|
||||
<img src="https://frappelms.com/files/lms-logo-medium.png" alt="Frappe LMS" width="120px" height="25px">
|
||||
<img src="https://frappe.io/files/lms.png" alt="Frappe LMS" width="50px" height="50px">
|
||||
</a>
|
||||
<p align="center">Easy to use, open source, learning management system.</p>
|
||||
</p>
|
||||
|
||||
@@ -173,7 +173,8 @@ website_route_rules = [
|
||||
"to_route": "cohorts/join",
|
||||
},
|
||||
{"from_route": "/users", "to_route": "profiles/profile"},
|
||||
{"from_route": "/jobs/<job>", "to_route": "jobs/job"},
|
||||
{"from_route": "/job-openings", "to_route": "jobs_openings/index"},
|
||||
{"from_route": "/job-openings/<job>", "to_route": "jobs_openings/job"},
|
||||
{
|
||||
"from_route": "/batches/<batchname>/students/<username>",
|
||||
"to_route": "/batches/progress",
|
||||
|
||||
@@ -19,7 +19,7 @@ def add_pages_to_nav():
|
||||
{"label": "Courses", "url": "/courses", "parent": "Explore", "idx": 2},
|
||||
{"label": "Batches", "url": "/batches", "parent": "Explore", "idx": 3},
|
||||
{"label": "Statistics", "url": "/statistics", "parent": "Explore", "idx": 4},
|
||||
{"label": "Jobs", "url": "/jobs", "parent": "Explore", "idx": 5},
|
||||
{"label": "Jobs", "url": "/job-openings", "parent": "Explore", "idx": 5},
|
||||
{"label": "People", "url": "/community", "parent": "Explore", "idx": 6},
|
||||
]
|
||||
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
frappe.ui.form.on("Job Opportunity", {
|
||||
refresh: (frm) => {
|
||||
if (frm.doc.name)
|
||||
frm.add_web_link(`/jobs/${frm.doc.name}`, "See on Website");
|
||||
frm.add_web_link(`/job-openings/${frm.doc.name}`, "See on Website");
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
frappe.ready(function () {
|
||||
frappe.web_form.after_save = () => {
|
||||
setTimeout(() => {
|
||||
window.location.href = `/jobs`;
|
||||
window.location.href = `/job-openings`;
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"list_columns": [],
|
||||
"login_required": 1,
|
||||
"max_attachment_size": 0,
|
||||
"modified": "2022-09-15 17:22:43.957184",
|
||||
"modified": "2022-09-15 17:22:43.957185",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Job",
|
||||
"name": "job-opportunity",
|
||||
@@ -32,7 +32,7 @@
|
||||
"show_list": 1,
|
||||
"show_sidebar": 0,
|
||||
"success_message": "",
|
||||
"success_url": "/jobs",
|
||||
"success_url": "/job-openings",
|
||||
"title": "Job Opportunity",
|
||||
"web_form_fields": [
|
||||
{
|
||||
|
||||
@@ -11,8 +11,20 @@ from lms.lms.utils import get_evaluator
|
||||
|
||||
class LMSCertificateRequest(Document):
|
||||
def validate(self):
|
||||
self.validate_slot()
|
||||
self.validate_if_existing_requests()
|
||||
self.validate_evaluation_date()
|
||||
self.validate_evaluation_end_date()
|
||||
|
||||
def validate_slot(self):
|
||||
if frappe.db.exists(
|
||||
"LMS Certificate Request",
|
||||
{
|
||||
"evaluator": self.evaluator,
|
||||
"date": self.date,
|
||||
"start_time": self.start_time,
|
||||
},
|
||||
):
|
||||
frappe.throw(_("The slot is already booked by another participant."))
|
||||
|
||||
def validate_if_existing_requests(self):
|
||||
existing_requests = frappe.get_all(
|
||||
@@ -33,19 +45,19 @@ class LMSCertificateRequest(Document):
|
||||
)
|
||||
)
|
||||
|
||||
def validate_evaluation_date(self):
|
||||
def validate_evaluation_end_date(self):
|
||||
if self.batch_name:
|
||||
evaluation_end_date = frappe.db.get_value(
|
||||
"LMS Batch", self.batch_name, "evaluation_end_date"
|
||||
)
|
||||
|
||||
if evaluation_end_date:
|
||||
if getdate(self.date) > getdate(evaluation_end_date):
|
||||
frappe.throw(
|
||||
_("You cannot schedule evaluations after {0}.").format(
|
||||
format_date(evaluation_end_date, "medium")
|
||||
if evaluation_end_date:
|
||||
if getdate(self.date) > getdate(evaluation_end_date):
|
||||
frappe.throw(
|
||||
_("You cannot schedule evaluations after {0}.").format(
|
||||
format_date(evaluation_end_date, "medium")
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def schedule_evals():
|
||||
|
||||
@@ -81,4 +81,5 @@ lms.patches.v1_0.create_batch_source
|
||||
|
||||
[post_model_sync]
|
||||
lms.patches.v1_0.batch_tabs_settings
|
||||
execute:frappe.delete_doc("Notification", "Assignment Submission Notification")
|
||||
execute:frappe.delete_doc("Notification", "Assignment Submission Notification")
|
||||
lms.patches.v1_0.change_jobs_url #17-01-2024
|
||||
15
lms/patches/v1_0/change_jobs_url.py
Normal file
15
lms/patches/v1_0/change_jobs_url.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import frappe
|
||||
|
||||
|
||||
def execute():
|
||||
jobs_link = frappe.db.exists(
|
||||
"Top Bar Item",
|
||||
{
|
||||
"label": "Jobs",
|
||||
"url": "/jobs",
|
||||
"parent_label": "Explore",
|
||||
},
|
||||
)
|
||||
|
||||
if jobs_link:
|
||||
frappe.db.set_value("Top Bar Item", jobs_link, "url", "/job-openings")
|
||||
BIN
lms/public/images/lms-logo.png
Normal file
BIN
lms/public/images/lms-logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 43 KiB |
@@ -147,7 +147,7 @@
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="mt-auto mb-2">
|
||||
<div class="mb-2">
|
||||
<svg class="icon icon-sm">
|
||||
<use href="#icon-clock"></use>
|
||||
</svg>
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
<div class="job-cards-parent">
|
||||
{% for job in jobs %}
|
||||
<div class="common-card-style job-card">
|
||||
<span title="{{ job.company_name}}" style="background-image: url( {{ job.company_logo | urlencode }} );"
|
||||
{% set company_logo = job.company_logo.replace(' ', '%20') %}
|
||||
<span title="{{ job.company_name}}" style="background-image: url( {{ company_logo }} );"
|
||||
class="company-logo"></span>
|
||||
<div class="job-card-info">
|
||||
<div class="card-heading">{{ _(job.job_title) }}</div>
|
||||
@@ -37,7 +38,7 @@
|
||||
<div class="text-muted">{{ frappe.utils.format_date(job.creation, "medium") }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<a class="stretched-link" href="/jobs/{{ job.name }}"></a>
|
||||
<a class="stretched-link" href="/job-openings/{{ job.name }}"></a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
@@ -11,7 +11,8 @@
|
||||
<div class="common-card-style job-detail-card">
|
||||
|
||||
<div class="job-detail-header">
|
||||
<span title="{{ job.company_name}}" style="background-image: url( {{ job.company_logo | urlencode }} );"
|
||||
{% set company_logo = job.company_logo.replace(' ', '%20') %}
|
||||
<span title="{{ job.company_name}}" style="background-image: url( {{ company_logo }} );"
|
||||
class="company-logo"></span>
|
||||
|
||||
<div class="job-card-info">
|
||||
@@ -33,7 +34,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% set application_link = job.application_link if frappe.session.user != 'Guest' else '/login?redirect-to=/jobs/' + job.name %}
|
||||
{% set application_link = job.application_link if frappe.session.user != 'Guest' else '/login?redirect-to=/job-openings/' + job.name %}
|
||||
<div class="job-actions">
|
||||
<a class="btn btn-primary btn-sm mr-2" href="{{ application_link }}"> {{ _("Apply") }} </a>
|
||||
<div class="btn btn-default btn-sm mr-2" id="report" data-job="{{ job.name }}"> {{ _("Report") }} </div>
|
||||
@@ -94,7 +95,7 @@
|
||||
|
||||
{% macro BreadCrumb(job) %}
|
||||
<div class="breadcrumb">
|
||||
<a class="dark-links" href="/jobs">{{ _("Job Openings") }}</a>
|
||||
<a class="dark-links" href="/job-openings">{{ _("Job Openings") }}</a>
|
||||
<img class="ml-1 mr-1" src="/assets/lms/icons/chevron-right.svg">
|
||||
<span class="breadcrumb-destination">{{ job.job_title }}</span>
|
||||
</div>
|
||||
@@ -11,7 +11,7 @@ frappe.ready(() => {
|
||||
const open_report_dialog = (e) => {
|
||||
e.preventDefault();
|
||||
if (frappe.session.user == "Guest") {
|
||||
window.location.href = `/login?redirect-to=/jobs/${$(
|
||||
window.location.href = `/login?redirect-to=/job-openings/${$(
|
||||
e.currentTarget
|
||||
).data("job")}`;
|
||||
return;
|
||||
@@ -5,7 +5,7 @@ def get_context(context):
|
||||
try:
|
||||
job = frappe.form_dict["job"]
|
||||
except KeyError:
|
||||
frappe.local.flags.redirect_location = "/jobs"
|
||||
frappe.local.flags.redirect_location = "/job-openings"
|
||||
raise frappe.Redirect
|
||||
|
||||
context.job = frappe.get_doc("Job Opportunity", job)
|
||||
Reference in New Issue
Block a user