{% extends "ndf/mis_base_create_edit.html" %} {% load i18n %} {% load ndf_tags %} {% load pagination_tags %} {% block style %} {{block.super}} /* Disable tab's (anchor tag's) click as it's navigation is propagated on buttons (Next & Previous) */ dl.tabs>dd a.disable { pointer-events: none; cursor: default; } .row .row { margin: 0 0; } /* Resetting css-properties for fieldset (also legend, input) */ /* fieldset (padding-bottom) */ fieldset { padding: 1.25rem 1.25rem 1.25rem 1.25rem !important; } /* legend (background-color) */ fieldset legend { background-color: transparent !important; } /* input (margin) */ fieldset input { margin: 0 !important; } fieldset label.note { color: #909b9c; margin-bottom: 0.8rem; font-size: 0.875em; font-weight: bold; padding-left: 8.8rem; } /* Setting css-properties for reveal-modal's label */ div.reveal-modal > label { color: white; font-weight: bold; font-size: 1rem; } /* css-properties for table */ .width-5p { width: 5%; } .width-8p { width: 8%; } .width-10p { width: 10%; } .width-20p { width: 20%; } .width-30p { width: 30%; } .width-37p { width: 37%; } .width-80p { width: 80%; } .margin-0r { margin: 0 !important; } .counter { font-weight: bold; text-align: right; } {% endblock %} {% block body_content %}
{% endblock %} {% block script %} {{block.super}} // Global variables for script var currentYear = (new Date()).getFullYear() lowerYearLimit = currentYear - 70; course_enrollement_details = {}; course_requirements = {}; node_course_requirements = {} course_data = {}; node_id = "{{node.pk}}"; // Tabs navigation: Enable and Disable tabs in sequential manner using Next & Previous buttons ---- $(".content").on('click', '.tab_next' ,function(event){ event.preventDefault(); // Forcefully blur all input elements, so that mandatory fields become data-invalid if not fill $(this).parents(".tab-nav").parents(".content").find(':input[required]').blur(); // Then check no. of data-invalid fields // if count == 0, then only proceed to next tab parent_tab = $(this).parents(".tab-nav").parents(".content"); tab_id = parent_tab.attr("id"); // Special case for Course tab if (tab_id == "panel_{{property_order_list.2.0}}") { event.preventDefault(); // Reset course_requirements (dictionary), only when node exists meaning while editing if (node_id != "") { if (JSON.stringify(course_requirements) == "{}") { course_requirements = node_course_requirements; } else { $.each(course_requirements, function(k, v) { if (node_course_requirements.hasOwnProperty(k)) { $.each(course_requirements[k], function(index, dict_val) { $.each(node_course_requirements[k], function(index, node_dict_val) { if (dict_val["text"] == node_dict_val["text"]) { dict_val["has_qualification"] = node_dict_val["has_qualification"]; return false; } }); }); } }); } } // Set Course Requirements fieldset = ""; course_list = []; main_fieldset_legend = ""; $("#tblCourseDetails > tbody > tr").each(function(index) { courseSelected = $(this).find(".course").html(); if (course_list.indexOf(courseSelected) < 0) { course_list.push(courseSelected); main_fieldset_legend_name = '{% trans "Course Qualification Specifications" %}' main_fieldset_legend = "" inner_fieldset_legend_name = '{% trans "' + courseSelected + '" %}' inner_fieldset_legend = "" if (course_requirements.hasOwnProperty(courseSelected) && course_requirements[courseSelected] != "None") { th1 = "{% trans 'Mandatory' %}" th2 = "{% trans 'Qualifications' %}" th3 = "{% trans 'Select' %}" specification_table_head = "" + "