refactor: learn page
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{{ Sidebar(course_slug, batch_code) }}
|
{{ Sidebar(course.name, batch.name) }}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
{{ CourseBasicDetail(course)}}
|
{{ CourseBasicDetail(course)}}
|
||||||
{{ InstructorsSection(course.get_instructor()) }}
|
{{ InstructorsSection(course.get_instructor()) }}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{{ Sidebar(course, batch_code) }}
|
{{ Sidebar(course.name, batch.name) }}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -1,8 +1,21 @@
|
|||||||
import frappe
|
import frappe
|
||||||
from community.www.courses.utils import redirect_if_not_a_member
|
from community.lms.models import Course
|
||||||
|
|
||||||
def get_context(context):
|
def get_context(context):
|
||||||
context.no_cache = 1
|
context.no_cache = 1
|
||||||
context.course = frappe.form_dict["course"]
|
|
||||||
context.batch_code = frappe.form_dict["batch"]
|
course_name = frappe.form_dict["course"]
|
||||||
redirect_if_not_a_member(context.course, context.batch_code)
|
batch_name = frappe.form_dict["batch"]
|
||||||
|
|
||||||
|
course = Course.find(course_name)
|
||||||
|
if not course:
|
||||||
|
context.template = "www/404.html"
|
||||||
|
return
|
||||||
|
|
||||||
|
batch = course.get_batch(batch_name)
|
||||||
|
if not batch:
|
||||||
|
frappe.local.flags.redirect_location = "/courses/" + course_name
|
||||||
|
raise frappe.Redirect
|
||||||
|
|
||||||
|
context.course = course
|
||||||
|
context.batch = batch
|
||||||
|
|||||||
Reference in New Issue
Block a user