brotherton-erpnext/erpnext/www/lms/program.html
2019-05-21 12:05:19 +05:30

66 lines
1.7 KiB
HTML

{% extends "templates/base.html" %}
{% block title %}{{ program.program_name }}{% endblock %}
{% from "www/lms/macros/hero.html" import hero %}
{% block head_include %}
<style>
div.card-hero-img {
height: 220px;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
background-color: rgb(250, 251, 252);
}
.card-image-wrapper {
display: flex;
overflow: hidden;
height: 220px;
background-color: rgb(250, 251, 252);
justify-content: center;
}
.image-body {
align-self: center;
color: #d1d8dd;
font-size: 24px;
font-weight: 600;
line-height: 1;
padding: 20px;
}
</style>
{% endblock %}
{% macro card(course, index, length) %}
<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">
<div class="card h-100">
<a href="/lms/course?name={{ course.name }}&program={{ program.name }}" class="no-decoration no-underline">
{% if course.hero_image %}
<div class="card-hero-img" style="background-image: url({{ course.hero_image }})"></div>
{% else %}
<div class="card-image-wrapper text-center">
<div class="image-body">{{ course.course_name }}</div>
</div>
{% endif %}
<div class='card-body'>
<h5 class='card-title'>{{ course.course_name }}</h5>
<div>{{ course.course_intro }}</div>
</div>
</a>
</div>
</div>
{% endmacro %}
{% block content %}
<section class="section">
{{ hero(program.program_name, program.description) }}
<div class='container'>
<div class="row mt-5">
{% for course in program.courses %}
{{ card(frappe.get_doc("Course", course.course), loop.index, program.courses|length) }}
{% endfor %}
</div>
</div>
</section>
{% endblock %}