93 lines
2.6 KiB
HTML
93 lines
2.6 KiB
HTML
{% extends "templates/base.html" %}
|
|
{% block title %}{{ course.course_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(topic, 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">
|
|
{% if has_access %}
|
|
<a href="/lms/content?program={{ program }}&course={{ course.name }}&topic={{ topic.name }}&type={{ topic.topic_content[0].content_type }}&content={{ topic.topic_content[0].content }}" class="no-decoration no-underline">
|
|
{% else %}
|
|
<div>
|
|
{% endif %}
|
|
{% if topic.hero_image %}
|
|
<div class="card-hero-img" style="background-image: url({{ topic.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'>{{ topic.topic_name }}</h5>
|
|
<div>
|
|
<ol class="list-unstyled">
|
|
{% for content in topic.topic_content %}
|
|
<li>
|
|
{% if has_access %}
|
|
<a class="text-muted" href="/lms/content?program={{ program }}&course={{ course.name }}&topic={{ topic.name }}&type={{ content.content_type }}&content={{ content.content }}">
|
|
{{ content.content }}
|
|
</a>
|
|
{% else %}
|
|
<span class="text-muted">{{ content.content }}</span>
|
|
{% endif %}
|
|
</li>
|
|
{% endfor %}
|
|
</ol>
|
|
</div>
|
|
</div>
|
|
{% if has_access %}
|
|
<div class='card-footer'>
|
|
{% if index==1 %} <span class="indicator green"> Completed </span>
|
|
{% else %} <span class="indicator orange"> Completed </span>
|
|
{% endif %}
|
|
</div>
|
|
</a>
|
|
{% else %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endmacro %}
|
|
|
|
{% block content %}
|
|
<section class="section ">
|
|
{{ hero(course.course_name, course.course_intro, has_access) }}
|
|
<div class='container'>
|
|
<div class="row mt-5">
|
|
{% for topic in topics %}
|
|
{{ card(topic.as_dict(), loop.index, topics|length) }}
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
</section>
|
|
{% endblock %} |