fix: restrict profile and mark as complete
This commit is contained in:
@@ -43,9 +43,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="course-buttons">
|
||||
{% if not course.disable_self_learning and not membership and not course.upcoming %}
|
||||
{% if not course.disable_self_learning and not membership and not course.upcoming and not restriction.restrict %}
|
||||
<div class="button wide-button start-learning is-primary join-batch" data-course="{{ course.name | urlencode }}">
|
||||
Start Learning
|
||||
{{ _("Start Learning") }}
|
||||
<img class="ml-2" src="/assets/school/icons/white-arrow.svg" />
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import frappe
|
||||
from school.lms.doctype.lms_settings.lms_settings import check_profile_restriction
|
||||
|
||||
def get_context(context):
|
||||
context.no_cache = 1
|
||||
@@ -20,6 +21,7 @@ def get_context(context):
|
||||
context.membership = membership
|
||||
if context.course.upcoming:
|
||||
context.is_user_interested = get_user_interest(context.course.name)
|
||||
context.restriction = check_profile_restriction()
|
||||
context.metatags = {
|
||||
"title": course.title,
|
||||
"image": course.image,
|
||||
|
||||
@@ -9,9 +9,16 @@
|
||||
{% block content %}
|
||||
<div class="common-page-style">
|
||||
<div class="container">
|
||||
{% if restriction.restrict %}
|
||||
{% set site_link = "<a href='/edit-profile'> profile </a>" %}
|
||||
<div class="empty-state">
|
||||
<div class="course-home-headings text-center mb-0" style="color: inherit;">{{ _("You haven't completed your profile.") }}</div>
|
||||
<p class="small text-center">{{ _("Complete your {0} to access the courses.").format(site_link) }}</p>
|
||||
</div>
|
||||
|
||||
{% else %}
|
||||
|
||||
{% include "school/templates/search_course/search_course.html" %}
|
||||
|
||||
<div class="course-list">
|
||||
{% set title = _("Live Courses") %}
|
||||
{% set courses = live_courses %}
|
||||
@@ -23,6 +30,7 @@
|
||||
{% set classes = "upcoming-courses mt-10" %}
|
||||
{% include "school/templates/course_list.html" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import frappe
|
||||
from school.lms.doctype.lms_settings.lms_settings import check_profile_restriction
|
||||
|
||||
def get_context(context):
|
||||
context.no_cache = 1
|
||||
context.live_courses, context.upcoming_courses = get_courses()
|
||||
context.restriction = check_profile_restriction()
|
||||
context.metatags = {
|
||||
"title": "All Courses",
|
||||
"image": frappe.db.get_single_value("Website Settings", "banner_image"),
|
||||
|
||||
@@ -290,12 +290,16 @@
|
||||
<div class="profile-card-row">
|
||||
<div class="institute-name"> {{ edu.institution_name }} </div>
|
||||
<div class="profile-item"> {{ edu.degree_type }} <span></span> {{ edu.major }}
|
||||
{% if not member.hide_private %} <span></span>
|
||||
{% if not member.hide_private %}
|
||||
<!-- {% if edu.grade_type %} {{ edu.grade_type }} {% endif %} -->
|
||||
{% if edu.grade %} {{ edu.grade }} {% endif %}
|
||||
{% if edu.grade %} <span></span> {{ edu.grade }} {% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div> {{ frappe.utils.format_date(edu.start_date, "MMM YYYY") }} - {{ frappe.utils.format_date(edu.end_date, "MMM YYYY") }} </div>
|
||||
<div>
|
||||
{% if edu.start_date %}
|
||||
{{ frappe.utils.format_date(edu.start_date, "MMM YYYY") }} -
|
||||
{% endif %}
|
||||
{{ frappe.utils.format_date(edu.end_date, "MMM YYYY") }} </div>
|
||||
<div> {{ edu.location }} </div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user