feat: batch tabs settings
This commit is contained in:
@@ -17,17 +17,15 @@
|
|||||||
"section_break_szgq",
|
"section_break_szgq",
|
||||||
"send_calendar_invite_for_evaluations",
|
"send_calendar_invite_for_evaluations",
|
||||||
"batch_confirmation_template",
|
"batch_confirmation_template",
|
||||||
"column_break_2",
|
|
||||||
"allow_student_progress",
|
"allow_student_progress",
|
||||||
"payment_section",
|
"column_break_2",
|
||||||
"razorpay_key",
|
"show_dashboard",
|
||||||
"razorpay_secret",
|
"show_courses",
|
||||||
"apply_gst",
|
"show_students",
|
||||||
"column_break_cfcv",
|
"show_assessments",
|
||||||
"default_currency",
|
"show_live_class",
|
||||||
"show_usd_equivalent",
|
"show_discussions",
|
||||||
"apply_rounding",
|
"show_emails",
|
||||||
"exception_country",
|
|
||||||
"signup_settings_tab",
|
"signup_settings_tab",
|
||||||
"signup_settings_section",
|
"signup_settings_section",
|
||||||
"terms_of_use",
|
"terms_of_use",
|
||||||
@@ -42,7 +40,17 @@
|
|||||||
"mentor_request_tab",
|
"mentor_request_tab",
|
||||||
"mentor_request_section",
|
"mentor_request_section",
|
||||||
"mentor_request_creation",
|
"mentor_request_creation",
|
||||||
"mentor_request_status_update"
|
"mentor_request_status_update",
|
||||||
|
"payment_settings_tab",
|
||||||
|
"payment_section",
|
||||||
|
"razorpay_key",
|
||||||
|
"razorpay_secret",
|
||||||
|
"apply_gst",
|
||||||
|
"column_break_cfcv",
|
||||||
|
"default_currency",
|
||||||
|
"show_usd_equivalent",
|
||||||
|
"apply_rounding",
|
||||||
|
"exception_country"
|
||||||
],
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
@@ -71,7 +79,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "column_break_2",
|
"fieldname": "column_break_2",
|
||||||
"fieldtype": "Column Break"
|
"fieldtype": "Column Break",
|
||||||
|
"label": "Show Tab in Batch"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "search_placeholder",
|
"fieldname": "search_placeholder",
|
||||||
@@ -177,7 +186,7 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "section_break_szgq",
|
"fieldname": "section_break_szgq",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"label": "Batch Settings"
|
"label": "Class Settings"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "signup_settings_tab",
|
"fieldname": "signup_settings_tab",
|
||||||
@@ -199,8 +208,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "payment_section",
|
"fieldname": "payment_section",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break"
|
||||||
"label": "Payment"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "default_currency",
|
"fieldname": "default_currency",
|
||||||
@@ -261,12 +269,59 @@
|
|||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Batch Confirmation Template",
|
"label": "Batch Confirmation Template",
|
||||||
"options": "Email Template"
|
"options": "Email Template"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "1",
|
||||||
|
"fieldname": "show_courses",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Courses"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "1",
|
||||||
|
"fieldname": "show_students",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Students"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "1",
|
||||||
|
"fieldname": "show_assessments",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Assessments"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "1",
|
||||||
|
"fieldname": "show_live_class",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Live Class"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "1",
|
||||||
|
"fieldname": "show_discussions",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Discussions"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "1",
|
||||||
|
"fieldname": "show_emails",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Emails"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "payment_settings_tab",
|
||||||
|
"fieldtype": "Tab Break",
|
||||||
|
"label": "Payment Settings"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "1",
|
||||||
|
"fieldname": "show_dashboard",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Dashboard"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2023-10-09 17:27:28.615355",
|
"modified": "2023-10-30 16:42:58.994359",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "LMS Settings",
|
"name": "LMS Settings",
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
[pre_model_sync]
|
||||||
community.patches.set_email_preferences
|
community.patches.set_email_preferences
|
||||||
community.patches.change_name_for_community_members
|
community.patches.change_name_for_community_members
|
||||||
community.patches.save_abbr_for_community_members
|
community.patches.save_abbr_for_community_members
|
||||||
@@ -77,3 +78,6 @@ lms.patches.v1_0.create_quiz_questions
|
|||||||
lms.patches.v1_0.add_default_marks #16-10-2023
|
lms.patches.v1_0.add_default_marks #16-10-2023
|
||||||
lms.patches.v1_0.add_certificate_template #26-10-2023
|
lms.patches.v1_0.add_certificate_template #26-10-2023
|
||||||
lms.patches.v1_0.create_batch_source
|
lms.patches.v1_0.create_batch_source
|
||||||
|
|
||||||
|
[post_model_sync]
|
||||||
|
lms.patches.v1_0.batch_tabs_settings
|
||||||
16
lms/patches/v1_0/batch_tabs_settings.py
Normal file
16
lms/patches/v1_0/batch_tabs_settings.py
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import frappe
|
||||||
|
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
fields = [
|
||||||
|
"show_dashboard",
|
||||||
|
"show_courses",
|
||||||
|
"show_students",
|
||||||
|
"show_emails",
|
||||||
|
"show_assessments",
|
||||||
|
"show_discussions",
|
||||||
|
"show_live_class",
|
||||||
|
]
|
||||||
|
|
||||||
|
for field in fields:
|
||||||
|
frappe.db.set_single_value("LMS Settings", field, 1)
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
|
import frappe
|
||||||
from lms.install import create_batch_source
|
from lms.install import create_batch_source
|
||||||
|
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
|
frappe.reload_doc("lms", "doctype", "lms_source")
|
||||||
create_batch_source()
|
create_batch_source()
|
||||||
|
|||||||
@@ -88,8 +88,7 @@
|
|||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
|
|
||||||
<ul class="nav lms-nav" id="batches-tab">
|
<ul class="nav lms-nav" id="batches-tab">
|
||||||
|
{% if settings.show_dashboard and is_student %}
|
||||||
{% if is_student %}
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link {% if is_student %} active {% endif %}" data-toggle="tab" href="#dashboard">
|
<a class="nav-link {% if is_student %} active {% endif %}" data-toggle="tab" href="#dashboard">
|
||||||
{{ _("Dashboard") }}
|
{{ _("Dashboard") }}
|
||||||
@@ -97,6 +96,7 @@
|
|||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if settings.show_courses %}
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link {% if not is_student %} active {% endif %}" data-toggle="tab" href="#courses">
|
<a class="nav-link {% if not is_student %} active {% endif %}" data-toggle="tab" href="#courses">
|
||||||
{{ _("Courses") }}
|
{{ _("Courses") }}
|
||||||
@@ -105,6 +105,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if show_timetable %}
|
{% if show_timetable %}
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
@@ -115,6 +116,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if is_moderator %}
|
{% if is_moderator %}
|
||||||
|
{% if settings.show_students %}
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" data-toggle="tab" href="#students">
|
<a class="nav-link" data-toggle="tab" href="#students">
|
||||||
{{ _("Students") }}
|
{{ _("Students") }}
|
||||||
@@ -123,7 +125,9 @@
|
|||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if settings.show_assessments %}
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" data-toggle="tab" href="#assessments">
|
<a class="nav-link" data-toggle="tab" href="#assessments">
|
||||||
{{ _("Assessments") }}
|
{{ _("Assessments") }}
|
||||||
@@ -132,7 +136,9 @@
|
|||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if settings.show_emails %}
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" data-toggle="tab" href="#emails">
|
<a class="nav-link" data-toggle="tab" href="#emails">
|
||||||
{{ _("Emails") }}
|
{{ _("Emails") }}
|
||||||
@@ -142,14 +148,18 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if batch_students | length and (is_moderator or is_student) %}
|
{% if batch_students | length and (is_moderator or is_student) %}
|
||||||
|
{% if settings.show_discussions %}
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" data-toggle="tab" href="#discussions">
|
<a class="nav-link" data-toggle="tab" href="#discussions">
|
||||||
{{ _("Discussions") }}
|
{{ _("Discussions") }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if settings.show_live_class %}
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" data-toggle="tab" href="#live-class">
|
<a class="nav-link" data-toggle="tab" href="#live-class">
|
||||||
{{ _("Live Class") }}
|
{{ _("Live Class") }}
|
||||||
@@ -159,6 +169,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if custom_tabs_header %}
|
{% if custom_tabs_header %}
|
||||||
{% include custom_tabs_header %}
|
{% include custom_tabs_header %}
|
||||||
@@ -169,15 +180,17 @@
|
|||||||
|
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
|
|
||||||
{% if is_student %}
|
{% if settings.show_dashboard and is_student %}
|
||||||
<div class="tab-pane {% if is_student %} active {% endif %}" id="dashboard" role="tabpanel" aria-labelledby="dashboard">
|
<div class="tab-pane {% if is_student %} active {% endif %}" id="dashboard" role="tabpanel" aria-labelledby="dashboard">
|
||||||
{{ Dashboard(batch_info, batch_courses, current_student) }}
|
{{ Dashboard(batch_info, batch_courses, current_student) }}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if settings.show_courses %}
|
||||||
<div class="tab-pane {% if not is_student %} active {% endif %}" id="courses" role="tabpanel" aria-labelledby="courses">
|
<div class="tab-pane {% if not is_student %} active {% endif %}" id="courses" role="tabpanel" aria-labelledby="courses">
|
||||||
{{ CoursesSection(batch_info, batch_courses) }}
|
{{ CoursesSection(batch_info, batch_courses) }}
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if show_timetable %}
|
{% if show_timetable %}
|
||||||
<div class="tab-pane" id="timetable" role="tabpanel" aria-labelledby="timetable">
|
<div class="tab-pane" id="timetable" role="tabpanel" aria-labelledby="timetable">
|
||||||
@@ -186,28 +199,38 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if is_moderator %}
|
{% if is_moderator %}
|
||||||
|
{% if settings.show_students %}
|
||||||
<div class="tab-pane" id="students" role="tabpanel" aria-labelledby="students">
|
<div class="tab-pane" id="students" role="tabpanel" aria-labelledby="students">
|
||||||
{{ StudentsSection(batch_info, batch_students) }}
|
{{ StudentsSection(batch_info, batch_students) }}
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if settings.show_assessments %}
|
||||||
<div class="tab-pane" id="assessments" role="tabpanel" aria-labelledby="assessments">
|
<div class="tab-pane" id="assessments" role="tabpanel" aria-labelledby="assessments">
|
||||||
{{ AssessmentsSection(batch_info) }}
|
{{ AssessmentsSection(batch_info) }}
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if settings.show_emails %}
|
||||||
<div class="tab-pane" id="emails" role="tabpanel" aria-labelledby="emails">
|
<div class="tab-pane" id="emails" role="tabpanel" aria-labelledby="emails">
|
||||||
{{ EmailsSection() }}
|
{{ EmailsSection() }}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if batch_students | length and (is_moderator or is_student or is_evaluator) %}
|
{% if batch_students | length and (is_moderator or is_student or is_evaluator) %}
|
||||||
|
{% if settings.show_discussions %}
|
||||||
<div class="tab-pane" id="discussions" role="tabpanel" aria-labelledby="discussions">
|
<div class="tab-pane" id="discussions" role="tabpanel" aria-labelledby="discussions">
|
||||||
{{ Discussions(batch_info) }}
|
{{ Discussions(batch_info) }}
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if settings.show_live_class %}
|
||||||
<div class="tab-pane" id="live-class" role="tabpanel" aria-labelledby="live-class">
|
<div class="tab-pane" id="live-class" role="tabpanel" aria-labelledby="live-class">
|
||||||
{{ LiveClassSection(batch_info, live_classes) }}
|
{{ LiveClassSection(batch_info, live_classes) }}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if custom_tabs_content %}
|
{% if custom_tabs_content %}
|
||||||
{% include custom_tabs_content %}
|
{% include custom_tabs_content %}
|
||||||
|
|||||||
@@ -105,9 +105,9 @@ def get_context(context):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
context.legends = get_legends(batch_name)
|
context.legends = get_legends(batch_name)
|
||||||
|
context.settings = frappe.get_single("LMS Settings")
|
||||||
|
|
||||||
custom_tabs = frappe.get_hooks("lms_batch_tabs")
|
custom_tabs = frappe.get_hooks("lms_batch_tabs")
|
||||||
|
|
||||||
if custom_tabs:
|
if custom_tabs:
|
||||||
context.custom_tabs_header = custom_tabs.get("header_html")[0]
|
context.custom_tabs_header = custom_tabs.get("header_html")[0]
|
||||||
context.custom_tabs_content = custom_tabs.get("content_html")[0]
|
context.custom_tabs_content = custom_tabs.get("content_html")[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user