Merge branch 'main' of https://github.com/frappe/lms into lms-frappe-ui
This commit is contained in:
@@ -11,6 +11,10 @@ class BatchStudent(Document):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def enroll_batch(batch_name):
|
def enroll_batch(batch_name):
|
||||||
|
if frappe.db.exists(
|
||||||
|
"Batch Student", {"student": frappe.session.user, "parent": batch_name}
|
||||||
|
):
|
||||||
|
frappe.throw("You are already enrolled in this batch")
|
||||||
enrollment = frappe.new_doc("Batch Student")
|
enrollment = frappe.new_doc("Batch Student")
|
||||||
enrollment.student = frappe.session.user
|
enrollment.student = frappe.session.user
|
||||||
enrollment.parent = batch_name
|
enrollment.parent = batch_name
|
||||||
|
|||||||
@@ -150,7 +150,7 @@
|
|||||||
href="/billing/batch/{{ batch_info.name }}">
|
href="/billing/batch/{{ batch_info.name }}">
|
||||||
{{ _("Register Now") }}
|
{{ _("Register Now") }}
|
||||||
</a>
|
</a>
|
||||||
{% elif batch_info.allow_self_enrollment %}
|
{% elif batch_info.allow_self_enrollment and batch_info.seat_count and seats_left %}
|
||||||
<button class="btn btn-primary wide-button enroll-batch">
|
<button class="btn btn-primary wide-button enroll-batch">
|
||||||
{{ _("Enroll Now") }}
|
{{ _("Enroll Now") }}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="field-label">
|
<div class="field-label">
|
||||||
{{ _("Total Price: ") }}
|
{{ _("Total Price: ") }}
|
||||||
<span class="total-price">{{ frappe.utils.fmt_money(amount, 2, currency) }}</span>
|
<span class="total-price">{{ frappe.utils.fmt_money(amount_with_gst, 2, currency) if gst_applied else frappe.utils.fmt_money(amount, 2, currency) }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% if gst_applied %}
|
{% if gst_applied %}
|
||||||
|
|||||||
@@ -17,9 +17,7 @@ def get_context(context):
|
|||||||
|
|
||||||
context.original_currency = context.currency
|
context.original_currency = context.currency
|
||||||
context.original_amount = (
|
context.original_amount = (
|
||||||
apply_gst(context.amount, None)[0]
|
(context.amount * 1.18) if context.original_currency == "INR" else context.amount
|
||||||
if context.original_currency == "INR"
|
|
||||||
else context.amount
|
|
||||||
)
|
)
|
||||||
|
|
||||||
context.exception_country = frappe.get_all(
|
context.exception_country = frappe.get_all(
|
||||||
@@ -32,7 +30,7 @@ def get_context(context):
|
|||||||
|
|
||||||
context.address = get_address()
|
context.address = get_address()
|
||||||
if context.currency == "INR":
|
if context.currency == "INR":
|
||||||
context.amount, context.gst_applied = apply_gst(context.amount, None)
|
context.amount_with_gst, context.gst_applied = apply_gst(context.amount, None)
|
||||||
|
|
||||||
|
|
||||||
def validate_access(doctype, docname, module):
|
def validate_access(doctype, docname, module):
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
{% extends "www/cohorts/base.html" %} {% block title %} {{ _("Manage") }} {{
|
{% extends "www/cohorts/base.html" %} {% block title %} {{ _("Manage") }} {{
|
||||||
course.title }} {% endblock %} {% block page_content %}
|
course.title }} {% endblock %} {% block page_content %}
|
||||||
<div class="course-home-headings">{{ cohort.title }}</div>
|
<div class="course-home-headings">{{ cohort.title }}</div>
|
||||||
|
{% if cohort.description %}
|
||||||
|
<div>
|
||||||
|
{{ frappe.utils.md_to_html(cohort.description) }}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
{{ frappe.db.count("Cohort Subgroup", {"cohort": cohort.name}) }} {{
|
{{ frappe.db.count("Cohort Subgroup", {"cohort": cohort.name}) }} {{
|
||||||
|
|||||||
@@ -169,3 +169,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
{% block script %}
|
||||||
|
<script>
|
||||||
|
frappe.telemetry.capture("active_site", "lms");
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user