Shivam Mishra | d69892a | 2019-06-05 19:42:30 +0530 | [diff] [blame] | 1 | {% extends "templates/base.html" %} |
| 2 | {% block title %}Topic Title{% endblock %} |
| 3 | {% from "www/lms/macros/hero.html" import hero %} |
| 4 | |
Shivam Mishra | b312765 | 2019-06-06 14:03:01 +0530 | [diff] [blame^] | 5 | {% block head_include %} |
| 6 | <style> |
| 7 | section { |
| 8 | padding: 5rem 0 5rem 0; |
| 9 | } |
| 10 | </style> |
| 11 | {% endblock %} |
| 12 | |
Shivam Mishra | d69892a | 2019-06-05 19:42:30 +0530 | [diff] [blame] | 13 | |
| 14 | {% macro card(content, index, length) %} |
| 15 | <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"> |
| 16 | <a href="/lms/content?program={{ program }}&course={{ course }}&topic={{ topic.name }}&type={{ content.content_type }}&content={{ content.content.name }}" class="no-decoration no-underline"> |
| 17 | <div class="card h-100"> |
| 18 | <div class='card-body'> |
| 19 | <div>{{ content.content_type or '' }}</div> |
| 20 | <h5 class='card-title'>{{ content.content.name }}</h5> |
| 21 | </div> |
| 22 | {% if has_access %} |
| 23 | <div class='card-footer'> |
| 24 | {% if content.content_type == 'Quiz' %} |
| 25 | {% if content.result == 'Fail' %} <span class="indicator red">Fail <span class="text-muted">({{ content.score }}/100)</span></span> |
| 26 | {% elif content.result == 'Pass' %} <span class="indicator green">Pass <span class="text-muted">({{ content.score }}/100)</span> |
| 27 | {% else %} <span class="indicator blue">Start</span> |
| 28 | {% endif %} |
| 29 | {% else %} |
| 30 | {% if content.completed %} <span class="indicator green">Completed</span> |
| 31 | {% else %} <span class="indicator blue">Start</span> |
| 32 | {% endif %} |
| 33 | {% endif %} |
| 34 | </div> |
| 35 | {% endif %} |
| 36 | </div> |
| 37 | </a> |
| 38 | </div> |
| 39 | {% endmacro %} |
| 40 | |
| 41 | {% block content %} |
| 42 | <section class="section"> |
| 43 | {{ hero(topic.topic_name, topic.description, has_access, {'name': 'Course', 'url': '/lms/course?name=' + course +'&program=' + program}) }} |
| 44 | <div class='container'> |
| 45 | <div class="row mt-5"> |
| 46 | {% for content in contents %} |
| 47 | {{ card(content, loop.index, topic.contents|length) }} |
| 48 | {% endfor %} |
| 49 | </div> |
| 50 | </div> |
| 51 | </section> |
| 52 | {% endblock %} |