Merge branch 'main' of https://github.com/frappe/lms
This commit is contained in:
@@ -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