Merge branch 'main' of https://github.com/frappe/lms
This commit is contained in:
33
lms/hooks.py
33
lms/hooks.py
@@ -60,6 +60,7 @@ web_include_js = ["website.bundle.js"]
|
||||
# ------------
|
||||
|
||||
# before_install = "lms.install.before_install"
|
||||
after_sync = "lms.install.after_sync"
|
||||
after_uninstall = "lms.install.after_uninstall"
|
||||
|
||||
|
||||
@@ -135,28 +136,28 @@ fixtures = ["Custom Field", "Function", "Industry"]
|
||||
|
||||
# Add all simple route rules here
|
||||
website_route_rules = [
|
||||
{"from_route": "/sketches/<sketch>", "to_route": "sketches/sketch"},
|
||||
{"from_route": "/courses/<course>", "to_route": "courses/course"},
|
||||
{"from_route": "/courses/<course>/<certificate>", "to_route": "courses/certificate"},
|
||||
{"from_route": "/courses/<course>/learn", "to_route": "batch/learn"},
|
||||
{"from_route": "/courses/<course>/learn/<int:chapter>.<int:lesson>", "to_route": "batch/learn"},
|
||||
{"from_route": "/sketches/<sketch>", "to_route": "sketches/sketch"},
|
||||
{"from_route": "/courses/<course>", "to_route": "courses/course"},
|
||||
{"from_route": "/courses/<course>/<certificate>", "to_route": "courses/certificate"},
|
||||
{"from_route": "/courses/<course>/learn", "to_route": "batch/learn"},
|
||||
{"from_route": "/courses/<course>/learn/<int:chapter>.<int:lesson>", "to_route": "batch/learn"},
|
||||
{"from_route": "/quizzes", "to_route": "batch/quiz_list"},
|
||||
{"from_route": "/quizzes/<quizname>", "to_route": "batch/quiz"},
|
||||
{"from_route": "/courses/<course>/progress", "to_route": "batch/progress"},
|
||||
{"from_route": "/courses/<course>/join", "to_route": "batch/join"},
|
||||
{"from_route": "/courses/<course>/manage", "to_route": "cohorts"},
|
||||
{"from_route": "/courses/<course>/cohorts/<cohort>", "to_route": "cohorts/cohort"},
|
||||
{"from_route": "/courses/<course>/cohorts/<cohort>/<page>", "to_route": "cohorts/cohort"},
|
||||
{"from_route": "/courses/<course>/subgroups/<cohort>/<subgroup>", "to_route": "cohorts/subgroup"},
|
||||
{"from_route": "/courses/<course>/subgroups/<cohort>/<subgroup>/<page>", "to_route": "cohorts/subgroup"},
|
||||
{"from_route": "/courses/<course>/join/<cohort>/<subgroup>/<invite_code>", "to_route": "cohorts/join"},
|
||||
{"from_route": "/users", "to_route": "profiles/profile"},
|
||||
{"from_route": "/courses/<course>/progress", "to_route": "batch/progress"},
|
||||
{"from_route": "/courses/<course>/join", "to_route": "batch/join"},
|
||||
{"from_route": "/courses/<course>/manage", "to_route": "cohorts"},
|
||||
{"from_route": "/courses/<course>/cohorts/<cohort>", "to_route": "cohorts/cohort"},
|
||||
{"from_route": "/courses/<course>/cohorts/<cohort>/<page>", "to_route": "cohorts/cohort"},
|
||||
{"from_route": "/courses/<course>/subgroups/<cohort>/<subgroup>", "to_route": "cohorts/subgroup"},
|
||||
{"from_route": "/courses/<course>/subgroups/<cohort>/<subgroup>/<page>", "to_route": "cohorts/subgroup"},
|
||||
{"from_route": "/courses/<course>/join/<cohort>/<subgroup>/<invite_code>", "to_route": "cohorts/join"},
|
||||
{"from_route": "/users", "to_route": "profiles/profile"},
|
||||
{"from_route": "/jobs/<job>", "to_route": "jobs/job"}
|
||||
]
|
||||
|
||||
website_redirects = [
|
||||
{"source": "/update-profile", "target": "/edit-profile"},
|
||||
{"source": "/dashboard", "target": "/users"},
|
||||
{"source": "/update-profile", "target": "/edit-profile"},
|
||||
{"source": "/dashboard", "target": "/courses"},
|
||||
]
|
||||
|
||||
update_website_context = [
|
||||
|
||||
@@ -1,15 +1,58 @@
|
||||
import frappe
|
||||
from frappe.desk.page.setup_wizard.setup_wizard import add_all_roles_to
|
||||
|
||||
|
||||
def after_sync():
|
||||
create_lms_roles()
|
||||
set_default_home()
|
||||
add_all_roles_to("Administrator")
|
||||
|
||||
|
||||
def after_uninstall():
|
||||
delete_custom_fields()
|
||||
|
||||
|
||||
def create_lms_roles():
|
||||
create_instructor_role()
|
||||
create_moderator_role()
|
||||
|
||||
|
||||
def set_default_home():
|
||||
frappe.db.set_value("Portal Settings", None, "default_portal_home", "/courses")
|
||||
|
||||
|
||||
def create_instructor_role():
|
||||
if not frappe.db.exists("Role", "Course Instructor"):
|
||||
role = frappe.get_doc({
|
||||
"doctype": "Role",
|
||||
"role_name": "Course Instructor",
|
||||
"home_page": "",
|
||||
"desk_access": 0
|
||||
})
|
||||
role.save(ignore_permissions=True)
|
||||
|
||||
|
||||
def create_moderator_role():
|
||||
if not frappe.db.exists("Role", "Course Moderator"):
|
||||
role = frappe.get_doc({
|
||||
"doctype": "Role",
|
||||
"role_name": "Course Moderator",
|
||||
"home_page": "",
|
||||
"desk_access": 0
|
||||
})
|
||||
role.save(ignore_permissions=True)
|
||||
|
||||
|
||||
def delete_custom_fields():
|
||||
fields = [ "user_category", "headline", "college", "city", "verify_terms", "country", "preferred_location",
|
||||
"preferred_functions", "preferred_industries", "work_environment_column", "time", "role", "carrer_preference_details",
|
||||
"skill", "certification_details", "internship", "branch", "github", "medium", "linkedin", "profession", "looking_for_job",
|
||||
"work_environment", "dream_companies", "career_preference_column", "attire", "collaboration", "location_preference",
|
||||
"company_type", "skill_details", "certification", "education", "work_experience", "education_details", "hide_private",
|
||||
"work_experience_details", "profile_complete", "cover_image"
|
||||
fields = [ "user_category", "headline", "college", "city", "verify_terms", "country",
|
||||
"preferred_location", "preferred_functions", "preferred_industries",
|
||||
"work_environment_column", "time", "role", "carrer_preference_details",
|
||||
"skill", "certification_details", "internship", "branch", "github",
|
||||
"medium", "linkedin", "profession", "looking_for_job", "cover_image"
|
||||
"work_environment", "dream_companies", "career_preference_column",
|
||||
"attire", "collaboration", "location_preference", "company_type",
|
||||
"skill_details", "certification", "education", "work_experience",
|
||||
"education_details", "hide_private", "work_experience_details", "profile_complete"
|
||||
]
|
||||
|
||||
for field in fields:
|
||||
|
||||
@@ -2,23 +2,26 @@
|
||||
"based_on": "creation",
|
||||
"chart_name": "Course Enrollments",
|
||||
"chart_type": "Count",
|
||||
"color": "#4463F0",
|
||||
"creation": "2021-09-30 12:23:09.414853",
|
||||
"custom_options": "{\"type\": \"line\", \"axisOptions\": {\"xIsSeries\": 1}, \"lineOptions\": {\"regionFill\": 1}}",
|
||||
"docstatus": 0,
|
||||
"doctype": "Dashboard Chart",
|
||||
"document_type": "LMS Batch Membership",
|
||||
"dynamic_filters_json": "[]",
|
||||
"filters_json": "[]",
|
||||
"group_by_type": "Count",
|
||||
"idx": 0,
|
||||
"idx": 1,
|
||||
"is_public": 1,
|
||||
"is_standard": 1,
|
||||
"last_synced_on": "2021-10-17 13:32:21.745498",
|
||||
"modified": "2021-10-21 17:31:06.997133",
|
||||
"last_synced_on": "2022-10-20 10:46:56.859520",
|
||||
"modified": "2022-10-20 11:30:26.863008",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "Course Enrollments",
|
||||
"number_of_groups": 0,
|
||||
"owner": "basawaraj@erpnext.com",
|
||||
"roles": [],
|
||||
"source": "",
|
||||
"time_interval": "Daily",
|
||||
"timeseries": 1,
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"chart_type": "Count",
|
||||
"color": "#4463F0",
|
||||
"creation": "2021-09-28 18:57:50.047656",
|
||||
"custom_options": "{\"type\": \"line\", \"axisOptions\": {\"xIsSeries\": 1}, \"lineOptions\": {\"regionFill\": 1}}",
|
||||
"docstatus": 0,
|
||||
"doctype": "Dashboard Chart",
|
||||
"document_type": "User",
|
||||
@@ -13,8 +14,8 @@
|
||||
"idx": 1,
|
||||
"is_public": 1,
|
||||
"is_standard": 1,
|
||||
"last_synced_on": "2022-10-14 15:57:47.583435",
|
||||
"modified": "2022-10-14 17:20:21.880532",
|
||||
"last_synced_on": "2022-10-20 10:46:56.849265",
|
||||
"modified": "2022-10-20 11:31:17.184897",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "New Signups",
|
||||
|
||||
@@ -137,7 +137,10 @@ class LMSCourse(Document):
|
||||
|
||||
|
||||
def get_cohorts(self):
|
||||
return frappe.get_all("Cohort", {"course": self.name}, ["name", "slug"], order_by="creation")
|
||||
return frappe.get_all("Cohort",
|
||||
{"course": self.name},
|
||||
["name", "slug", "title", "begin_date", "end_date"],
|
||||
order_by="creation")
|
||||
|
||||
|
||||
def get_cohort(self, cohort_slug):
|
||||
|
||||
@@ -1 +1,15 @@
|
||||
{% include "lms/templates/statistics.html" %}
|
||||
{% if title %}
|
||||
<h2 class="hero-title">
|
||||
{{ _(title) }}
|
||||
</h2>
|
||||
{% endif %}
|
||||
|
||||
{% if subtitle %}
|
||||
<p class="hero-subtitle">
|
||||
{{ _(subtitle) }}
|
||||
</p>
|
||||
{%- endif -%}
|
||||
|
||||
<div class="mt-12">
|
||||
{% include "lms/templates/statistics.html" %}
|
||||
</div>
|
||||
|
||||
@@ -4,6 +4,22 @@
|
||||
"docstatus": 0,
|
||||
"doctype": "Web Template",
|
||||
"fields": [
|
||||
{
|
||||
"__islocal": 1,
|
||||
"__unsaved": 1,
|
||||
"fieldname": "title",
|
||||
"fieldtype": "Data",
|
||||
"label": "Title",
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"__islocal": 1,
|
||||
"__unsaved": 1,
|
||||
"fieldname": "subtitle",
|
||||
"fieldtype": "Text",
|
||||
"label": "Subtitle",
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "published_courses",
|
||||
"fieldtype": "Check",
|
||||
@@ -24,10 +40,10 @@
|
||||
}
|
||||
],
|
||||
"idx": 0,
|
||||
"modified": "2022-09-28 17:44:37.982923",
|
||||
"modified": "2022-10-20 20:10:48.490785",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "Dashboard Stats",
|
||||
"name": "LMS Statistics",
|
||||
"owner": "Administrator",
|
||||
"standard": 1,
|
||||
"template": "",
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{% set chapters = get_chapters(course.name) %}
|
||||
|
||||
{% if course.edit_mode or chapters | length %}
|
||||
<div class="course-home-outline">
|
||||
|
||||
{% set chapters = get_chapters(course.name) %}
|
||||
|
||||
{% if course.edit_mode and course.name %}
|
||||
<button class="btn btn-md btn-secondary btn-chapter pull-right"> {{ _("New Chapter") }} </button>
|
||||
@@ -110,9 +112,14 @@
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if chapters | length %}
|
||||
<!-- No Preview Modal -->
|
||||
{{ widgets.NoPreviewModal(course=course, membership=membership) }}
|
||||
|
||||
{% endif %}
|
||||
|
||||
<script>
|
||||
|
||||
frappe.ready(() => {
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
{
|
||||
"charts": [
|
||||
{
|
||||
"chart_name": "New Signups",
|
||||
"label": "Signups"
|
||||
},
|
||||
{
|
||||
"chart_name": "Course Enrollments",
|
||||
"label": "Course Enrollments"
|
||||
"label": "Enrollments"
|
||||
}
|
||||
],
|
||||
"content": "[{\"type\":\"chart\",\"data\":{\"chart_name\":\"Course Enrollments\",\"col\":12}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Course\",\"col\":4}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Course Enrollments\",\"col\":4}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Course Completed\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Course Data\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Course Stats\",\"col\":4}}]",
|
||||
"content": "[{\"type\":\"header\",\"data\":{\"text\":\"<span class=\\\"h4\\\"><b>Get Started</b></span>\",\"col\":12}},{\"type\":\"paragraph\",\"data\":{\"text\":\"<a href=\\\"/courses\\\" draggable=\\\"false\\\">Visit LMS Portal</a>\",\"col\":4}},{\"type\":\"paragraph\",\"data\":{\"text\":\"<a href=\\\"/courses/new-course\\\" draggable=\\\"false\\\">Create a Course</a>\",\"col\":4}},{\"type\":\"paragraph\",\"data\":{\"text\":\"<a href=\\\"http://fsl:8000/app/web-page/new-web-page-1\\\">Setup a Home Page</a>\",\"col\":4}},{\"type\":\"paragraph\",\"data\":{\"text\":\"<a href=\\\"https://frappelms.com/introduction\\\">Documentation</a>\",\"col\":4}},{\"type\":\"paragraph\",\"data\":{\"text\":\"<a href=\\\"https://frappe.school/courses/introducing-frappe-lms\\\">Video Tutorials</a>\",\"col\":4}},{\"type\":\"spacer\",\"data\":{\"col\":12}},{\"type\":\"chart\",\"data\":{\"chart_name\":\"Signups\",\"col\":6}},{\"type\":\"chart\",\"data\":{\"chart_name\":\"Enrollments\",\"col\":6}},{\"type\":\"spacer\",\"data\":{\"col\":12}},{\"type\":\"header\",\"data\":{\"text\":\"<span style=\\\"font-size: 18px;\\\"><b>Statistics</b></span>\",\"col\":12}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Course\",\"col\":4}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Course Enrollments\",\"col\":4}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Course Completed\",\"col\":4}},{\"type\":\"spacer\",\"data\":{\"col\":12}},{\"type\":\"header\",\"data\":{\"text\":\"<span class=\\\"h4\\\"><b>Master</b></span>\",\"col\":12}},{\"type\":\"card\",\"data\":{\"card_name\":\"Course Data\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Course Stats\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Certification\",\"col\":4}}]",
|
||||
"creation": "2021-10-21 17:20:01.358903",
|
||||
"docstatus": 0,
|
||||
"doctype": "Workspace",
|
||||
@@ -99,9 +103,47 @@
|
||||
"link_type": "DocType",
|
||||
"onboard": 0,
|
||||
"type": "Link"
|
||||
},
|
||||
{
|
||||
"hidden": 0,
|
||||
"is_query_report": 0,
|
||||
"label": "Certification",
|
||||
"link_count": 3,
|
||||
"onboard": 0,
|
||||
"type": "Card Break"
|
||||
},
|
||||
{
|
||||
"hidden": 0,
|
||||
"is_query_report": 0,
|
||||
"label": "Certification",
|
||||
"link_count": 0,
|
||||
"link_to": "LMS Certificate",
|
||||
"link_type": "DocType",
|
||||
"onboard": 0,
|
||||
"type": "Link"
|
||||
},
|
||||
{
|
||||
"hidden": 0,
|
||||
"is_query_report": 0,
|
||||
"label": "Evaluation Request",
|
||||
"link_count": 0,
|
||||
"link_to": "LMS Certificate Request",
|
||||
"link_type": "DocType",
|
||||
"onboard": 0,
|
||||
"type": "Link"
|
||||
},
|
||||
{
|
||||
"hidden": 0,
|
||||
"is_query_report": 0,
|
||||
"label": "Evaluation",
|
||||
"link_count": 0,
|
||||
"link_to": "LMS Certificate Evaluation",
|
||||
"link_type": "DocType",
|
||||
"onboard": 0,
|
||||
"type": "Link"
|
||||
}
|
||||
],
|
||||
"modified": "2022-06-20 09:46:31.407249",
|
||||
"modified": "2022-10-20 17:43:31.515047",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "LMS",
|
||||
|
||||
@@ -17,7 +17,6 @@ class CustomUser(User):
|
||||
def validate(self):
|
||||
super(CustomUser, self).validate()
|
||||
self.validate_username_characters()
|
||||
self.validate_skills()
|
||||
self.validate_completion()
|
||||
self.user_image = validate_image(self.user_image)
|
||||
self.cover_image = validate_image(self.cover_image)
|
||||
|
||||
@@ -33,3 +33,4 @@ lms.patches.v0_0.delete_course_web_forms #21-08-2022
|
||||
lms.patches.v0_0.create_course_instructor_role #29-08-2022
|
||||
lms.patches.v0_0.create_course_moderator_role
|
||||
lms.patches.v0_0.set_dashboard #11-10-2022
|
||||
lms.patches.v0_0.set_courses_page_as_home
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
from venv import create
|
||||
import frappe
|
||||
from lms.install import create_instructor_role
|
||||
|
||||
def execute():
|
||||
if not frappe.db.exists("Role", "Course Instructor"):
|
||||
role = frappe.get_doc({
|
||||
"doctype": "Role",
|
||||
"role_name": "Course Instructor",
|
||||
"home_page": "/dashboard",
|
||||
"desk_access": 0
|
||||
})
|
||||
role.save(ignore_permissions=True)
|
||||
create_instructor_role()
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
from venv import create
|
||||
import frappe
|
||||
from lms.install import create_moderator_role
|
||||
|
||||
def execute():
|
||||
if not frappe.db.exists("Role", "Course Moderator"):
|
||||
role = frappe.get_doc({
|
||||
"doctype": "Role",
|
||||
"role_name": "Course Moderator",
|
||||
"home_page": "/dashboard",
|
||||
"desk_access": 0
|
||||
})
|
||||
role.save(ignore_permissions=True)
|
||||
create_moderator_role()
|
||||
|
||||
|
||||
6
lms/patches/v0_0/set_courses_page_as_home.py
Normal file
6
lms/patches/v0_0/set_courses_page_as_home.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import frappe
|
||||
|
||||
def execute():
|
||||
frappe.db.set_value("Portal Settings", None, "default_portal_home", "/courses")
|
||||
frappe.db.set_value("Role", "Course Instructor", "home_page", "")
|
||||
frappe.db.set_value("Role", "Course Moderator", "home_page", "")
|
||||
@@ -364,13 +364,12 @@ input[type=checkbox] {
|
||||
}
|
||||
|
||||
.course-home-page .course-home-outline {
|
||||
margin-top: 5rem;
|
||||
padding-bottom: 4rem;
|
||||
}
|
||||
|
||||
.course-home-page {
|
||||
background-color: #FFFFFF;
|
||||
padding-top: 3.75rem;
|
||||
padding-top: 4rem;
|
||||
}
|
||||
|
||||
.chapter-title {
|
||||
@@ -1775,3 +1774,7 @@ li {
|
||||
font-weight: bold;
|
||||
color: var(--gray-900);
|
||||
}
|
||||
|
||||
.course-description-section {
|
||||
padding-bottom: 4rem;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
{{ _("Published Courses") }}
|
||||
</div>
|
||||
<div class="stats-value">
|
||||
{{ format_number(frappe.db.count("LMS Course", { "published": 1, "upcoming": 0 })) }}
|
||||
{{ frappe.db.count("LMS Course", { "published": 1, "upcoming": 0 }) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -17,7 +17,7 @@
|
||||
{{ _("Total Signups") }}
|
||||
</div>
|
||||
<div class="stats-value">
|
||||
{{ format_number(frappe.db.count("User", { "enabled": 1 })) }}
|
||||
{{ frappe.db.count("User", { "enabled": 1 }) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -28,7 +28,7 @@
|
||||
{{ _("Enrollment Count") }}
|
||||
</div>
|
||||
<div class="stats-value">
|
||||
{{ format_number(frappe.db.count("LMS Batch Membership")) }}
|
||||
{{ frappe.db.count("LMS Batch Membership") }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{% extends "www/cohorts/base.html" %}
|
||||
{% block title %}Manage {{ course.title }}{% endblock %}
|
||||
{% block title %}
|
||||
{{ _("Manage") }} {{ course.title }}
|
||||
{% endblock %}
|
||||
|
||||
{% block page_content %}
|
||||
<div class="course-home-headings">
|
||||
@@ -7,12 +9,10 @@
|
||||
</div>
|
||||
|
||||
<p>
|
||||
{% set stats = cohort.get_stats() %}
|
||||
|
||||
{{ stats.subgroups }} {{ _("Subgroups")}}
|
||||
| {{ stats.mentors }} {{ _("Mentors") }}
|
||||
| {{ stats.students }} {{ _("Students") }}
|
||||
| {{ stats.join_requests }} {{ _("Join Requests") }}
|
||||
{{ frappe.db.count("Cohort Subgroup", {"cohort": cohort.name}) }} {{ _("Subgroups") }}
|
||||
| {{ frappe.db.count("Cohort Mentor", {"cohort": cohort.name}) }} {{ _("Mentors") }}
|
||||
| {{ frappe.db.count("LMS Batch Membership", {"cohort": cohort.name}) }} {{ _("Students") }}
|
||||
| {{ frappe.db.count("Cohort Join Request", {"cohort": cohort.name}) }} {{ _("Join Requests") }}
|
||||
</p>
|
||||
|
||||
{% if is_mentor %}
|
||||
@@ -25,19 +25,19 @@
|
||||
{% endif %}
|
||||
|
||||
<ul class="nav nav-tabs">
|
||||
{% set num_subgroups = cohort.get_subgroups() | length %}
|
||||
{{ render_navitem("Subgroups", "", page=page, count=num_subgroups) }}
|
||||
{% for p in cohort.get_pages(scope="Cohort") %}
|
||||
{{ render_navitem(p.title, p.slug, page=page) }}
|
||||
{% endfor %}
|
||||
{% set num_subgroups = cohort.get_subgroups() | length %}
|
||||
{{ render_navitem("Subgroups", "", page=page, count=num_subgroups) }}
|
||||
{% for p in cohort.get_pages(scope="Cohort") %}
|
||||
{{ render_navitem(p.title, p.slug, page=page) }}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<div class="my-5">
|
||||
{% if not page %}
|
||||
{{ render_subgroups() }}
|
||||
{% else %}
|
||||
{{ render_page(page) }}
|
||||
{% endif %}
|
||||
{% if not page %}
|
||||
{{ render_subgroups() }}
|
||||
{% else %}
|
||||
{{ render_page(page) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -55,7 +55,7 @@
|
||||
<div style="font-size: 0.8em;">
|
||||
{{ sg.num_mentors }} {{ _("Mentors") }}
|
||||
|
|
||||
{{sg.num_students}} {{ _(Students) }}
|
||||
{{sg.num_students}} {{ _("Students") }}
|
||||
|
|
||||
{{sg.num_join_requests}} {{ _("Join Requests") }}
|
||||
</div>
|
||||
|
||||
@@ -1,38 +1,53 @@
|
||||
{% extends "www/cohorts/base.html" %}
|
||||
{% block title %}Manage {{ course.title }}{% endblock %}
|
||||
{% block title %}
|
||||
_("Manage") {{ course.title }}
|
||||
{% endblock %}
|
||||
|
||||
{% block page_content %}
|
||||
{% if cohorts %}
|
||||
<h2>{{ _("Cohorts") }}</h2>
|
||||
<div class="row">
|
||||
{% for cohort in cohorts %}
|
||||
<div class="col-md-6">
|
||||
{{ render_cohort(course, cohort) }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<h2>{{ _("Permission Denied") }}</h2>
|
||||
<p>{{ _("You don't have permission to manage this course.") }}</p>
|
||||
{% endif %}
|
||||
{% if cohorts %}
|
||||
<h2>
|
||||
{{ _("Cohorts") }}
|
||||
</h2>
|
||||
<div class="row">
|
||||
{% for cohort in cohorts %}
|
||||
<div class="col-md-6">
|
||||
{{ render_cohort(course, cohort) }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<h2>
|
||||
{{ _("Permission Denied") }}
|
||||
</h2>
|
||||
<p>
|
||||
{{ _("You don't have permission to manage this course.") }}
|
||||
</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% macro render_cohort(course, cohort) %}
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">{{cohort.title}}</h5>
|
||||
<h6 class="card-subtitle mb-2 text-muted">{{cohort.begin_date}} - {{cohort.end_date}}</h6>
|
||||
<p>
|
||||
{% set stats = cohort.get_stats() %}
|
||||
<div class="cards-parent">
|
||||
<div class="common-card-style flex-column p-5">
|
||||
<h5 class="card-title">
|
||||
{{ cohort.title }}
|
||||
</h5>
|
||||
|
||||
{{ stats.subgroups }} Subgroups
|
||||
| {{ stats.mentors }} Mentors
|
||||
| {{ stats.students }} students
|
||||
| {{ stats.join_requests }} join requests
|
||||
</p>
|
||||
{% if cohort.begin_date %}
|
||||
<h6 class="card-subtitle mb-2 text-muted">
|
||||
{{ frappe.utils.format_date(cohort.begin_date, "medium") }} - {{ frappe.utils.format_date(cohort.end_date, "medium") }}
|
||||
</h6>
|
||||
{% endif %}
|
||||
|
||||
<a href="/courses/{{course.name}}/cohorts/{{cohort.slug}}" class="card-link">{{ _("Manage") }}</a>
|
||||
</div>
|
||||
<p class="mb-0">
|
||||
{{ frappe.db.count("Cohort Subgroup", {"cohort": cohort.name}) }} {{ _("Subgroups") }}
|
||||
| {{ frappe.db.count("Cohort Mentor", {"cohort": cohort.name}) }} {{ _("Mentors") }}
|
||||
| {{ frappe.db.count("LMS Batch Membership", {"cohort": cohort.name}) }} {{ _("Students") }}
|
||||
| {{ frappe.db.count("Cohort Join Request", {"cohort": cohort.name}) }} {{ _("Join Requests") }}
|
||||
</p>
|
||||
|
||||
|
||||
<a class="stretched-link" href="/courses/{{course.name}}/cohorts/{{cohort.slug}}"></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endmacro %}
|
||||
|
||||
@@ -292,12 +292,7 @@
|
||||
{% set lesson_index = get_lesson_index(membership.current_lesson) if membership and
|
||||
membership.current_lesson else "1.1" if first_lesson_exists(course.name) else None %}
|
||||
|
||||
{% if show_start_learing_cta(course, membership) %}
|
||||
<div class="btn btn-primary wide-button join-batch" data-course="{{ course.name | urlencode }}">
|
||||
{{ _("Start Learning") }}
|
||||
</div>
|
||||
|
||||
{% elif is_instructor(course.name) and not course.published and course.status != "Under Review" %}
|
||||
{% if is_instructor(course.name) and not course.published and course.status != "Under Review" %}
|
||||
<div class="btn btn-primary wide-button" id="submit-for-review" data-course="{{ course.name | urlencode }}">
|
||||
{{ _("Submit for Review") }}
|
||||
</div>
|
||||
@@ -308,7 +303,7 @@
|
||||
{{ _("Checkout Course") }}
|
||||
</a>
|
||||
|
||||
{% elif course.upcoming and not is_user_interested and not is_instructor %}
|
||||
{% elif course.upcoming and not is_user_interested and not is_instructor(course.name) %}
|
||||
<div class="btn btn-secondary wide-button notify-me" data-course="{{course.name | urlencode}}">
|
||||
{{ _("Notify me when available") }}
|
||||
</div>
|
||||
@@ -323,6 +318,11 @@
|
||||
href="{{ get_lesson_url(course.name, lesson_index) }}{{ course.query_parameter }}">
|
||||
{{ _("Continue Learning") }}
|
||||
</a>
|
||||
|
||||
{% elif show_start_learing_cta(course, membership) %}
|
||||
<div class="btn btn-primary wide-button join-batch" data-course="{{ course.name | urlencode }}">
|
||||
{{ _("Start Learning") }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% set progress = frappe.utils.cint(membership.progress) %}
|
||||
@@ -358,9 +358,13 @@
|
||||
</div>
|
||||
|
||||
{% if certificate_request and not certificate %}
|
||||
<p class="mb-2"> <b>{{ _("Evaluation On: ") }}</b>
|
||||
<p class="mb-2">
|
||||
<b>
|
||||
{{ _("Evaluation On: ") }}
|
||||
</b>
|
||||
{{ _("{0} at {1}").format(frappe.utils.format_date(certificate_request.date, "medium"),
|
||||
frappe.utils.format_time(certificate_request.start_time, "short")) }} </p>
|
||||
frappe.utils.format_time(certificate_request.start_time, "short")) }}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% if course.status == "Under Review" and is_instructor(course.name) %}
|
||||
@@ -370,7 +374,9 @@
|
||||
{% endif %}
|
||||
|
||||
{% if no_of_attempts and no_of_attempts >= course.max_attempts %}
|
||||
<p> {{ _("You have exceeded the maximum number of attempts allowed to appear for evaluations of this course.") }} </p>
|
||||
<p>
|
||||
{{ _("You have exceeded the maximum number of attempts allowed to appear for evaluations of this course.") }}
|
||||
</p>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
|
||||
0
lms/www/get_started/__init__.py
Normal file
0
lms/www/get_started/__init__.py
Normal file
Reference in New Issue
Block a user