fix: ui issues
This commit is contained in:
@@ -148,10 +148,11 @@ const rotate_chapter_icon = (e) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const show_no_preview_dialog = (e) => {
|
const show_no_preview_dialog = (e) => {
|
||||||
frappe.warn(__("Not available for preview"),
|
const d = frappe.warn(__("Not available for preview"),
|
||||||
__("This lesson is not available for preview. Please join the course to access it."),
|
__("This lesson is not available for preview. Please join the course to access it."),
|
||||||
() => {
|
() => {
|
||||||
window.location.href = `/courses/${ $(e.currentTarget).data("course") }`
|
const route = `/courses/${ $(e.currentTarget).data("course") }`;
|
||||||
|
window.location.pathname == route ? d.hide() : window.location.href = route;
|
||||||
},
|
},
|
||||||
__("Start Learning"), false);
|
__("Start Learning"), false);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -401,7 +401,7 @@ input[type=checkbox] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.reviews-parent {
|
.reviews-parent {
|
||||||
margin: 5rem 0;
|
padding-bottom: 5rem;
|
||||||
color: var(--gray-900);
|
color: var(--gray-900);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -143,8 +143,8 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="vertically-center mb-4">
|
|
||||||
{% if is_instructor(course.name) %}
|
{% if is_instructor(course.name) %}
|
||||||
|
<div class="vertically-center mb-4">
|
||||||
<a class="button is-default button-links mr-2" href="/course?name={{ course.name }}"> {{ _("Edit") }} </a>
|
<a class="button is-default button-links mr-2" href="/course?name={{ course.name }}"> {{ _("Edit") }} </a>
|
||||||
<a class="button is-default button-links mr-2" href="/chapter">
|
<a class="button is-default button-links mr-2" href="/chapter">
|
||||||
<svg class="icon icon-sm mr-1"><use href="#icon-add"></use></svg>
|
<svg class="icon icon-sm mr-1"><use href="#icon-add"></use></svg>
|
||||||
@@ -154,8 +154,8 @@
|
|||||||
<svg class="icon icon-sm mr-1"><use href="#icon-add"></use></svg>
|
<svg class="icon icon-sm mr-1"><use href="#icon-add"></use></svg>
|
||||||
{{ _("Add Lesson") }}
|
{{ _("Add Lesson") }}
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div class="vertically-center mb-2">
|
<div class="vertically-center mb-2">
|
||||||
<div class="">
|
<div class="">
|
||||||
|
|||||||
@@ -1,14 +1,7 @@
|
|||||||
frappe.ready(() => {
|
frappe.ready(() => {
|
||||||
if (frappe.session.user != "Guest") {
|
|
||||||
check_mentor_request();
|
|
||||||
}
|
|
||||||
|
|
||||||
hide_wrapped_mentor_cards();
|
hide_wrapped_mentor_cards();
|
||||||
|
|
||||||
$("#apply-now").click((e) => {
|
|
||||||
create_mentor_request(e);
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#cancel-request").click((e) => {
|
$("#cancel-request").click((e) => {
|
||||||
cancel_mentor_request(e);
|
cancel_mentor_request(e);
|
||||||
});
|
});
|
||||||
@@ -53,21 +46,6 @@ frappe.ready(() => {
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
var check_mentor_request = () => {
|
|
||||||
frappe.call({
|
|
||||||
'method': 'lms.lms.doctype.lms_mentor_request.lms_mentor_request.has_requested',
|
|
||||||
'args': {
|
|
||||||
course: decodeURIComponent($("#course-title").attr("data-course")),
|
|
||||||
},
|
|
||||||
'callback': (data) => {
|
|
||||||
if (data.message > 0) {
|
|
||||||
$("#mentor-request").addClass("hide");
|
|
||||||
$("#already-applied").removeClass("hide")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
var hide_wrapped_mentor_cards = () => {
|
var hide_wrapped_mentor_cards = () => {
|
||||||
var offset_top_prev;
|
var offset_top_prev;
|
||||||
|
|
||||||
@@ -87,26 +65,6 @@ var hide_wrapped_mentor_cards = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var create_mentor_request = (e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
if (frappe.session.user == "Guest") {
|
|
||||||
window.location.href = `/login?redirect-to=/courses/${$(e.currentTarget).attr("data-course")}`;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
frappe.call({
|
|
||||||
"method": "lms.lms.doctype.lms_mentor_request.lms_mentor_request.create_request",
|
|
||||||
"args": {
|
|
||||||
"course": decodeURIComponent($(e.currentTarget).attr("data-course"))
|
|
||||||
},
|
|
||||||
"callback": (data) => {
|
|
||||||
if (data.message == "OK") {
|
|
||||||
$("#mentor-request").addClass("hide");
|
|
||||||
$("#already-applied").removeClass("hide")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
var cancel_mentor_request = (e) => {
|
var cancel_mentor_request = (e) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
frappe.call({
|
frappe.call({
|
||||||
|
|||||||
Reference in New Issue
Block a user