Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/frappe/lms
Browse files Browse the repository at this point in the history
  • Loading branch information
pateljannat committed Jan 17, 2024
2 parents a5fc52e + a9b0657 commit 43d409c
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 12 deletions.
3 changes: 2 additions & 1 deletion lms/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@
"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",
Expand Down
2 changes: 1 addition & 1 deletion lms/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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},
]

Expand Down
2 changes: 1 addition & 1 deletion lms/job/doctype/job_opportunity/job_opportunity.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
},
});
2 changes: 1 addition & 1 deletion lms/job/web_form/job_opportunity/job_opportunity.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
frappe.ready(function () {
frappe.web_form.after_save = () => {
setTimeout(() => {
window.location.href = `/jobs`;
window.location.href = `/job-openings`;
});
};
});
4 changes: 2 additions & 2 deletions lms/job/web_form/job_opportunity/job_opportunity.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": [
{
Expand Down
3 changes: 2 additions & 1 deletion lms/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 15 additions & 0 deletions lms/patches/v1_0/change_jobs_url.py
Original file line number Diff line number Diff line change
@@ -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")
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,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>
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions lms/www/jobs/job.html → lms/www/jobs_openings/job.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,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>
Expand Down Expand Up @@ -94,7 +94,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>
Expand Down
2 changes: 1 addition & 1 deletion lms/www/jobs/job.js → lms/www/jobs_openings/job.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lms/www/jobs/job.py → lms/www/jobs_openings/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 43d409c

Please sign in to comment.