blob: 68128dca1d991783bcee4f5f023868f869453730 [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 Mishra87a74382019-05-21 12:05:19 +053038 <a href="/lms/content?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 Mishrad7e82982019-05-20 11:55:17 +053039 {% if topic.hero_image %}
40 <div class="card-hero-img" style="background-image: url({{ topic.hero_image }})"></div>
41 {% else %}
42 <div class="card-image-wrapper text-center">
43 <div class="image-body">{{ topic.topic_name }}</div>
44 </div>
45 {% endif %}
46 <div class='card-body'>
47 <h5 class='card-title'>{{ topic.topic_name }}</h5>
48 <div>
49 <ol class="list-unstyled">
50 {% for content in topic.topic_content %}
Shivam Mishra87a74382019-05-21 12:05:19 +053051 <li><a class="text-muted" href="/lms/content?course={{ course.name }}&topic={{ topic.name }}&type={{ content.content_type }}&content={{ content.content }}">{{ content.content }}</li></a>
Shivam Mishrad7e82982019-05-20 11:55:17 +053052 {% endfor %}
53 </ol>
54 </div>
55 </div>
Shivam Mishra87a74382019-05-21 12:05:19 +053056 {% if index==1 %}
57 <div class='card-footer'>
58 <i class="fa fa-check-circle text-success"></i> Completed
59 </div>
60 {% else %}
61 <div class='card-footer'>
62 <i class="fa fa-circle-o text-warning"></i> In Progress
63 </div>
64 {% endif %}
Shivam Mishrad7e82982019-05-20 11:55:17 +053065 </a>
66 </div>
67</div>
68{% endmacro %}
69
70{% block content %}
Shivam Mishra87a74382019-05-21 12:05:19 +053071<section class="section ">
72 {{ hero(course.course_name, course.course_intro) }}
Shivam Mishrad7e82982019-05-20 11:55:17 +053073 <div class='container'>
74 <div class="row mt-5">
75 {% for topic in topics %}
76 {{ card(topic.as_dict(), loop.index, topics|length) }}
77 {% endfor %}
78 </div>
79 </div>
80</section>
81{% endblock %}