blob: 1182eb99da3490a15cc97cede7aa8093c02bd603 [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 Mishrad7e82982019-05-20 11:55:17 +05304
5{% block head_include %}
6 <style>
7 div.card-hero-img {
8 height: 220px;
9 background-size: cover;
10 background-repeat: no-repeat;
11 background-position: center;
12 background-color: rgb(250, 251, 252);
13 }
14
15 .card-image-wrapper {
16 display: flex;
17 overflow: hidden;
18 height: 220px;
19 background-color: rgb(250, 251, 252);
20 justify-content: center;
21 }
22
23 .image-body {
24 align-self: center;
25 color: #d1d8dd;
26 font-size: 24px;
27 font-weight: 600;
28 line-height: 1;
29 padding: 20px;
30 }
31 </style>
32{% endblock %}
33
34
35{% macro card(topic, index, length) %}
36<div class="col-sm-{{ 12 if length%3 == 1 and index == 1 else 6 if length%3 == 2 and index in [1,2] else 4}} mb-4 text-left">
37 <div class="card h-100">
Shivam Mishra24bd07d2019-05-30 16:36:58 +053038 {% if has_access %}
39 <a href="/lms/content?program={{ program }}&course={{ course.name }}&topic={{ topic.name }}&type={{ topic.topic_content[0].content_type }}&content={{ topic.topic_content[0].content }}" class="no-decoration no-underline">
Shivam Mishraae2871f2019-05-29 13:11:34 +053040 {% else %}
Shivam Mishra24bd07d2019-05-30 16:36:58 +053041 <div>
Shivam Mishraae2871f2019-05-29 13:11:34 +053042 {% endif %}
Shivam Mishrad7e82982019-05-20 11:55:17 +053043 {% if topic.hero_image %}
44 <div class="card-hero-img" style="background-image: url({{ topic.hero_image }})"></div>
45 {% else %}
46 <div class="card-image-wrapper text-center">
Shivam Mishra24bd07d2019-05-30 16:36:58 +053047 <div class="image-body"><i class="fa fa-picture-o" aria-hidden="true"></i></div>
Shivam Mishrad7e82982019-05-20 11:55:17 +053048 </div>
49 {% endif %}
50 <div class='card-body'>
51 <h5 class='card-title'>{{ topic.topic_name }}</h5>
52 <div>
53 <ol class="list-unstyled">
54 {% for content in topic.topic_content %}
Shivam Mishraae2871f2019-05-29 13:11:34 +053055 <li>
Shivam Mishra24bd07d2019-05-30 16:36:58 +053056 {% if has_access %}
57 <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 +053058 {{ content.content }}
59 </a>
Shivam Mishra24bd07d2019-05-30 16:36:58 +053060 {% else %}
61 <span class="text-muted">{{ content.content }}</span>
Shivam Mishraae2871f2019-05-29 13:11:34 +053062 {% endif %}
63 </li>
Shivam Mishrad7e82982019-05-20 11:55:17 +053064 {% endfor %}
65 </ol>
66 </div>
67 </div>
Shivam Mishra24bd07d2019-05-30 16:36:58 +053068 {% if has_access %}
Shivam Mishra87a74382019-05-21 12:05:19 +053069 <div class='card-footer'>
Shivam Mishra570161b2019-06-05 13:08:53 +053070 {% if progress[topic.name].completed %}
71 <span class="indicator green">Completed</span>
72 {% elif progress[topic.name].started %}
73 <span class="indicator orange">In Progress</span>
74 {% else %}
75 <span class="indicator blue">Open</span>
76 {% endif %}
Shivam Mishra87a74382019-05-21 12:05:19 +053077 </div>
Shivam Mishraae2871f2019-05-29 13:11:34 +053078 </a>
Shivam Mishra24bd07d2019-05-30 16:36:58 +053079 {% else %}
80 </div>
Shivam Mishraae2871f2019-05-29 13:11:34 +053081 {% endif %}
Shivam Mishrad7e82982019-05-20 11:55:17 +053082 </div>
83</div>
84{% endmacro %}
85
86{% block content %}
Shivam Mishra87a74382019-05-21 12:05:19 +053087<section class="section ">
Shivam Mishra65932632019-06-05 13:29:51 +053088 {{ hero(course.course_name, course.course_intro, has_access, {'name': 'Program', 'url': '/lms/program?program=' + program }) }}
Shivam Mishrad7e82982019-05-20 11:55:17 +053089 <div class='container'>
90 <div class="row mt-5">
91 {% for topic in topics %}
92 {{ card(topic.as_dict(), loop.index, topics|length) }}
93 {% endfor %}
94 </div>
95 </div>
96</section>
97{% endblock %}