blob: c07b9402b104fdb896c606c796bb562a8e5e682a [file] [log] [blame]
Shivam Mishrad7e82982019-05-20 11:55:17 +05301{% extends "templates/base.html" %}
2{% block title %}{{ course.course_name }}{% endblock %}
Shivam Mishra87a74382019-05-21 12:05:19 +05303{% from "www/lms/macros/hero.html" import hero %}
Shivam Mishra2a0483d2019-06-06 16:02:38 +05304{% from "www/lms/macros/card.html" import null_card %}
Shivam Mishrad7e82982019-05-20 11:55:17 +05305
6{% block head_include %}
7 <style>
8 div.card-hero-img {
9 height: 220px;
10 background-size: cover;
11 background-repeat: no-repeat;
12 background-position: center;
13 background-color: rgb(250, 251, 252);
14 }
15
16 .card-image-wrapper {
17 display: flex;
18 overflow: hidden;
19 height: 220px;
20 background-color: rgb(250, 251, 252);
21 justify-content: center;
22 }
23
24 .image-body {
25 align-self: center;
26 color: #d1d8dd;
27 font-size: 24px;
28 font-weight: 600;
29 line-height: 1;
30 padding: 20px;
31 }
Shivam Mishrab3127652019-06-06 14:03:01 +053032 section {
33 padding: 5rem 0 5rem 0;
34 }
Shivam Mishrad7e82982019-05-20 11:55:17 +053035 </style>
36{% endblock %}
37
38
Shivam Mishra2a0483d2019-06-06 16:02:38 +053039{% macro card(topic) %}
40<div class="col-sm-4 mb-4 text-left">
Shivam Mishrad7e82982019-05-20 11:55:17 +053041 <div class="card h-100">
Shivam Mishra24bd07d2019-05-30 16:36:58 +053042 {% if has_access %}
Shivam Mishrad69892a2019-06-05 19:42:30 +053043 <a href="/lms/topic?program={{ program }}&course={{ course.name }}&topic={{ topic.name }}" class="no-decoration no-underline">
Shivam Mishraae2871f2019-05-29 13:11:34 +053044 {% else %}
Shivam Mishrab94b1fe2019-06-12 17:20:33 +053045 <a href="/login#login">
Shivam Mishraae2871f2019-05-29 13:11:34 +053046 {% endif %}
Shivam Mishrad7e82982019-05-20 11:55:17 +053047 {% if topic.hero_image %}
Shivam Mishra8af1e872019-06-12 15:16:26 +053048 <div class="card-hero-img" style="background-image: url('{{ topic.hero_image }}')"></div>
Shivam Mishrad7e82982019-05-20 11:55:17 +053049 {% else %}
50 <div class="card-image-wrapper text-center">
Shivam Mishra24bd07d2019-05-30 16:36:58 +053051 <div class="image-body"><i class="fa fa-picture-o" aria-hidden="true"></i></div>
Shivam Mishrad7e82982019-05-20 11:55:17 +053052 </div>
53 {% endif %}
54 <div class='card-body'>
55 <h5 class='card-title'>{{ topic.topic_name }}</h5>
56 <div>
57 <ol class="list-unstyled">
58 {% for content in topic.topic_content %}
Shivam Mishraae2871f2019-05-29 13:11:34 +053059 <li>
Shivam Mishra24bd07d2019-05-30 16:36:58 +053060 {% if has_access %}
61 <a class="text-muted" href="/lms/content?program={{ program }}&course={{ course.name }}&topic={{ topic.name }}&type={{ content.content_type }}&content={{ content.content }}">
Shivam Mishraae2871f2019-05-29 13:11:34 +053062 {{ content.content }}
63 </a>
Shivam Mishra24bd07d2019-05-30 16:36:58 +053064 {% else %}
65 <span class="text-muted">{{ content.content }}</span>
Shivam Mishraae2871f2019-05-29 13:11:34 +053066 {% endif %}
67 </li>
Shivam Mishrad7e82982019-05-20 11:55:17 +053068 {% endfor %}
69 </ol>
70 </div>
71 </div>
Shivam Mishra24bd07d2019-05-30 16:36:58 +053072 {% if has_access %}
Shivam Mishra87a74382019-05-21 12:05:19 +053073 <div class='card-footer'>
Shivam Mishra570161b2019-06-05 13:08:53 +053074 {% if progress[topic.name].completed %}
Alvaro43be1632020-06-22 07:36:12 +020075 <span class="indicator green">{{_('Completed')}}</span>
Shivam Mishra570161b2019-06-05 13:08:53 +053076 {% elif progress[topic.name].started %}
Alvaro43be1632020-06-22 07:36:12 +020077 <span class="indicator orange">{{_('In Progress')}}</span>
Shivam Mishra570161b2019-06-05 13:08:53 +053078 {% else %}
Alvaro43be1632020-06-22 07:36:12 +020079 <span class="indicator blue">{{_('Start')}}</span>
Shivam Mishra570161b2019-06-05 13:08:53 +053080 {% endif %}
Shivam Mishra87a74382019-05-21 12:05:19 +053081 </div>
Shivam Mishraae2871f2019-05-29 13:11:34 +053082 </a>
Shivam Mishra24bd07d2019-05-30 16:36:58 +053083 {% else %}
Shivam Mishrab94b1fe2019-06-12 17:20:33 +053084 </a>
Shivam Mishraae2871f2019-05-29 13:11:34 +053085 {% endif %}
Shivam Mishrad7e82982019-05-20 11:55:17 +053086 </div>
87</div>
88{% endmacro %}
89
90{% block content %}
Shivam Mishrab3127652019-06-06 14:03:01 +053091<section class="section">
Shivam Mishrad69892a2019-06-05 19:42:30 +053092 {{ hero(course.course_name, course.description, has_access, {'name': 'Program', 'url': '/lms/program?program=' + program }) }}
Shivam Mishrad7e82982019-05-20 11:55:17 +053093 <div class='container'>
94 <div class="row mt-5">
95 {% for topic in topics %}
Shivam Mishra2a0483d2019-06-06 16:02:38 +053096 {{ card(topic) }}
Shivam Mishrad7e82982019-05-20 11:55:17 +053097 {% endfor %}
Shivam Mishra2a0483d2019-06-06 16:02:38 +053098 {% if topics %}
Shivam Mishra278ef4b2019-06-12 14:53:00 +053099 {% for n in range( (3 - (topics|length)) %3) %}
Shivam Mishra2a0483d2019-06-06 16:02:38 +0530100 {{ null_card() }}
101 {% endfor %}
102 {% endif %}
Shivam Mishrad7e82982019-05-20 11:55:17 +0530103 </div>
104 </div>
105</section>
Ankush Menat4551d7d2021-08-19 13:41:10 +0530106{% endblock %}