Merge pull request #376 from pateljannat/ux-fix
This commit is contained in:
@@ -21,7 +21,7 @@ app_license = "AGPL"
|
|||||||
# include js, css files in header of web template
|
# include js, css files in header of web template
|
||||||
web_include_css = "lms.bundle.css"
|
web_include_css = "lms.bundle.css"
|
||||||
# web_include_css = "/assets/lms/css/lms.css"
|
# web_include_css = "/assets/lms/css/lms.css"
|
||||||
web_include_js = "website.bundle.js"
|
web_include_js = ["website.bundle.js", "controls.bundle.js"]
|
||||||
|
|
||||||
# include custom scss in every website theme (without file extension ".scss")
|
# include custom scss in every website theme (without file extension ".scss")
|
||||||
# website_theme_scss = "lms/public/scss/website"
|
# website_theme_scss = "lms/public/scss/website"
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
"fieldtype": "Column Break"
|
"fieldtype": "Column Break"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"default": "Full Time",
|
||||||
"fieldname": "type",
|
"fieldname": "type",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"label": "Type",
|
"label": "Type",
|
||||||
@@ -115,7 +116,7 @@
|
|||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"make_attachments_public": 1,
|
"make_attachments_public": 1,
|
||||||
"modified": "2022-09-14 12:47:20.840223",
|
"modified": "2022-09-15 17:22:21.662675",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Job",
|
"module": "Job",
|
||||||
"name": "Job Opportunity",
|
"name": "Job Opportunity",
|
||||||
|
|||||||
@@ -9,10 +9,23 @@ from frappe.utils import get_link_to_form
|
|||||||
|
|
||||||
class JobOpportunity(Document):
|
class JobOpportunity(Document):
|
||||||
|
|
||||||
|
|
||||||
def validate(self):
|
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.company_website, True)
|
||||||
frappe.utils.validate_url(self.application_link, 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()
|
@frappe.whitelist()
|
||||||
def report(job, reason):
|
def report(job, reason):
|
||||||
system_managers = get_system_managers(only_name=True)
|
system_managers = get_system_managers(only_name=True)
|
||||||
|
|||||||
@@ -16,11 +16,11 @@
|
|||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"doctype": "Web Form",
|
"doctype": "Web Form",
|
||||||
"idx": 0,
|
"idx": 0,
|
||||||
"is_multi_step_form": 0,
|
|
||||||
"is_standard": 1,
|
"is_standard": 1,
|
||||||
|
"list_columns": [],
|
||||||
"login_required": 1,
|
"login_required": 1,
|
||||||
"max_attachment_size": 0,
|
"max_attachment_size": 0,
|
||||||
"modified": "2022-02-24 11:31:25.290524",
|
"modified": "2022-09-15 17:22:43.957184",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Job",
|
"module": "Job",
|
||||||
"name": "job-opportunity",
|
"name": "job-opportunity",
|
||||||
@@ -28,11 +28,9 @@
|
|||||||
"payment_button_label": "Buy Now",
|
"payment_button_label": "Buy Now",
|
||||||
"published": 1,
|
"published": 1,
|
||||||
"route": "job-opportunity",
|
"route": "job-opportunity",
|
||||||
"route_to_success_link": 1,
|
|
||||||
"show_attachments": 0,
|
"show_attachments": 0,
|
||||||
"show_in_grid": 0,
|
"show_list": 1,
|
||||||
"show_sidebar": 0,
|
"show_sidebar": 0,
|
||||||
"sidebar_items": [],
|
|
||||||
"success_message": "",
|
"success_message": "",
|
||||||
"success_url": "/jobs",
|
"success_url": "/jobs",
|
||||||
"title": "Job Opportunity",
|
"title": "Job Opportunity",
|
||||||
@@ -63,6 +61,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_read_on_all_link_options": 0,
|
"allow_read_on_all_link_options": 0,
|
||||||
|
"default": "Full Time",
|
||||||
"fieldname": "type",
|
"fieldname": "type",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
|
|||||||
@@ -1,18 +1,28 @@
|
|||||||
<div class="course-home-outline">
|
<div class="course-home-outline">
|
||||||
|
|
||||||
|
{% set chapters = get_chapters(course.name) %}
|
||||||
|
|
||||||
{% if course.edit_mode and course.name %}
|
{% if course.edit_mode and course.name %}
|
||||||
<button class="btn btn-md btn-secondary btn-chapter pull-right"> {{ _("New Chapter") }} </button>
|
<button class="btn btn-md btn-secondary btn-chapter pull-right"> {{ _("New Chapter") }} </button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if course.name and (course.edit_mode or get_chapters(course.name) | length) %}
|
{% if course.name and (course.edit_mode or chapters | length) %}
|
||||||
<div class="course-home-headings" id="outline-heading">
|
<div class="course-home-headings" id="outline-heading">
|
||||||
{{ _("Course Content") }}
|
{{ _("Course Content") }}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if get_chapters(course.name) | length %}
|
{% if course.edit_mode and course.name and not chapters | length %}
|
||||||
|
<div class="chapter-parent chapter-edit new-chapter">
|
||||||
|
<div contenteditable="true" data-placeholder="{{ _('Chapter Name') }}" class="chapter-title-main"></div>
|
||||||
|
<div class="chapter-description small my-2" contenteditable="true" data-placeholder="{{ _('Short Description') }}"></div>
|
||||||
|
<button class="btn btn-sm btn-secondary d-block btn-save-chapter" data-index="1"> {{ _('Save') }} </button>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% for chapter in get_chapters(course.name) %}
|
{% if chapters | length %}
|
||||||
|
|
||||||
|
{% for chapter in chapters %}
|
||||||
<div class="chapter-parent {% if course.edit_mode %} chapter-edit {% endif %} ">
|
<div class="chapter-parent {% if course.edit_mode %} chapter-edit {% endif %} ">
|
||||||
<div class="chapter-title" {% if not course.edit_mode %} data-toggle="collapse" aria-expanded="false"
|
<div class="chapter-title" {% if not course.edit_mode %} data-toggle="collapse" aria-expanded="false"
|
||||||
data-target="#{{ get_slugified_chapter_title(chapter.title) }}" {% endif %} >
|
data-target="#{{ get_slugified_chapter_title(chapter.title) }}" {% endif %} >
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ const scroll_to_chapter_container = () => {
|
|||||||
scrollTop: $(".new-chapter").offset().top
|
scrollTop: $(".new-chapter").offset().top
|
||||||
}, 1000);
|
}, 1000);
|
||||||
$(".new-chapter").find(".chapter-title-main").focus();
|
$(".new-chapter").find(".chapter-title-main").focus();
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
const save_chapter = (e) => {
|
const save_chapter = (e) => {
|
||||||
@@ -150,7 +150,7 @@ const save_chapter = (e) => {
|
|||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}, 1000)
|
}, 1000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -33,7 +33,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="lesson-pagination-parent">
|
<div class="lesson-pagination-parent">
|
||||||
{{ LessonContent(lesson) }}
|
{{ LessonContent(lesson) }}
|
||||||
{% if not lesson.edit_mode %} {{ Discussions() }} {% endif %}
|
{% if not lesson.edit_mode and course.staus == "Approved" and not course.upcoming %}
|
||||||
|
{{ Discussions() }}
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -498,8 +498,14 @@ const save_lesson = (e) => {
|
|||||||
"idx": $("#title").data("index"),
|
"idx": $("#title").data("index"),
|
||||||
"lesson": lesson ? lesson : ""
|
"lesson": lesson ? lesson : ""
|
||||||
},
|
},
|
||||||
callback: (data) => {
|
callback: (data) => {;
|
||||||
window.location.href = window.location.href.split("?")[0];
|
frappe.show_alert({
|
||||||
|
message: __("Saved"),
|
||||||
|
indicator: "green",
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
window.location.href = window.location.href.split("?")[0];
|
||||||
|
}, 1000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ def get_context(context):
|
|||||||
|
|
||||||
context.lesson = get_current_lesson_details(lesson_number, context)
|
context.lesson = get_current_lesson_details(lesson_number, context)
|
||||||
instructor = is_instructor(context.course.name)
|
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:
|
if not context.lesson:
|
||||||
context.lesson = frappe._dict()
|
context.lesson = frappe._dict()
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
frappe.ready(() => {
|
frappe.ready(() => {
|
||||||
|
|
||||||
|
if(!$(".quiz-card").length) {
|
||||||
|
add_question();
|
||||||
|
}
|
||||||
|
|
||||||
$(".btn-question").click((e) => {
|
$(".btn-question").click((e) => {
|
||||||
add_question(e);
|
add_question();
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".btn-save-question").click((e) => {
|
$(".btn-save-question").click((e) => {
|
||||||
@@ -17,9 +21,14 @@ 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 add_after = $(".quiz-card").length ? $(".quiz-card:last") : $("#quiz-title");
|
||||||
let question_template = `<div class="quiz-card">
|
let question_template = `<div class="quiz-card new-quiz-card">
|
||||||
<div contenteditable="true" data-placeholder="${__("Question")}" class="question mb-4"></div>
|
<div contenteditable="true" data-placeholder="${__("Question")}" class="question mb-4"></div>
|
||||||
</div>`;
|
</div>`;
|
||||||
$(question_template).insertAfter(add_after);
|
$(question_template).insertAfter(add_after);
|
||||||
@@ -109,3 +118,11 @@ const get_questions = () => {
|
|||||||
|
|
||||||
return 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();
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
{% block head_include %}
|
{% block head_include %}
|
||||||
{% include "public/icons/symbol-defs.svg" %}
|
{% include "public/icons/symbol-defs.svg" %}
|
||||||
<link rel="stylesheet" href="/assets/frappe/css/font-awesome.css">
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
@@ -22,7 +21,7 @@
|
|||||||
{{ Description(course) }}
|
{{ Description(course) }}
|
||||||
{{ Save(course) }}
|
{{ Save(course) }}
|
||||||
{{ widgets.CourseOutline(course=course, membership=membership, is_user_interested=is_user_interested) }}
|
{{ widgets.CourseOutline(course=course, membership=membership, is_user_interested=is_user_interested) }}
|
||||||
{% if not course.edit_mode %}
|
{% if not course.edit_mode and course.status == "Approved" and not frappe.utils.cint(course.upcoming) %}
|
||||||
{{ widgets.Reviews(course=course, membership=membership) }}
|
{{ widgets.Reviews(course=course, membership=membership) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
@@ -423,9 +422,3 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
|
|
||||||
{% block base_scripts %}
|
|
||||||
{{ include_script("frappe-web.bundle.js") }}
|
|
||||||
{{ include_script('controls.bundle.js') }}
|
|
||||||
{% endblock %}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user