Merge branch 'main' of https://github.com/frappe/lms
This commit is contained in:
@@ -60,6 +60,7 @@ web_include_js = ["website.bundle.js"]
|
|||||||
# ------------
|
# ------------
|
||||||
|
|
||||||
# before_install = "lms.install.before_install"
|
# before_install = "lms.install.before_install"
|
||||||
|
after_sync = "lms.install.after_sync"
|
||||||
after_uninstall = "lms.install.after_uninstall"
|
after_uninstall = "lms.install.after_uninstall"
|
||||||
|
|
||||||
|
|
||||||
@@ -156,7 +157,7 @@ website_route_rules = [
|
|||||||
|
|
||||||
website_redirects = [
|
website_redirects = [
|
||||||
{"source": "/update-profile", "target": "/edit-profile"},
|
{"source": "/update-profile", "target": "/edit-profile"},
|
||||||
{"source": "/dashboard", "target": "/users"},
|
{"source": "/dashboard", "target": "/courses"},
|
||||||
]
|
]
|
||||||
|
|
||||||
update_website_context = [
|
update_website_context = [
|
||||||
|
|||||||
@@ -1,15 +1,58 @@
|
|||||||
import frappe
|
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():
|
def after_uninstall():
|
||||||
delete_custom_fields()
|
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():
|
def delete_custom_fields():
|
||||||
fields = [ "user_category", "headline", "college", "city", "verify_terms", "country", "preferred_location",
|
fields = [ "user_category", "headline", "college", "city", "verify_terms", "country",
|
||||||
"preferred_functions", "preferred_industries", "work_environment_column", "time", "role", "carrer_preference_details",
|
"preferred_location", "preferred_functions", "preferred_industries",
|
||||||
"skill", "certification_details", "internship", "branch", "github", "medium", "linkedin", "profession", "looking_for_job",
|
"work_environment_column", "time", "role", "carrer_preference_details",
|
||||||
"work_environment", "dream_companies", "career_preference_column", "attire", "collaboration", "location_preference",
|
"skill", "certification_details", "internship", "branch", "github",
|
||||||
"company_type", "skill_details", "certification", "education", "work_experience", "education_details", "hide_private",
|
"medium", "linkedin", "profession", "looking_for_job", "cover_image"
|
||||||
"work_experience_details", "profile_complete", "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:
|
for field in fields:
|
||||||
|
|||||||
@@ -2,23 +2,26 @@
|
|||||||
"based_on": "creation",
|
"based_on": "creation",
|
||||||
"chart_name": "Course Enrollments",
|
"chart_name": "Course Enrollments",
|
||||||
"chart_type": "Count",
|
"chart_type": "Count",
|
||||||
|
"color": "#4463F0",
|
||||||
"creation": "2021-09-30 12:23:09.414853",
|
"creation": "2021-09-30 12:23:09.414853",
|
||||||
|
"custom_options": "{\"type\": \"line\", \"axisOptions\": {\"xIsSeries\": 1}, \"lineOptions\": {\"regionFill\": 1}}",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"doctype": "Dashboard Chart",
|
"doctype": "Dashboard Chart",
|
||||||
"document_type": "LMS Batch Membership",
|
"document_type": "LMS Batch Membership",
|
||||||
"dynamic_filters_json": "[]",
|
"dynamic_filters_json": "[]",
|
||||||
"filters_json": "[]",
|
"filters_json": "[]",
|
||||||
"group_by_type": "Count",
|
"group_by_type": "Count",
|
||||||
"idx": 0,
|
"idx": 1,
|
||||||
"is_public": 1,
|
"is_public": 1,
|
||||||
"is_standard": 1,
|
"is_standard": 1,
|
||||||
"last_synced_on": "2021-10-17 13:32:21.745498",
|
"last_synced_on": "2022-10-20 10:46:56.859520",
|
||||||
"modified": "2021-10-21 17:31:06.997133",
|
"modified": "2022-10-20 11:30:26.863008",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "Course Enrollments",
|
"name": "Course Enrollments",
|
||||||
"number_of_groups": 0,
|
"number_of_groups": 0,
|
||||||
"owner": "basawaraj@erpnext.com",
|
"owner": "basawaraj@erpnext.com",
|
||||||
|
"roles": [],
|
||||||
"source": "",
|
"source": "",
|
||||||
"time_interval": "Daily",
|
"time_interval": "Daily",
|
||||||
"timeseries": 1,
|
"timeseries": 1,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
"chart_type": "Count",
|
"chart_type": "Count",
|
||||||
"color": "#4463F0",
|
"color": "#4463F0",
|
||||||
"creation": "2021-09-28 18:57:50.047656",
|
"creation": "2021-09-28 18:57:50.047656",
|
||||||
|
"custom_options": "{\"type\": \"line\", \"axisOptions\": {\"xIsSeries\": 1}, \"lineOptions\": {\"regionFill\": 1}}",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"doctype": "Dashboard Chart",
|
"doctype": "Dashboard Chart",
|
||||||
"document_type": "User",
|
"document_type": "User",
|
||||||
@@ -13,8 +14,8 @@
|
|||||||
"idx": 1,
|
"idx": 1,
|
||||||
"is_public": 1,
|
"is_public": 1,
|
||||||
"is_standard": 1,
|
"is_standard": 1,
|
||||||
"last_synced_on": "2022-10-14 15:57:47.583435",
|
"last_synced_on": "2022-10-20 10:46:56.849265",
|
||||||
"modified": "2022-10-14 17:20:21.880532",
|
"modified": "2022-10-20 11:31:17.184897",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "New Signups",
|
"name": "New Signups",
|
||||||
|
|||||||
@@ -137,7 +137,10 @@ class LMSCourse(Document):
|
|||||||
|
|
||||||
|
|
||||||
def get_cohorts(self):
|
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):
|
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,
|
"docstatus": 0,
|
||||||
"doctype": "Web Template",
|
"doctype": "Web Template",
|
||||||
"fields": [
|
"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",
|
"fieldname": "published_courses",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
@@ -24,10 +40,10 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"idx": 0,
|
"idx": 0,
|
||||||
"modified": "2022-09-28 17:44:37.982923",
|
"modified": "2022-10-20 20:10:48.490785",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "Dashboard Stats",
|
"name": "LMS Statistics",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"standard": 1,
|
"standard": 1,
|
||||||
"template": "",
|
"template": "",
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
{% set chapters = get_chapters(course.name) %}
|
||||||
|
|
||||||
|
{% if course.edit_mode or chapters | length %}
|
||||||
<div class="course-home-outline">
|
<div class="course-home-outline">
|
||||||
|
|
||||||
{% set chapters = get_chapters(course.name) %}
|
|
||||||
|
|
||||||
{% if course.edit_mode and course.name %}
|
{% if course.edit_mode and course.name %}
|
||||||
<button class="btn btn-md btn-secondary btn-chapter pull-right"> {{ _("New Chapter") }} </button>
|
<button class="btn btn-md btn-secondary btn-chapter pull-right"> {{ _("New Chapter") }} </button>
|
||||||
@@ -110,9 +112,14 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if chapters | length %}
|
||||||
<!-- No Preview Modal -->
|
<!-- No Preview Modal -->
|
||||||
{{ widgets.NoPreviewModal(course=course, membership=membership) }}
|
{{ widgets.NoPreviewModal(course=course, membership=membership) }}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
frappe.ready(() => {
|
frappe.ready(() => {
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
{
|
{
|
||||||
"charts": [
|
"charts": [
|
||||||
|
{
|
||||||
|
"chart_name": "New Signups",
|
||||||
|
"label": "Signups"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"chart_name": "Course Enrollments",
|
"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",
|
"creation": "2021-10-21 17:20:01.358903",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"doctype": "Workspace",
|
"doctype": "Workspace",
|
||||||
@@ -99,9 +103,47 @@
|
|||||||
"link_type": "DocType",
|
"link_type": "DocType",
|
||||||
"onboard": 0,
|
"onboard": 0,
|
||||||
"type": "Link"
|
"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",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "LMS",
|
"name": "LMS",
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ class CustomUser(User):
|
|||||||
def validate(self):
|
def validate(self):
|
||||||
super(CustomUser, self).validate()
|
super(CustomUser, self).validate()
|
||||||
self.validate_username_characters()
|
self.validate_username_characters()
|
||||||
self.validate_skills()
|
|
||||||
self.validate_completion()
|
self.validate_completion()
|
||||||
self.user_image = validate_image(self.user_image)
|
self.user_image = validate_image(self.user_image)
|
||||||
self.cover_image = validate_image(self.cover_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_instructor_role #29-08-2022
|
||||||
lms.patches.v0_0.create_course_moderator_role
|
lms.patches.v0_0.create_course_moderator_role
|
||||||
lms.patches.v0_0.set_dashboard #11-10-2022
|
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
|
import frappe
|
||||||
|
from lms.install import create_instructor_role
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
if not frappe.db.exists("Role", "Course Instructor"):
|
create_instructor_role()
|
||||||
role = frappe.get_doc({
|
|
||||||
"doctype": "Role",
|
|
||||||
"role_name": "Course Instructor",
|
|
||||||
"home_page": "/dashboard",
|
|
||||||
"desk_access": 0
|
|
||||||
})
|
|
||||||
role.save(ignore_permissions=True)
|
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
|
from venv import create
|
||||||
import frappe
|
import frappe
|
||||||
|
from lms.install import create_moderator_role
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
if not frappe.db.exists("Role", "Course Moderator"):
|
create_moderator_role()
|
||||||
role = frappe.get_doc({
|
|
||||||
"doctype": "Role",
|
|
||||||
"role_name": "Course Moderator",
|
|
||||||
"home_page": "/dashboard",
|
|
||||||
"desk_access": 0
|
|
||||||
})
|
|
||||||
role.save(ignore_permissions=True)
|
|
||||||
|
|||||||
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 {
|
.course-home-page .course-home-outline {
|
||||||
margin-top: 5rem;
|
|
||||||
padding-bottom: 4rem;
|
padding-bottom: 4rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.course-home-page {
|
.course-home-page {
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
padding-top: 3.75rem;
|
padding-top: 4rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chapter-title {
|
.chapter-title {
|
||||||
@@ -1775,3 +1774,7 @@ li {
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: var(--gray-900);
|
color: var(--gray-900);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.course-description-section {
|
||||||
|
padding-bottom: 4rem;
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
{{ _("Published Courses") }}
|
{{ _("Published Courses") }}
|
||||||
</div>
|
</div>
|
||||||
<div class="stats-value">
|
<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>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
{{ _("Total Signups") }}
|
{{ _("Total Signups") }}
|
||||||
</div>
|
</div>
|
||||||
<div class="stats-value">
|
<div class="stats-value">
|
||||||
{{ format_number(frappe.db.count("User", { "enabled": 1 })) }}
|
{{ frappe.db.count("User", { "enabled": 1 }) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
{{ _("Enrollment Count") }}
|
{{ _("Enrollment Count") }}
|
||||||
</div>
|
</div>
|
||||||
<div class="stats-value">
|
<div class="stats-value">
|
||||||
{{ format_number(frappe.db.count("LMS Batch Membership")) }}
|
{{ frappe.db.count("LMS Batch Membership") }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
{% extends "www/cohorts/base.html" %}
|
{% extends "www/cohorts/base.html" %}
|
||||||
{% block title %}Manage {{ course.title }}{% endblock %}
|
{% block title %}
|
||||||
|
{{ _("Manage") }} {{ course.title }}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block page_content %}
|
{% block page_content %}
|
||||||
<div class="course-home-headings">
|
<div class="course-home-headings">
|
||||||
@@ -7,12 +9,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
{% set stats = cohort.get_stats() %}
|
{{ frappe.db.count("Cohort Subgroup", {"cohort": cohort.name}) }} {{ _("Subgroups") }}
|
||||||
|
| {{ frappe.db.count("Cohort Mentor", {"cohort": cohort.name}) }} {{ _("Mentors") }}
|
||||||
{{ stats.subgroups }} {{ _("Subgroups")}}
|
| {{ frappe.db.count("LMS Batch Membership", {"cohort": cohort.name}) }} {{ _("Students") }}
|
||||||
| {{ stats.mentors }} {{ _("Mentors") }}
|
| {{ frappe.db.count("Cohort Join Request", {"cohort": cohort.name}) }} {{ _("Join Requests") }}
|
||||||
| {{ stats.students }} {{ _("Students") }}
|
|
||||||
| {{ stats.join_requests }} {{ _("Join Requests") }}
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
{% if is_mentor %}
|
{% if is_mentor %}
|
||||||
@@ -33,11 +33,11 @@
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="my-5">
|
<div class="my-5">
|
||||||
{% if not page %}
|
{% if not page %}
|
||||||
{{ render_subgroups() }}
|
{{ render_subgroups() }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ render_page(page) }}
|
{{ render_page(page) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
<div style="font-size: 0.8em;">
|
<div style="font-size: 0.8em;">
|
||||||
{{ sg.num_mentors }} {{ _("Mentors") }}
|
{{ sg.num_mentors }} {{ _("Mentors") }}
|
||||||
|
|
|
|
||||||
{{sg.num_students}} {{ _(Students) }}
|
{{sg.num_students}} {{ _("Students") }}
|
||||||
|
|
|
|
||||||
{{sg.num_join_requests}} {{ _("Join Requests") }}
|
{{sg.num_join_requests}} {{ _("Join Requests") }}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
{% extends "www/cohorts/base.html" %}
|
{% extends "www/cohorts/base.html" %}
|
||||||
{% block title %}Manage {{ course.title }}{% endblock %}
|
{% block title %}
|
||||||
|
_("Manage") {{ course.title }}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block page_content %}
|
{% block page_content %}
|
||||||
{% if cohorts %}
|
{% if cohorts %}
|
||||||
<h2>{{ _("Cohorts") }}</h2>
|
<h2>
|
||||||
|
{{ _("Cohorts") }}
|
||||||
|
</h2>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{% for cohort in cohorts %}
|
{% for cohort in cohorts %}
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
@@ -12,26 +16,37 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<h2>{{ _("Permission Denied") }}</h2>
|
<h2>
|
||||||
<p>{{ _("You don't have permission to manage this course.") }}</p>
|
{{ _("Permission Denied") }}
|
||||||
|
</h2>
|
||||||
|
<p>
|
||||||
|
{{ _("You don't have permission to manage this course.") }}
|
||||||
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% macro render_cohort(course, cohort) %}
|
{% macro render_cohort(course, cohort) %}
|
||||||
<div class="card">
|
<div class="cards-parent">
|
||||||
<div class="card-body">
|
<div class="common-card-style flex-column p-5">
|
||||||
<h5 class="card-title">{{cohort.title}}</h5>
|
<h5 class="card-title">
|
||||||
<h6 class="card-subtitle mb-2 text-muted">{{cohort.begin_date}} - {{cohort.end_date}}</h6>
|
{{ cohort.title }}
|
||||||
<p>
|
</h5>
|
||||||
{% set stats = cohort.get_stats() %}
|
|
||||||
|
|
||||||
{{ stats.subgroups }} Subgroups
|
{% if cohort.begin_date %}
|
||||||
| {{ stats.mentors }} Mentors
|
<h6 class="card-subtitle mb-2 text-muted">
|
||||||
| {{ stats.students }} students
|
{{ frappe.utils.format_date(cohort.begin_date, "medium") }} - {{ frappe.utils.format_date(cohort.end_date, "medium") }}
|
||||||
| {{ stats.join_requests }} join requests
|
</h6>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<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>
|
</p>
|
||||||
|
|
||||||
<a href="/courses/{{course.name}}/cohorts/{{cohort.slug}}" class="card-link">{{ _("Manage") }}</a>
|
|
||||||
|
<a class="stretched-link" href="/courses/{{course.name}}/cohorts/{{cohort.slug}}"></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -292,12 +292,7 @@
|
|||||||
{% set lesson_index = get_lesson_index(membership.current_lesson) if membership and
|
{% 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 %}
|
membership.current_lesson else "1.1" if first_lesson_exists(course.name) else None %}
|
||||||
|
|
||||||
{% if show_start_learing_cta(course, membership) %}
|
{% if is_instructor(course.name) and not course.published and course.status != "Under Review" %}
|
||||||
<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" %}
|
|
||||||
<div class="btn btn-primary wide-button" id="submit-for-review" data-course="{{ course.name | urlencode }}">
|
<div class="btn btn-primary wide-button" id="submit-for-review" data-course="{{ course.name | urlencode }}">
|
||||||
{{ _("Submit for Review") }}
|
{{ _("Submit for Review") }}
|
||||||
</div>
|
</div>
|
||||||
@@ -308,7 +303,7 @@
|
|||||||
{{ _("Checkout Course") }}
|
{{ _("Checkout Course") }}
|
||||||
</a>
|
</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}}">
|
<div class="btn btn-secondary wide-button notify-me" data-course="{{course.name | urlencode}}">
|
||||||
{{ _("Notify me when available") }}
|
{{ _("Notify me when available") }}
|
||||||
</div>
|
</div>
|
||||||
@@ -323,6 +318,11 @@
|
|||||||
href="{{ get_lesson_url(course.name, lesson_index) }}{{ course.query_parameter }}">
|
href="{{ get_lesson_url(course.name, lesson_index) }}{{ course.query_parameter }}">
|
||||||
{{ _("Continue Learning") }}
|
{{ _("Continue Learning") }}
|
||||||
</a>
|
</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 %}
|
{% endif %}
|
||||||
|
|
||||||
{% set progress = frappe.utils.cint(membership.progress) %}
|
{% set progress = frappe.utils.cint(membership.progress) %}
|
||||||
@@ -358,9 +358,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if certificate_request and not certificate %}
|
{% 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"),
|
{{ _("{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 %}
|
{% endif %}
|
||||||
|
|
||||||
{% if course.status == "Under Review" and is_instructor(course.name) %}
|
{% if course.status == "Under Review" and is_instructor(course.name) %}
|
||||||
@@ -370,7 +374,9 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if no_of_attempts and no_of_attempts >= course.max_attempts %}
|
{% 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 %}
|
{% endif %}
|
||||||
{% endmacro %}
|
{% 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