Merge pull request #244 from pateljannat/dashboard
This commit is contained in:
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -6,7 +6,7 @@ on:
|
|||||||
pull_request: {}
|
pull_request: {}
|
||||||
jobs:
|
jobs:
|
||||||
tests:
|
tests:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
services:
|
services:
|
||||||
redis-cache:
|
redis-cache:
|
||||||
image: redis:alpine
|
image: redis:alpine
|
||||||
@@ -32,7 +32,7 @@ jobs:
|
|||||||
- name: setup python
|
- name: setup python
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: 3.9
|
python-version: '3.9'
|
||||||
- name: setup node
|
- name: setup node
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -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>
|
||||||
|
<a class="button is-primary ml-auto mr-auto mt-3" href="/courses">
|
||||||
|
Explore Courses
|
||||||
|
</a>
|
||||||
|
</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) %}
|
{% set progress = frappe.utils.cint(membership.progress) %}
|
||||||
<div class="common-card-style course-card">
|
<div class="common-card-style course-card">
|
||||||
|
|
||||||
<div class="course-image {% if not course.image %}default-image{% endif %}"
|
<div class="course-image {% if not course.image %}default-image{% endif %}" {% if course.image %}
|
||||||
{% if course.image %} style="background-image: url( {{ course.image }} );" {% endif %}>
|
style="background-image: url( {{ course.image }} );" {% endif %}>
|
||||||
<div class="course-tags">
|
<div class="course-tags">
|
||||||
{% for tag in course.get_tags() %}
|
{% for tag in course.get_tags() %}
|
||||||
<div class="course-card-pills">{{ tag }}</div>
|
<div class="course-card-pills">{{ tag }}</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if membership and not read_only %}
|
{% if membership and not read_only %}
|
||||||
{% if progress < 100 %}
|
{% if progress < 100 %} <div class="course-card-pills dark-pills ml-auto">{{ frappe.utils.rounded(progress) }}%
|
||||||
<div class="course-card-pills dark-pills ml-auto">{{ frappe.utils.rounded(progress) }}% {{ _("Completed") }}</div>
|
{{ _("Completed") }}
|
||||||
|
</div>
|
||||||
{% else %}
|
{% 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 %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -123,7 +123,8 @@ class CustomUser(User):
|
|||||||
|
|
||||||
for map in mapping:
|
for map in mapping:
|
||||||
if frappe.db.get_value("LMS Course", map.course, "is_published"):
|
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
|
return mentored_courses
|
||||||
|
|
||||||
|
|||||||
@@ -212,7 +212,6 @@ input[type=checkbox] {
|
|||||||
|
|
||||||
.courses-header {
|
.courses-header {
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
padding: 0 1rem;
|
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
@@ -739,7 +738,6 @@ input[type=checkbox] {
|
|||||||
letter-spacing: -0.0175em;
|
letter-spacing: -0.0175em;
|
||||||
color: #192734;
|
color: #192734;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
padding: 0 1rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.course-detail-headings {
|
.course-detail-headings {
|
||||||
|
|||||||
@@ -130,9 +130,8 @@
|
|||||||
Courses Mentored
|
Courses Mentored
|
||||||
</div>
|
</div>
|
||||||
<div class="cards-parent">
|
<div class="cards-parent">
|
||||||
{% for mentorship in member.get_mentored_courses() %}
|
{% for course in member.get_mentored_courses() %}
|
||||||
{% set course_details = frappe.get_doc("LMS Course", mentorship.course) %}
|
{{ widgets.CourseCard(course=course, read_only=read_only) }}
|
||||||
{{ widgets.CourseCard(course=course_details, read_only=read_only) }}
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user