Merge pull request #627 from pateljannat/batch-meta

feat: batch meta and raw details
This commit is contained in:
Jannat Patel
2023-09-27 19:46:28 +05:30
committed by GitHub
5 changed files with 59 additions and 1 deletions

View File

@@ -14,6 +14,7 @@
{{ CourseList(courses) }}
</div>
</div>
{{ BatchDetailsRaw() }}
</div>
{% endblock %}
@@ -216,6 +217,15 @@
</div>
{% endmacro %}
{% macro BatchDetailsRaw() %}
{% if batch_info.batch_details_raw %}
<div class="mt-10 pt-10">
{{ batch_info.batch_details_raw }}
</div>
{% endif %}
{% endmacro %}
{%- block script %}
{{ super() }}
{% if is_moderator %}

View File

@@ -29,6 +29,8 @@ def get_context(context):
"end_time",
"seat_count",
"published",
"meta_image",
"batch_details_raw",
],
as_dict=1,
)
@@ -67,3 +69,11 @@ def get_context(context):
context.student_count = frappe.db.count("Batch Student", {"parent": batch_name})
context.seats_left = context.batch_info.seat_count - context.student_count
context.metatags = {
"title": context.batch_info.title,
"image": context.batch_info.meta_image,
"description": context.batch_info.description,
"keywords": context.batch_info.title,
"og:type": "website",
}