brotherton-erpnext/erpnext/www/lms/program.html

77 lines
2.1 KiB
HTML
Raw Normal View History

2019-05-19 10:31:45 +00:00
{% extends "templates/base.html" %}
{% block title %}{{ program.program_name }}{% endblock %}
2019-05-21 06:35:19 +00:00
{% from "www/lms/macros/hero.html" import hero %}
2019-05-19 10:31:45 +00:00
{% 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 %}
2019-05-20 06:25:17 +00:00
{% 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">
2019-06-05 07:38:53 +00:00
<a href="/lms/course?name={{ course.name }}&program={{ program.name }}" class="no-decoration no-underline">
2019-05-20 06:25:17 +00:00
<div class="card h-100">
2019-06-05 07:38:53 +00:00
{% 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"><i class="fa fa-picture-o" aria-hidden="true"></i></div>
</div>
{% endif %}
<div class='card-body'>
<h5 class='card-title'>{{ course.course_name }}</h5>
2019-06-05 12:19:42 +00:00
<div>{{ course.course_intro or '' }}</div>
2019-06-05 07:38:53 +00:00
</div>
{% if has_access and progress[course.name] %}
<div class='card-footer'>
{% if progress[course.name].completed %}
<span class="indicator green">Completed</span>
{% elif progress[course.name].started %}
<span class="indicator orange">In Progress</span>
2019-05-19 10:31:45 +00:00
{% else %}
2019-06-05 07:38:53 +00:00
<span class="indicator blue">Open</span>
2019-05-19 10:31:45 +00:00
{% endif %}
2019-06-05 07:38:53 +00:00
</div>
{% endif %}
2019-05-19 10:31:45 +00:00
</div>
2019-06-05 07:38:53 +00:00
</a>
2019-05-19 10:31:45 +00:00
</div>
{% endmacro %}
{% block content %}
2019-05-21 06:35:19 +00:00
<section class="section">
2019-06-05 12:19:42 +00:00
{{ hero(program.program_name, program.description, has_access, {'name': 'Home', 'url': '/lms'}) }}
2019-05-19 10:31:45 +00:00
<div class='container'>
<div class="row mt-5">
2019-06-05 07:38:53 +00:00
{% for course in courses %}
{{ card(course, loop.index, courses|length) }}
2019-05-19 10:31:45 +00:00
{% endfor %}
</div>
</div>
</section>
{% endblock %}