blob: d364e5e1d9ab6413efc57f6a0b45ddfbe5f212e8 [file] [log] [blame]
Shivam Mishra823c7952019-05-19 16:01:45 +05301{% extends "templates/base.html" %}
2{% block title %}{{ program.program_name }}{% endblock %}
Shivam Mishra87a74382019-05-21 12:05:19 +05303{% from "www/lms/macros/hero.html" import hero %}
Shivam Mishra823c7952019-05-19 16:01:45 +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
Shivam Mishrad7e82982019-05-20 11:55:17 +053035{% macro card(course, 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/course?name={{ course.name }}&program={{ program.name }}" class="no-decoration no-underline">
Shivam Mishrad7e82982019-05-20 11:55:17 +053039 {% if course.hero_image %}
40 <div class="card-hero-img" style="background-image: url({{ course.hero_image }})"></div>
Shivam Mishra823c7952019-05-19 16:01:45 +053041 {% else %}
42 <div class="card-image-wrapper text-center">
Shivam Mishra24bd07d2019-05-30 16:36:58 +053043 <div class="image-body"><i class="fa fa-picture-o" aria-hidden="true"></i></div>
Shivam Mishra823c7952019-05-19 16:01:45 +053044 </div>
45 {% endif %}
46 <div class='card-body'>
Shivam Mishrad7e82982019-05-20 11:55:17 +053047 <h5 class='card-title'>{{ course.course_name }}</h5>
48 <div>{{ course.course_intro }}</div>
Shivam Mishra823c7952019-05-19 16:01:45 +053049 </div>
50 </a>
51 </div>
52</div>
53{% endmacro %}
54
55{% block content %}
Shivam Mishra87a74382019-05-21 12:05:19 +053056<section class="section">
Shivam Mishra24bd07d2019-05-30 16:36:58 +053057 {{ hero(program.program_name, program.description, has_access) }}
Shivam Mishra823c7952019-05-19 16:01:45 +053058 <div class='container'>
59 <div class="row mt-5">
Shivam Mishrad7e82982019-05-20 11:55:17 +053060 {% for course in program.courses %}
61 {{ card(frappe.get_doc("Course", course.course), loop.index, program.courses|length) }}
Shivam Mishra823c7952019-05-19 16:01:45 +053062 {% endfor %}
63 </div>
64 </div>
65</section>
66{% endblock %}