blob: 30b594d9035218bc9e17fb0d4a0c22c86f8fec31 [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 Mishraae2871f2019-05-29 13:11:34 +053038 {% if frappe.session.user == 'Guest' %}
39 <div>
40 {% else %}
41 <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">
42 {% 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">
47 <div class="image-body">{{ topic.topic_name }}</div>
48 </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>
56 {% if frappe.session.user == 'Guest' %}
57 <span class="text-muted">{{ content.content }}</span>
58 {% else %}
59 <a class="text-muted" href="/lms/content?course={{ course.name }}&topic={{ topic.name }}&type={{ content.content_type }}&content={{ content.content }}">
60 {{ content.content }}
61 </a>
62 {% endif %}
63 </li>
Shivam Mishrad7e82982019-05-20 11:55:17 +053064 {% endfor %}
65 </ol>
66 </div>
67 </div>
Shivam Mishraae2871f2019-05-29 13:11:34 +053068 {% if frappe.session.user == 'Guest' %}
Shivam Mishra87a74382019-05-21 12:05:19 +053069 </div>
Shivam Mishraae2871f2019-05-29 13:11:34 +053070 {% else %}
Shivam Mishra87a74382019-05-21 12:05:19 +053071 <div class='card-footer'>
Shivam Mishraae2871f2019-05-29 13:11:34 +053072 {% if index==1 %} <span class="indicator green"> Completed </span>
73 {% else %} <span class="indicator orange"> Completed </span>
74 {% endif %}
Shivam Mishra87a74382019-05-21 12:05:19 +053075 </div>
Shivam Mishraae2871f2019-05-29 13:11:34 +053076 </a>
77 {% endif %}
Shivam Mishrad7e82982019-05-20 11:55:17 +053078 </div>
79</div>
80{% endmacro %}
81
82{% block content %}
Shivam Mishra87a74382019-05-21 12:05:19 +053083<section class="section ">
84 {{ hero(course.course_name, course.course_intro) }}
Shivam Mishrad7e82982019-05-20 11:55:17 +053085 <div class='container'>
86 <div class="row mt-5">
87 {% for topic in topics %}
88 {{ card(topic.as_dict(), loop.index, topics|length) }}
89 {% endfor %}
90 </div>
91 </div>
92</section>
93{% endblock %}