From 5d6dc16a19a80a6d3cd3e0160f7d9cf0d92e378c Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Fri, 12 Aug 2022 12:34:04 +0530 Subject: [PATCH] fix: create course button and search bar width --- lms/public/css/style.css | 45 ++++++++++++++++++++++++++++++++++--- lms/www/batch/learn.html | 4 ++-- lms/www/batch/learn.js | 4 ++++ lms/www/courses/course.html | 2 +- lms/www/courses/index.html | 10 ++++++--- 5 files changed, 56 insertions(+), 9 deletions(-) diff --git a/lms/public/css/style.css b/lms/public/css/style.css index f57d2416..6831e71a 100644 --- a/lms/public/css/style.css +++ b/lms/public/css/style.css @@ -935,11 +935,49 @@ pre { background-repeat: no-repeat; text-indent: 1.5rem; background-position: 1rem 0.7rem; - float: right; - width: 25%; + width: 30%; box-shadow: var(--shadow-sm); } +.course-search-header { + float: right; + width: 80%; + display: flex; + justify-content: end; + align-items: center; +} + +@media (max-width: 1250px) { + .search { + width: 40%; + } +} + +@media (max-width: 1000px) { + .search { + width: 55%; + } + + .course-search-header { + width: 75%; + } +} + +@media (max-width: 650px) { + .course-search-header { + width: 60%; + } +} + +@media (max-width: 550px) { + .course-search-header { + float: none; + width: 100%; + justify-content: space-between; + margin-bottom: 1rem; + } +} + .section-heading { font-size: var(--text-4xl); } @@ -1069,6 +1107,7 @@ pre { .live-courses .course-home-headings { margin-bottom: 1.5rem; + width: fit-content; } @media (min-width: 768px) { @@ -1515,7 +1554,7 @@ li { } .course-image-attachment { - margin-top: 1rem; + margin-top: 0.25rem; background-color: var(--bg-light-gray); border-radius: var(--border-radius); border: 1px dashed var(--gray-400); diff --git a/lms/www/batch/learn.html b/lms/www/batch/learn.html index f8d3fc25..95e1dc74 100644 --- a/lms/www/batch/learn.html +++ b/lms/www/batch/learn.html @@ -180,8 +180,8 @@
- {{ _("Back to Lesson") }} - + +
diff --git a/lms/www/batch/learn.js b/lms/www/batch/learn.js index cb97a2ee..a6227e2f 100644 --- a/lms/www/batch/learn.js +++ b/lms/www/batch/learn.js @@ -64,6 +64,10 @@ frappe.ready(() => { window.location.href = `${window.location.href}?edit=1`; }); + $(".btn-back").click((e) => { + window.location.href = window.location.href.split("?")[0]; + }) + $(document).on("click", ".copy-link", (e) => { frappe.utils.copy_to_clipboard($(e.currentTarget).data("link")); $(".attachments").collapse("hide"); diff --git a/lms/www/courses/course.html b/lms/www/courses/course.html index 4380f12a..1e5f9e2a 100644 --- a/lms/www/courses/course.html +++ b/lms/www/courses/course.html @@ -91,7 +91,7 @@
{% if not course.image %} - {{ _("Attach Image") }} + {{ _("Attach Image") }} {% endif %} {% endif %} diff --git a/lms/www/courses/index.html b/lms/www/courses/index.html index aa830f96..03c49fec 100644 --- a/lms/www/courses/index.html +++ b/lms/www/courses/index.html @@ -16,15 +16,19 @@ {% else %} - {% include "lms/templates/search_course/search_course.html" %} +
+ {% include "lms/templates/search_course/search_course.html" %} + {{ _("Create a Course") }} +
+
{% set courses = live_courses %} - {% set title = _("All Live Courses ({0})").format(courses | length) %} + {% set title = _("Live Courses ({0})").format(courses | length) %} {% set classes = "live-courses" %} {% include "lms/templates/course_list.html" %} {% set courses = upcoming_courses %} - {% set title = _("All Upcoming Courses ({0})").format(courses | length) %} + {% set title = _("Upcoming Courses ({0})").format(courses | length) %} {% set classes = "upcoming-courses mt-10" %} {% include "lms/templates/course_list.html" %}