refactor: all programs are shown on home by deafult

This commit is contained in:
Shivam Mishra 2019-06-06 14:19:36 +05:30
parent 098b8324f2
commit 6132c8527b
3 changed files with 0 additions and 66 deletions

View File

@ -1,54 +0,0 @@
{% extends "templates/base.html" %}
{% block title %}All Programs{% endblock %}
{% from "www/lms/macros/card.html" import program_card %}
{% 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;
}
section {
padding: 5rem 0 5rem 0;
}
</style>
{% endblock %}
{% block content %}
<section class="top-section ">
<div class='container pb-5'>
<h1>All Programs</h1>
<p class="mt-4">
<a class="btn btn-primary btn-lg" href="{{ '/login#signup' if frappe.session.user == 'Guest' else '/lms/all-programs' }}">{{ 'Start Learning' if frappe.session.user == 'Guest' else 'Explore Programs'}}</a>
</p>
</div>
<div class='container'>
<div class="row mt-5">
{% for program in all_programs %}
{{ program_card(program.program, program.has_access) }}
{% endfor %}
</div>
</div>
</section>
{% endblock %}

View File

@ -1,9 +0,0 @@
from __future__ import unicode_literals
import erpnext.education.utils as utils
import frappe
no_cache = 1
def get_context(context):
context.education_settings = frappe.get_single("Education Settings")
context.all_programs = utils.get_portal_programs()

View File

@ -52,9 +52,6 @@
{{ program_card(program.program, program.has_access) }}
{% endfor %}
</div>
<p class='mt-4'>
<a href='/lms/all-programs' class='text-muted'>View All Programs</a>
</p>
</div>
</section>
{% endblock %}