Files
lms/school/www/cohorts/index.html
Anand Chitipothu 102fa9c0a8 feat: added a page to list cohorts of a course
- added a page /courses/<course>/manage that lists the active cohorts
- only accessible to mentors and staff
- also added a "manage the course" button on course page for mentors/staff

Issue #271
2021-11-29 17:33:45 +05:30

35 lines
919 B
HTML

{% extends "www/cohorts/base.html" %}
{% block title %}Manage {{ course.title }}{% endblock %}
{% block page_content %}
<div class="common-page-style">
<div class="container">
{% if cohorts %}
<h2>Cohorts</h2>
<div class="row">
{% for cohort in cohorts %}
<div class="col-md-4">
{{ render_cohort(course, cohort) }}
</div>
{% endfor %}
{% else %}
<h2>Permission Denied</h2>
<p>You don't have permission to manage this course.</p>
{% endif %}
</div>
</div>
</div>
{% 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>
<a href="/courses/{{course.name}}/cohorts/{{cohort.slug}}" class="card-link">Manage</a>
</div>
</div>
{% endmacro %}