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

106 lines
2.8 KiB
HTML
Raw Normal View History

2019-05-20 06:25:17 +00:00
{% extends "templates/base.html" %}
{% block title %}{{ course.course_name }}{% endblock %}
2019-05-21 06:35:19 +00:00
{% from "www/lms/macros/hero.html" import hero %}
2019-06-06 10:32:38 +00:00
{% from "www/lms/macros/card.html" import null_card %}
2019-05-20 06:25:17 +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;
}
2019-06-06 08:33:01 +00:00
section {
padding: 5rem 0 5rem 0;
}
2019-05-20 06:25:17 +00:00
</style>
{% endblock %}
2019-06-06 10:32:38 +00:00
{% macro card(topic) %}
<div class="col-sm-4 mb-4 text-left">
2019-05-20 06:25:17 +00:00
<div class="card h-100">
{% if has_access %}
2019-06-05 14:12:30 +00:00
<a href="/lms/topic?program={{ program }}&course={{ course.name }}&topic={{ topic.name }}" class="no-decoration no-underline">
{% else %}
<a href="/login#login">
{% endif %}
2019-05-20 06:25:17 +00:00
{% if topic.hero_image %}
<div class="card-hero-img" style="background-image: url('{{ topic.hero_image }}')"></div>
2019-05-20 06:25:17 +00:00
{% else %}
<div class="card-image-wrapper text-center">
<div class="image-body"><i class="fa fa-picture-o" aria-hidden="true"></i></div>
2019-05-20 06:25:17 +00:00
</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>
2019-05-20 06:25:17 +00:00
{% endfor %}
</ol>
</div>
</div>
{% if has_access %}
2019-05-21 06:35:19 +00:00
<div class='card-footer'>
2019-06-05 07:38:53 +00:00
{% if progress[topic.name].completed %}
<span class="indicator green">Completed</span>
{% elif progress[topic.name].started %}
<span class="indicator orange">In Progress</span>
{% else %}
2019-06-05 14:12:30 +00:00
<span class="indicator blue">Start</span>
2019-06-05 07:38:53 +00:00
{% endif %}
2019-05-21 06:35:19 +00:00
</div>
</a>
{% else %}
</a>
{% endif %}
2019-05-20 06:25:17 +00:00
</div>
</div>
{% endmacro %}
{% block content %}
2019-06-06 08:33:01 +00:00
<section class="section">
2019-06-05 14:12:30 +00:00
{{ hero(course.course_name, course.description, has_access, {'name': 'Program', 'url': '/lms/program?program=' + program }) }}
2019-05-20 06:25:17 +00:00
<div class='container'>
<div class="row mt-5">
{% for topic in topics %}
2019-06-06 10:32:38 +00:00
{{ card(topic) }}
2019-05-20 06:25:17 +00:00
{% endfor %}
2019-06-06 10:32:38 +00:00
{% if topics %}
2019-06-12 09:23:00 +00:00
{% for n in range( (3 - (topics|length)) %3) %}
2019-06-06 10:32:38 +00:00
{{ null_card() }}
{% endfor %}
{% endif %}
2019-05-20 06:25:17 +00:00
</div>
</div>
</section>
{% endblock %}