{# -*- coding: utf-8 -*- #} {% extends "forms/tree.html" %} {% load exfiltry %} {% load exsyntax %} {% block pythoncode %} {% endblock %} {% block on_dialog_load %} function show_hide(typ): if (typ=='S'): $('label[for|="id_grand_parent"]').show() $('label[for|="id_description"]').show() $('select[name^="grand_parent"]').show() $('input[name="description"]').show() $('#id_key').show() else: $('label[for|="id_grand_parent"]').hide() $('label[for|="id_description"]').hide() $('select[name^="grand_parent"]').hide() $('input[name="description"]').hide() $('#id_key').hide() $('#id_type').change( function(): var typ typ = $(this)[0].options[$(this)[0].selectedIndex].value show_hide(typ) return false var id_type=$('#id_type')[0].options[$('#id_Typ')[0].selectedIndex].value show_hide(id_type) if(id_type!=""): $('label[for|="id_type"]').hide() $('select[name="type"]').hide() {% endblock %} {% block all %} {% with table_type='datatable' title="Accounts" %} {{ block.super }} {% endwith %} {% endblock %} {% block list_row_header %} Type 1 Type 2 Name Description Classifier 1 Classifier 2 Classifier 3 {% endblock %} {% block list_row %} {{object.type1}} {{object.type2}} {{object.name}} {{object.description}} {{object.root_classifier1|none_to_empty}} {{object.root_classifier2|none_to_empty}} {{object.root_classifier3|none_to_empty}} {% endblock %} {% block list_row_actions %} {% row_actions %} edit delete {% endrow_actions %} {% endblock %} {% block row_edit %} {% if form_add %} {% form %} parent:! {% endform %} {% else %} {% form %} parent {% endform %} {% endif %} {% if object.parent %} {% form %} type2:! {% endform %} {% else %} {% form %} type2 {% endform %} {% endif %} {% form %} name,description,correctness_rule,root_classifier1,root_classifier2,root_classifier3 {% endform %} {% endblock %}