diff --git a/lms/job/doctype/job_opportunity/job_opportunity.json b/lms/job/doctype/job_opportunity/job_opportunity.json
index b1684238..7ac25e65 100644
--- a/lms/job/doctype/job_opportunity/job_opportunity.json
+++ b/lms/job/doctype/job_opportunity/job_opportunity.json
@@ -45,6 +45,7 @@
"fieldtype": "Column Break"
},
{
+ "default": "Full Time",
"fieldname": "type",
"fieldtype": "Select",
"label": "Type",
@@ -115,7 +116,7 @@
"index_web_pages_for_search": 1,
"links": [],
"make_attachments_public": 1,
- "modified": "2022-09-14 12:47:20.840223",
+ "modified": "2022-09-15 17:22:21.662675",
"modified_by": "Administrator",
"module": "Job",
"name": "Job Opportunity",
diff --git a/lms/job/doctype/job_opportunity/job_opportunity.py b/lms/job/doctype/job_opportunity/job_opportunity.py
index fc4ebc75..fbb648e6 100644
--- a/lms/job/doctype/job_opportunity/job_opportunity.py
+++ b/lms/job/doctype/job_opportunity/job_opportunity.py
@@ -9,10 +9,23 @@ from frappe.utils import get_link_to_form
class JobOpportunity(Document):
+
def validate(self):
+ self.validate_urls()
+ self.validate_logo()
+
+
+ def validate_urls(self):
frappe.utils.validate_url(self.company_website, True)
frappe.utils.validate_url(self.application_link, True)
+
+ def validate_logo(self):
+ if "/private" in self.company_logo:
+ frappe.db.set_value("File", {"file_url": self.company_logo}, "is_private", 0)
+ frappe.db.set_value("File", {"file_url": self.company_logo}, "file_url", self.company_logo.replace("/private", ""))
+ self.company_logo = self.company_logo.replace("/private", "")
+
@frappe.whitelist()
def report(job, reason):
system_managers = get_system_managers(only_name=True)
diff --git a/lms/job/web_form/job_opportunity/job_opportunity.json b/lms/job/web_form/job_opportunity/job_opportunity.json
index a8f1e611..f54dc557 100644
--- a/lms/job/web_form/job_opportunity/job_opportunity.json
+++ b/lms/job/web_form/job_opportunity/job_opportunity.json
@@ -16,11 +16,11 @@
"docstatus": 0,
"doctype": "Web Form",
"idx": 0,
- "is_multi_step_form": 0,
"is_standard": 1,
+ "list_columns": [],
"login_required": 1,
"max_attachment_size": 0,
- "modified": "2022-02-24 11:31:25.290524",
+ "modified": "2022-09-15 17:22:43.957184",
"modified_by": "Administrator",
"module": "Job",
"name": "job-opportunity",
@@ -28,11 +28,9 @@
"payment_button_label": "Buy Now",
"published": 1,
"route": "job-opportunity",
- "route_to_success_link": 1,
"show_attachments": 0,
- "show_in_grid": 0,
+ "show_list": 1,
"show_sidebar": 0,
- "sidebar_items": [],
"success_message": "",
"success_url": "/jobs",
"title": "Job Opportunity",
@@ -63,6 +61,7 @@
},
{
"allow_read_on_all_link_options": 0,
+ "default": "Full Time",
"fieldname": "type",
"fieldtype": "Select",
"hidden": 0,
diff --git a/lms/lms/widgets/CourseOutline.html b/lms/lms/widgets/CourseOutline.html
index 2aec5324..41c22908 100644
--- a/lms/lms/widgets/CourseOutline.html
+++ b/lms/lms/widgets/CourseOutline.html
@@ -1,18 +1,28 @@
+ {% set chapters = get_chapters(course.name) %}
+
{% if course.edit_mode and course.name %}
{{ _("New Chapter") }}
{% endif %}
- {% if course.name and (course.edit_mode or get_chapters(course.name) | length) %}
+ {% if course.name and (course.edit_mode or chapters | length) %}
{{ _("Course Content") }}
{% endif %}
- {% if get_chapters(course.name) | length %}
+ {% if course.edit_mode and course.name and not chapters | length %}
+
+ {% endif %}
- {% for chapter in get_chapters(course.name) %}
+ {% if chapters | length %}
+
+ {% for chapter in chapters %}
diff --git a/lms/public/js/common_functions.js b/lms/public/js/common_functions.js
index 17ace20d..ccdf3632 100644
--- a/lms/public/js/common_functions.js
+++ b/lms/public/js/common_functions.js
@@ -127,7 +127,7 @@ const scroll_to_chapter_container = () => {
scrollTop: $(".new-chapter").offset().top
}, 1000);
$(".new-chapter").find(".chapter-title-main").focus();
-}
+};
const save_chapter = (e) => {
@@ -150,7 +150,7 @@ const save_chapter = (e) => {
});
setTimeout(() => {
window.location.reload();
- }, 1000)
+ }, 1000);
}
});
};
diff --git a/lms/www/batch/learn.html b/lms/www/batch/learn.html
index 629e4ca0..6c5eb03c 100644
--- a/lms/www/batch/learn.html
+++ b/lms/www/batch/learn.html
@@ -33,7 +33,9 @@
diff --git a/lms/www/batch/learn.js b/lms/www/batch/learn.js
index 620c2b53..435ff01c 100644
--- a/lms/www/batch/learn.js
+++ b/lms/www/batch/learn.js
@@ -498,8 +498,14 @@ const save_lesson = (e) => {
"idx": $("#title").data("index"),
"lesson": lesson ? lesson : ""
},
- callback: (data) => {
- window.location.href = window.location.href.split("?")[0];
+ callback: (data) => {;
+ frappe.show_alert({
+ message: __("Saved"),
+ indicator: "green",
+ });
+ setTimeout(() => {
+ window.location.href = window.location.href.split("?")[0];
+ }, 1000);
}
});
};
diff --git a/lms/www/batch/learn.py b/lms/www/batch/learn.py
index fd8066fe..a1674156 100644
--- a/lms/www/batch/learn.py
+++ b/lms/www/batch/learn.py
@@ -24,7 +24,7 @@ def get_context(context):
context.lesson = get_current_lesson_details(lesson_number, context)
instructor = is_instructor(context.course.name)
- context.show_lesson = context.membership or context.lesson.include_in_preview or instructor or has_course_moderator_role()
+ context.show_lesson = context.membership or (context.lesson and context.lesson.include_in_preview) or instructor or has_course_moderator_role()
if not context.lesson:
context.lesson = frappe._dict()
diff --git a/lms/www/batch/quiz.html b/lms/www/batch/quiz.html
index 26a2ca7f..53f8cb0a 100644
--- a/lms/www/batch/quiz.html
+++ b/lms/www/batch/quiz.html
@@ -40,7 +40,7 @@
{% for question in quiz.questions %}
{% if question.question %} {{ question.question }} {% endif %}
+ class="question mb-4 req">{% if question.question %} {{ question.question }} {% endif %}
{% for i in range(1,5) %}
{% set num = frappe.utils.cstr(i) %}
diff --git a/lms/www/batch/quiz.js b/lms/www/batch/quiz.js
index a7491fed..f114e2c6 100644
--- a/lms/www/batch/quiz.js
+++ b/lms/www/batch/quiz.js
@@ -1,7 +1,11 @@
frappe.ready(() => {
+ if(!$(".quiz-card").length) {
+ add_question();
+ }
+
$(".btn-question").click((e) => {
- add_question(e);
+ add_question();
});
$(".btn-save-question").click((e) => {
@@ -17,10 +21,15 @@ frappe.ready(() => {
});
-const add_question = (e) => {
+const add_question = () => {
+ if ($(".new-quiz-card").length) {
+ scroll_to_question_container();
+ return;
+ }
+
let add_after = $(".quiz-card").length ? $(".quiz-card:last") : $("#quiz-title");
- let question_template = `
-
+ let question_template = `
`;
$(question_template).insertAfter(add_after);
get_question_template();
@@ -109,3 +118,11 @@ const get_questions = () => {
return questions;
};
+
+
+const scroll_to_question_container = () => {
+ $([document.documentElement, document.body]).animate({
+ scrollTop: $(".new-quiz-card").offset().top
+ }, 1000);
+ $(".new-quiz-card").find(".question").focus();
+}
diff --git a/lms/www/courses/course.html b/lms/www/courses/course.html
index e4c24cc4..163e1c5e 100644
--- a/lms/www/courses/course.html
+++ b/lms/www/courses/course.html
@@ -22,7 +22,7 @@
{{ Description(course) }}
{{ Save(course) }}
{{ widgets.CourseOutline(course=course, membership=membership, is_user_interested=is_user_interested) }}
- {% if not course.edit_mode %}
+ {% if not course.edit_mode and course.staus == "Approved" and not course.upcoming %}
{{ widgets.Reviews(course=course, membership=membership) }}
{% endif %}