fix: conditions to hide contacts section
This commit is contained in:
@@ -238,7 +238,7 @@
|
|||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro Contact(member) %}
|
{% macro Contact(member) %}
|
||||||
{% if not hide_primary_contact and member.email and member.mobile_no and member.linkedin and member.github and member.medium %}
|
{% if show_contacts_section %}
|
||||||
<div class="education-details">
|
<div class="education-details">
|
||||||
<div class="course-home-headings"> {{ _("Contact") }} </div>
|
<div class="course-home-headings"> {{ _("Contact") }} </div>
|
||||||
<div class="common-card-style overview-card">
|
<div class="common-card-style overview-card">
|
||||||
|
|||||||
@@ -18,8 +18,16 @@ def get_context(context):
|
|||||||
context.template = "www/404.html"
|
context.template = "www/404.html"
|
||||||
return
|
return
|
||||||
context.hide_primary_contact = frappe.db.get_single_value("LMS Settings", "hide_primary_contact")
|
context.hide_primary_contact = frappe.db.get_single_value("LMS Settings", "hide_primary_contact")
|
||||||
|
context.show_contacts_section = show_contacts_section(context.member, context.hide_primary_contact)
|
||||||
context.profile_tabs = get_profile_tabs(context.member)
|
context.profile_tabs = get_profile_tabs(context.member)
|
||||||
|
|
||||||
|
def show_contacts_section(member, hide_primary_contact):
|
||||||
|
if member.github or member.linkedin or member.medium:
|
||||||
|
return True
|
||||||
|
if hide_primary_contact or member.hide_private:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
def get_profile_tabs(user):
|
def get_profile_tabs(user):
|
||||||
"""Returns the enabled ProfileTab objects.
|
"""Returns the enabled ProfileTab objects.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user