feat: dashboard web templates
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
{% set member = frappe.get_doc("User", frappe.session.user) %}
|
||||
<div class="mt-10">
|
||||
{% set enrolled = member.get_enrolled_courses().in_progress + member.get_enrolled_courses().completed %}
|
||||
{% if enrolled | length %}
|
||||
<div class="mt-8">
|
||||
<div class="course-home-headings">
|
||||
{{ _("Courses Enrolled") }}
|
||||
</div>
|
||||
<div class="cards-parent">
|
||||
{% for course in enrolled %}
|
||||
{{ widgets.CourseCard(course=course) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="common-card-style thread-card">
|
||||
<div class="w-25 text-center" style="margin: 0 auto;">
|
||||
<span class="font-weight-bold"> No Enrolled Courses </span>
|
||||
<div class="small">
|
||||
You have not enrolled in any course yet.
|
||||
</div>
|
||||
<span class="button is-primary ml-auto mr-auto mt-3">
|
||||
Explore Courses
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"__unsaved": 1,
|
||||
"creation": "2021-10-21 11:29:50.424865",
|
||||
"docstatus": 0,
|
||||
"doctype": "Web Template",
|
||||
"fields": [],
|
||||
"idx": 0,
|
||||
"modified": "2021-10-21 12:02:23.837501",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "Courses Enrolled",
|
||||
"owner": "Administrator",
|
||||
"standard": 1,
|
||||
"template": "",
|
||||
"type": "Section"
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{% set member = frappe.get_doc("User", frappe.session.user) %}
|
||||
<div class="mt-10">
|
||||
{% if member.get_mentored_courses() | length %}
|
||||
<div class="course-home-headings"> {{ _("Courses Mentored") }} </div>
|
||||
<div class="cards-parent">
|
||||
{% for course in member.get_mentored_courses() %}
|
||||
{{ widgets.CourseCard(course=course) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"__unsaved": 1,
|
||||
"creation": "2021-10-21 11:32:57.411626",
|
||||
"docstatus": 0,
|
||||
"doctype": "Web Template",
|
||||
"fields": [],
|
||||
"idx": 0,
|
||||
"modified": "2021-10-21 12:01:56.270656",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "Courses Mentored",
|
||||
"owner": "Administrator",
|
||||
"standard": 1,
|
||||
"template": "",
|
||||
"type": "Section"
|
||||
}
|
||||
@@ -2,17 +2,19 @@
|
||||
{% set progress = frappe.utils.cint(membership.progress) %}
|
||||
<div class="common-card-style course-card">
|
||||
|
||||
<div class="course-image {% if not course.image %}default-image{% endif %}"
|
||||
{% if course.image %} style="background-image: url( {{ course.image }} );" {% endif %}>
|
||||
<div class="course-image {% if not course.image %}default-image{% endif %}" {% if course.image %}
|
||||
style="background-image: url( {{ course.image }} );" {% endif %}>
|
||||
<div class="course-tags">
|
||||
{% for tag in course.get_tags() %}
|
||||
<div class="course-card-pills">{{ tag }}</div>
|
||||
{% endfor %}
|
||||
{% if membership and not read_only %}
|
||||
{% if progress < 100 %}
|
||||
<div class="course-card-pills dark-pills ml-auto">{{ frappe.utils.rounded(progress) }}% {{ _("Completed") }}</div>
|
||||
{% if progress < 100 %} <div class="course-card-pills dark-pills ml-auto">{{ frappe.utils.rounded(progress) }}%
|
||||
{{ _("Completed") }}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="course-card-pills dark-pills ml-auto"> <img src="/assets/community/icons/check.svg"> {{ _("Completed") }}</div>
|
||||
<div class="course-card-pills dark-pills ml-auto"> <img src="/assets/community/icons/check.svg"> {{ _("Completed")
|
||||
}}</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -123,7 +123,8 @@ class CustomUser(User):
|
||||
|
||||
for map in mapping:
|
||||
if frappe.db.get_value("LMS Course", map.course, "is_published"):
|
||||
mentored_courses.append(map)
|
||||
course = frappe.get_doc("LMS Course", map.course)
|
||||
mentored_courses.append(course)
|
||||
|
||||
return mentored_courses
|
||||
|
||||
|
||||
@@ -739,7 +739,6 @@ input[type=checkbox] {
|
||||
letter-spacing: -0.0175em;
|
||||
color: #192734;
|
||||
margin-bottom: 1rem;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
|
||||
.course-detail-headings {
|
||||
|
||||
@@ -130,9 +130,8 @@
|
||||
Courses Mentored
|
||||
</div>
|
||||
<div class="cards-parent">
|
||||
{% for mentorship in member.get_mentored_courses() %}
|
||||
{% set course_details = frappe.get_doc("LMS Course", mentorship.course) %}
|
||||
{{ widgets.CourseCard(course=course_details, read_only=read_only) }}
|
||||
{% for course in member.get_mentored_courses() %}
|
||||
{{ widgets.CourseCard(course=course, read_only=read_only) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user