Merge pull request #331 from pateljannat/cleanup

fix: UI Cleanup
This commit is contained in:
Jannat Patel
2022-05-04 17:53:31 +05:30
committed by GitHub
8 changed files with 37 additions and 68 deletions

View File

@@ -24,6 +24,7 @@
"fieldname": "chapter", "fieldname": "chapter",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
"in_standard_filter": 1,
"label": "Course Chapter", "label": "Course Chapter",
"options": "Course Chapter", "options": "Course Chapter",
"reqd": 1 "reqd": 1
@@ -75,6 +76,8 @@
"fetch_from": "chapter.course", "fetch_from": "chapter.course",
"fieldname": "course", "fieldname": "course",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Course", "label": "Course",
"options": "LMS Course", "options": "LMS Course",
"read_only": 1 "read_only": 1
@@ -82,7 +85,7 @@
], ],
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"links": [], "links": [],
"modified": "2022-04-22 12:59:23.641915", "modified": "2022-05-02 17:16:12.450460",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "LMS", "module": "LMS",
"name": "Course Lesson", "name": "Course Lesson",

View File

@@ -34,10 +34,11 @@
"related_courses", "related_courses",
"certification_section", "certification_section",
"enable_certification", "enable_certification",
"expiry",
"section_break_23",
"grant_certificate_after", "grant_certificate_after",
"evaluator", "evaluator",
"column_break_22", "column_break_26",
"expiry",
"max_attempts", "max_attempts",
"duration", "duration",
"pricing_section", "pricing_section",
@@ -177,10 +178,6 @@
"fieldtype": "Check", "fieldtype": "Check",
"label": "Paid Certificate" "label": "Paid Certificate"
}, },
{
"fieldname": "column_break_22",
"fieldtype": "Column Break"
},
{ {
"depends_on": "enable_certification", "depends_on": "enable_certification",
"fieldname": "grant_certificate_after", "fieldname": "grant_certificate_after",
@@ -228,6 +225,14 @@
"fieldtype": "Select", "fieldtype": "Select",
"label": "Duration for Attempts", "label": "Duration for Attempts",
"options": "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12" "options": "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12"
},
{
"fieldname": "section_break_23",
"fieldtype": "Section Break"
},
{
"fieldname": "column_break_26",
"fieldtype": "Column Break"
} }
], ],
"is_published_field": "published", "is_published_field": "published",
@@ -253,7 +258,7 @@
"link_fieldname": "course" "link_fieldname": "course"
} }
], ],
"modified": "2022-04-28 16:15:10.047183", "modified": "2022-05-04 11:03:24.001015",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "LMS", "module": "LMS",
"name": "LMS Course", "name": "LMS Course",

View File

@@ -30,7 +30,7 @@
<a class="lesson-links" href="{{ get_lesson_url(course.name, lesson.number) }}{{course.query_parameter}}" <a class="lesson-links" href="{{ get_lesson_url(course.name, lesson.number) }}{{course.query_parameter}}"
data-course="{{ course.name }}"> data-course="{{ course.name }}">
<svg class="icon icon-md mr-2"> <svg class="icon icon-md mr-2">
<use class="" href="#{{ lesson.icon }}{% if active %}-blue{% endif %}"> <use class="" href="#{{ lesson.icon }}">
</svg> </svg>
{{ lesson.title }} {{ lesson.title }}
@@ -148,8 +148,6 @@ const expand_the_active_chapter = () => {
}) })
selector.addClass("active-lesson"); selector.addClass("active-lesson");
let href = selector.find("use").attr("href");
!href.endsWith("blue") && selector.find("use").attr("href", `${href}-blue`);
show_section(selector.parent().parent()); show_section(selector.parent().parent());
} }

View File

@@ -275,11 +275,7 @@ input[type=checkbox] {
} }
.course-card-wide { .course-card-wide {
background-color: white;
padding: 0 1.25rem 1.25rem;
border-radius: var(--border-radius);
width: 50%; width: 50%;
box-shadow: var(--shadow-base);
font-size: var(--text-base); font-size: var(--text-base);
} }
@@ -393,7 +389,7 @@ input[type=checkbox] {
} }
.course-content-parent .chapter-description { .course-content-parent .chapter-description {
font-size: 0.7rem; font-size: 0.75rem;
} }
.chapter-icon { .chapter-icon {
@@ -611,7 +607,7 @@ input[type=checkbox] {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin: 24px 0px 0px; margin: 2rem 0 4rem;
} }
.lesson-pagination-parent { .lesson-pagination-parent {
@@ -629,9 +625,8 @@ input[type=checkbox] {
} }
.active-lesson { .active-lesson {
background-color: var(--blue-100); background-color: var(--gray-200);
border-radius: var(--border-radius-md); border-radius: var(--border-radius-md);
color: var(--blue-500);
} }
.lesson-title { .lesson-title {
@@ -854,7 +849,7 @@ pre {
.certificate-price { .certificate-price {
font-weight: bold; font-weight: bold;
margin-bottom: 0.5rem; margin-bottom: 1rem;
} }
.certificate-ribbon { .certificate-ribbon {
@@ -1119,7 +1114,7 @@ pre {
.job-card { .job-card {
display: flex; display: flex;
position: relative; align-items: center;
} }
.company-logo { .company-logo {
@@ -1158,10 +1153,12 @@ pre {
.job-card-heading { .job-card-heading {
font-weight: 600; font-weight: 600;
color: var(--gray-900); color: var(--gray-900);
margin-bottom: 0.4rem;
} }
.course-head-container { .course-head-container {
color: var(--gray-900); color: var(--gray-900);
background-color: var(--gray-200);
} }
.seperator { .seperator {
@@ -1178,8 +1175,8 @@ pre {
box-shadow: var(--shadow-sm); box-shadow: var(--shadow-sm);
overflow: auto; overflow: auto;
width: fit-content; width: fit-content;
position: fixed; position: absolute;
top: 50%; top: 10%;
right: 7%; right: 7%;
max-width: 400px; max-width: 400px;
z-index: 4; z-index: 4;
@@ -1196,10 +1193,6 @@ pre {
} }
} }
.video-in-overlay {
top: 40%;
}
.course-overlay-content { .course-overlay-content {
padding: 1.25rem; padding: 1.25rem;
font-size: var(--text-base); font-size: var(--text-base);

View File

@@ -27,12 +27,7 @@
{% endblock %} {% endblock %}
{% macro CourseHomeHeader(course) %} {% macro CourseHomeHeader(course) %}
<div class="course-head-container" <div class="course-head-container">
style=" {% if course.image %}
background-position: center;
background-size: cover;
background-image: url({{ course.image }});
{% else %} background-color: var(--gray-200) {% endif %}">
<div class="container pt-5 pb-5"> <div class="container pt-5 pb-5">
<div class="course-card-wide" style=""> <div class="course-card-wide" style="">
{{ BreadCrumb(course) }} {{ BreadCrumb(course) }}
@@ -92,7 +87,7 @@
{% endmacro%} {% endmacro%}
{% macro CourseHeaderOverlay(course) %} {% macro CourseHeaderOverlay(course) %}
<div class="course-overlay-card {% if course.video_link %} video-in-overlay {% endif %}"> <div class="course-overlay-card">
{% if course.video_link %} {% if course.video_link %}
<iframe class="preview-video" src="{{ course.video_link }}"></iframe> <iframe class="preview-video" src="{{ course.video_link }}"></iframe>
@@ -201,19 +196,18 @@
{{ _("Continue Learning") }} <img class="ml-2" src="/assets/lms/icons/white-arrow.svg" /> {{ _("Continue Learning") }} <img class="ml-2" src="/assets/lms/icons/white-arrow.svg" />
</a> </a>
{% endif %} {% endif %}
{% set progress = frappe.utils.cint(membership.progress) %} {% set progress = frappe.utils.cint(membership.progress) %}
{% if membership and course.enable_certification %} {% if membership and course.enable_certification %}
{% if certificate %} {% if certificate %}
<a class="button wide-button is-secondary mt-2" href="/courses/{{ course.name }}/{{ certificate }}"> <a class="button wide-button is-secondary mt-3" href="/courses/{{ course.name }}/{{ certificate }}">
{{ _("Get Certificate") }} {{ _("Get Certificate") }}
</a> </a>
{% elif eligible %} {% elif eligible_for_evaluation %}
<a class="button wide-button is-secondary mt-2" id="apply-certificate" data-course="{{ course.name }}"> <a class="button wide-button is-secondary mt-3" id="apply-certificate" data-course="{{ course.name }}">
{{ _("Apply for Certificate") }} {{ _("Apply for Certificate") }}
</a> </a>
{% elif course.grant_certificate_after == "Completion" and progress == 100 %} {% elif course.grant_certificate_after == "Completion" and progress == 100 %}
<div class="button wide-button is-secondary mt-4" id="certification" data-course="{{ course.name }}"> <div class="button wide-button is-secondary mt-3" id="certification" data-course="{{ course.name }}">
{{ _("Get Certificate") }} {{ _("Get Certificate") }}
</div> </div>
{% endif %} {% endif %}

View File

@@ -50,12 +50,6 @@ frappe.ready(() => {
select_slot(e); select_slot(e);
}); });
$(document).scroll(function() {
let timer;
clearTimeout(timer);
timer = setTimeout(() => { handle_overlay_display.apply(this, arguments); }, 500);
});
}); });
var hide_wrapped_mentor_cards = () => { var hide_wrapped_mentor_cards = () => {
@@ -127,8 +121,8 @@ var submit_review = (e) => {
e.preventDefault(); e.preventDefault();
var rating = $(".rating-field").children(".star-click").length; var rating = $(".rating-field").children(".star-click").length;
var review = $(".review-field").val(); var review = $(".review-field").val();
if (!review || !rating) { if (!rating) {
$(".error-field").text("Both Rating and Review are required."); $(".error-field").text("Please provide a rating.");
return; return;
} }
frappe.call({ frappe.call({
@@ -166,24 +160,6 @@ const element_not_in_viewport = (el) => {
return rect.bottom < 0 || rect.right < 0 || rect.left > window.innerWidth || rect.top > window.innerHeight; return rect.bottom < 0 || rect.right < 0 || rect.left > window.innerWidth || rect.top > window.innerHeight;
}; };
const handle_overlay_display = () => {
const element = $(".related-courses").length && $(".related-courses")[0];
if (element && element_not_in_viewport(element)) {
$(".course-overlay-card").css({
"position": "fixed",
"top": "30%",
"bottom": "inherit"
});
}
else if (element && !element_not_in_viewport(element)) {
$(".course-overlay-card").css({
"position": "absolute",
"top": "inherit",
"bottom": "5%"
});
}
};
const submit_for_review = (e) => { const submit_for_review = (e) => {
let course = $(e.currentTarget).data("course"); let course = $(e.currentTarget).data("course");
frappe.call({ frappe.call({

View File

@@ -26,7 +26,7 @@
<div class="job-card-info"> <div class="job-card-info">
<div class="job-card-heading">{{ _(job.job_title) }}</div> <div class="job-card-heading">{{ _(job.job_title) }}</div>
<div class="vertically-center course-meta"> <div class="vertically-center course-meta">
<div class="mr-3">{{ job.company_name }}</div> <div class="mr-5">{{ job.company_name }}</div>
<div class="vertically-center"> <div class="vertically-center">
<svg class="icon icon-sm"> <svg class="icon icon-sm">
<use class="" href="#icon-location"> <use class="" href="#icon-location">
@@ -38,7 +38,7 @@
<div class="job-card-logo-section course-meta"> <div class="job-card-logo-section course-meta">
<div class="indicator-pill green ml-3"> {{ job.type }} </div> <div class="indicator-pill green ml-3"> {{ job.type }} </div>
<div class="">{{ frappe.utils.format_date(job.creation, "medium") }}</div> <div class="mt-2 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="/jobs/{{ job.name }}"></a>
</div> </div>

View File

@@ -22,7 +22,7 @@
<div class="course-home-headings mb-0">{{ _(job.job_title) }}</div> <div class="course-home-headings mb-0">{{ _(job.job_title) }}</div>
<div class="indicator-pill green ml-5"> {{ job.type }} </div> <div class="indicator-pill green ml-5"> {{ job.type }} </div>
</div> </div>
<div class="d-flex align-items-center mb-2"> <div class="d-flex align-items-center mt-2">
<a class="dark-links course-meta mr-5" href="{{ job.company_website }}">{{ job.company_name }}</a> <a class="dark-links course-meta mr-5" href="{{ job.company_website }}">{{ job.company_name }}</a>
<div class="vertically-center course-meta mr-5"> <div class="vertically-center course-meta mr-5">
<svg class="icon icon-sm"> <svg class="icon icon-sm">