Shivam Mishra | d7e8298 | 2019-05-20 11:55:17 +0530 | [diff] [blame^] | 1 | {% extends "templates/base.html" %} |
| 2 | {% block title %}{{ course.course_name }}{% endblock %} |
| 3 | |
| 4 | {% block head_include %} |
| 5 | <style> |
| 6 | div.card-hero-img { |
| 7 | height: 220px; |
| 8 | background-size: cover; |
| 9 | background-repeat: no-repeat; |
| 10 | background-position: center; |
| 11 | background-color: rgb(250, 251, 252); |
| 12 | } |
| 13 | |
| 14 | .card-image-wrapper { |
| 15 | display: flex; |
| 16 | overflow: hidden; |
| 17 | height: 220px; |
| 18 | background-color: rgb(250, 251, 252); |
| 19 | justify-content: center; |
| 20 | } |
| 21 | |
| 22 | .image-body { |
| 23 | align-self: center; |
| 24 | color: #d1d8dd; |
| 25 | font-size: 24px; |
| 26 | font-weight: 600; |
| 27 | line-height: 1; |
| 28 | padding: 20px; |
| 29 | } |
| 30 | </style> |
| 31 | {% endblock %} |
| 32 | |
| 33 | |
| 34 | {% macro card(topic, index, length) %} |
| 35 | <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"> |
| 36 | <div class="card h-100"> |
| 37 | <a href="/lms/content?topic={{ topic.name }}&type=Content" class="no-decoration no-underline"> |
| 38 | {% if topic.hero_image %} |
| 39 | <div class="card-hero-img" style="background-image: url({{ topic.hero_image }})"></div> |
| 40 | {% else %} |
| 41 | <div class="card-image-wrapper text-center"> |
| 42 | <div class="image-body">{{ topic.topic_name }}</div> |
| 43 | </div> |
| 44 | {% endif %} |
| 45 | <div class='card-body'> |
| 46 | <h5 class='card-title'>{{ topic.topic_name }}</h5> |
| 47 | <div> |
| 48 | <ol class="list-unstyled"> |
| 49 | {% for content in topic.topic_content %} |
| 50 | <li><a class="text-muted" href="/lms/content?topic={{ topic.name }}&type={{ content.content_type }}&content={{ content.content }}">{{ content.content }}</li></a> |
| 51 | {% endfor %} |
| 52 | </ol> |
| 53 | </div> |
| 54 | </div> |
| 55 | </a> |
| 56 | </div> |
| 57 | </div> |
| 58 | {% endmacro %} |
| 59 | |
| 60 | {% block content %} |
| 61 | <section class="top-section "> |
| 62 | <div class='container pb-5'> |
| 63 | <h1>{{ course.course_name }}</h1> |
| 64 | <p class='lead'>{{ course.course_intro }}</p> |
| 65 | <p class="mt-4"> |
| 66 | <a class="btn btn-primary btn-lg" style="width: 170px;" href="/login#signup">Sign Up</a> |
| 67 | </p> |
| 68 | </div> |
| 69 | <div class='container'> |
| 70 | <div class="row mt-5"> |
| 71 | {% for topic in topics %} |
| 72 | {{ card(topic.as_dict(), loop.index, topics|length) }} |
| 73 | {% endfor %} |
| 74 | </div> |
| 75 | </div> |
| 76 | </section> |
| 77 | {% endblock %} |