Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

88 lines
2.3 KiB
HTML
Raw Normal View History

2019-05-19 16:01:45 +05:30
{% extends "templates/base.html" %}
{% block title %}{{ program.program_name }}{% endblock %}
2019-05-21 12:05:19 +05:30
{% from "www/lms/macros/hero.html" import hero %}
2019-06-06 16:02:38 +05:30
{% from "www/lms/macros/card.html" import null_card %}
2019-05-19 16:01:45 +05:30
{% 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;
}
2019-06-06 14:03:01 +05:30
section {
padding: 5rem 0 5rem 0;
}
2019-05-19 16:01:45 +05:30
</style>
{% endblock %}
2019-06-06 16:02:38 +05:30
{% macro card(course) %}
<div class="col-sm-4 mb-4 text-left">
2019-06-05 13:08:53 +05:30
<a href="/lms/course?name={{ course.name }}&program={{ program.name }}" class="no-decoration no-underline">
2019-05-20 11:55:17 +05:30
<div class="card h-100">
2019-06-05 13:08:53 +05:30
{% if course.hero_image %}
2019-06-07 13:03:46 +05:30
<div class="card-hero-img" style="background-image: url('{{ course.hero_image }}')"></div>
2019-06-05 13:08:53 +05:30
{% 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-06 16:02:38 +05:30
<div class="text-muted">{{ course.description[:110] + '...' if course.description else '' }}</div>
2019-06-05 13:08:53 +05:30
</div>
{% if has_access and progress[course.name] %}
<div class='card-footer'>
{% if progress[course.name].completed %}
<span class="indicator green">{{_('Completed')}}</span>
2019-06-05 13:08:53 +05:30
{% elif progress[course.name].started %}
<span class="indicator orange">{{_('In Progress')}}</span>
2019-05-19 16:01:45 +05:30
{% else %}
<span class="indicator blue">{{_('Start')}}</span>
2019-05-19 16:01:45 +05:30
{% endif %}
2019-06-05 13:08:53 +05:30
</div>
{% endif %}
2019-05-19 16:01:45 +05:30
</div>
2019-06-05 13:08:53 +05:30
</a>
2019-05-19 16:01:45 +05:30
</div>
{% endmacro %}
{% block content %}
2019-05-21 12:05:19 +05:30
<section class="section">
2019-06-05 17:49:42 +05:30
{{ hero(program.program_name, program.description, has_access, {'name': 'Home', 'url': '/lms'}) }}
2019-05-19 16:01:45 +05:30
<div class='container'>
<div class="row mt-5">
2019-06-05 13:08:53 +05:30
{% for course in courses %}
2019-06-06 16:02:38 +05:30
{{ card(course) }}
2019-05-19 16:01:45 +05:30
{% endfor %}
2019-06-06 16:02:38 +05:30
{% if courses %}
2019-06-12 14:53:00 +05:30
{% for n in range( (3 - (courses|length)) %3) %}
2019-06-06 16:02:38 +05:30
{{ null_card() }}
{% endfor %}
{% endif %}
2019-05-19 16:01:45 +05:30
</div>
</div>
</section>
{% endblock %}