feat: paid courses
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
{{ Description(course) }}
|
||||
{{ widgets.CourseOutline(course=course, membership=membership, is_user_interested=is_user_interested) }}
|
||||
{% if course.status == "Approved" and not frappe.utils.cint(course.upcoming) %}
|
||||
{% include "lms/templates/reviews.html" %}
|
||||
{% include "lms/templates/reviews.html" %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -136,18 +136,8 @@
|
||||
{{ get_lessons(course.name, None, False) }} {{ _("Lessons") }}
|
||||
</div>
|
||||
|
||||
{% if course.enable_certification %}
|
||||
<div class="vertically-center mb-3">
|
||||
<svg class="icon icon-md mr-1">
|
||||
<use href="#icon-badge"></use>
|
||||
</svg>
|
||||
{{ _("Get Certified") }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{{ SlotModal(course) }}
|
||||
|
||||
{% endmacro %}
|
||||
|
||||
@@ -231,8 +221,13 @@
|
||||
{{ _("Continue Learning") }}
|
||||
</a>
|
||||
|
||||
{% elif course.paid_course %}
|
||||
<a class="btn btn-primary wide-button" id="buy-course">
|
||||
{{ _("Buy This Course") }}
|
||||
</a>
|
||||
|
||||
{% elif show_start_learing_cta(course, membership) %}
|
||||
<div class="btn btn-primary wide-button join-batch" data-course="{{ course.name | urlencode }}">
|
||||
<div class="btn btn-primary wide-button enroll-in-course" data-course="{{ course.name | urlencode }}">
|
||||
{{ _("Start Learning") }}
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -245,11 +240,6 @@
|
||||
{{ _("Get Certificate") }}
|
||||
</a>
|
||||
|
||||
{% elif eligible_for_evaluation %}
|
||||
<a class="btn btn-secondary wide-button mt-2" id="apply-certificate" data-course="{{ course.name }}">
|
||||
{{ _("Apply for Certificate") }}
|
||||
</a>
|
||||
|
||||
{% elif course.grant_certificate_after == "Completion" and progress == 100 %}
|
||||
<div class="btn btn-secondary wide-button mt-2" id="certification" data-course="{{ course.name }}">
|
||||
{{ _("Get Certificate") }}
|
||||
@@ -279,16 +269,6 @@
|
||||
{{ _("You have opted to be notified for this course. You will receive an email when the course becomes available.") }}
|
||||
</div>
|
||||
|
||||
{% if certificate_request and not certificate %}
|
||||
<p class="mb-2">
|
||||
<b>
|
||||
{{ _("Evaluation On: ") }}
|
||||
</b>
|
||||
{{ _("{0} at {1}").format(frappe.utils.format_date(certificate_request.date, "medium"),
|
||||
frappe.utils.format_time(certificate_request.start_time, "short")) }}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% if course.status == "Under Review" and is_instructor(course.name) %}
|
||||
<div class="mb-4">
|
||||
{{ _("This course is currently under review. Once the review is complete, the System Admins will publish it on the website.") }}
|
||||
@@ -301,54 +281,3 @@
|
||||
</p>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
|
||||
<!-- Modal for Slots -->
|
||||
{% macro SlotModal(course) %}
|
||||
<div class="modal fade" id="slot-modal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<div class="modal-title">{{ _("Pick a Slot") }}</div>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="slot-form">
|
||||
<p class="">{{ _("This course requires you to complete an evaluation to get certified. Please pick a slot based on your convenience for the evaluations. ") }}</p>
|
||||
<div class="form-group">
|
||||
<div class="clearfix">
|
||||
<label class="control-label reqd" style="padding-right: 0px;">{{ _("Date") }}</label>
|
||||
</div>
|
||||
<div class="control-input-wrapper">
|
||||
<div class="control-input">
|
||||
<input type="date" class="input-with-feedback form-control bold" data-fieldtype="Date" data-course="{{ course.name | urlencode }}"
|
||||
id="slot-date" min="{{ frappe.utils.format_date(frappe.utils.add_days(frappe.utils.getdate(), 1), 'yyyy-mm-dd') }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="clearfix">
|
||||
<label class="control-label reqd slot-label hide" style="padding-right: 0px;">{{ _("Slots") }}</label>
|
||||
</div>
|
||||
<div class="control-input-wrapper">
|
||||
<div class="control-input">
|
||||
<div class="slots"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p id="no-slots-message" class="small text-danger hide"> {{ _("There are no slots available on this day.") }} </p>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-secondary btn-sm pull-right mr-2 close-slot-modal" data-dismiss="modal" aria-label="Close">
|
||||
{{ _("Discard") }}
|
||||
</button>
|
||||
|
||||
<button class="btn btn-primary btn-sm pull-right" data-course="{{ course.name | urlencode}}" id="submit-slot">
|
||||
{{ _("Submit") }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
|
||||
@@ -52,13 +52,10 @@ def set_course_context(context, course_name):
|
||||
"disable_self_learning",
|
||||
"status",
|
||||
"video_link",
|
||||
"enable_certification",
|
||||
"grant_certificate_after",
|
||||
"paid_certificate",
|
||||
"price_certificate",
|
||||
"paid_course",
|
||||
"course_price",
|
||||
"currency",
|
||||
"max_attempts",
|
||||
"duration",
|
||||
"grant_certificate_after",
|
||||
],
|
||||
as_dict=True,
|
||||
)
|
||||
@@ -79,7 +76,7 @@ def set_course_context(context, course_name):
|
||||
frappe.db.get_value(
|
||||
"LMS Course",
|
||||
csr.course,
|
||||
["name", "upcoming", "title", "image", "enable_certification"],
|
||||
["name", "upcoming", "title", "image"],
|
||||
as_dict=True,
|
||||
)
|
||||
)
|
||||
@@ -94,7 +91,6 @@ def set_course_context(context, course_name):
|
||||
context.certificate = is_certified(course.name)
|
||||
eval_details = get_evaluation_details(course.name)
|
||||
context.eligible_for_evaluation = eval_details.eligible
|
||||
context.certificate_request = eval_details.request
|
||||
context.no_of_attempts = eval_details.no_of_attempts
|
||||
if context.course.upcoming:
|
||||
context.is_user_interested = get_user_interest(context.course.name)
|
||||
|
||||
@@ -45,9 +45,8 @@ def get_courses():
|
||||
"title",
|
||||
"short_introduction",
|
||||
"image",
|
||||
"enable_certification",
|
||||
"paid_certificate",
|
||||
"price_certificate",
|
||||
"paid_course",
|
||||
"course_price",
|
||||
"currency",
|
||||
],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user