{# jb-login-authenticator/itop-portal-base/portal/templates/bricks/two-factor-code/layout.html.twig #} {# Two Factor Authentication brick base layout #} {% extends 'itop-portal-base/portal/templates/bricks/layout.html.twig' %} {% set oTwoFactorCodeForm = forms.twofactorcode %} {% block pPageBodyClass %}{{ parent() }} page_two-factor-code_brick{% endblock %} {% block pMainHeaderTitle %} {{ oBrick.GetTitle()|dict_s }} {% endblock %} {% block pMainContentHolder%}
{% block pTwoFactorCodeWrapper %}
{% include 'jb-login-authenticator/templates/two-factor-code/two-factor-left.html.twig' %}
{% block pTwoFactorCodeFormContainer %}
{#

{{ 'Class:appUserPreferences/Attribute:preferences'|dict_s }}

#}
{% include 'jb-login-authenticator/templates/two-factor-code/two-factor-right.html.twig' %}
{{ oTwoFactorCodeForm.renderer.GetBaseLayout()|raw }}
{# Reset. Only allowed for users if two factor authentication is NOT enforced. #} {% if twofactorcode.enforced == false and twofactorcode.secret_enabled == true %} {% endif %}
{% endblock pTwoFactorCodeFormContainer %}
{% endblock %}
{% endblock %} {% block pPageReadyScripts %} // Ready scripts Two factor code {{ parent() }} // TwoFactorCode form var oTwoFactorCodeFormFieldSet = $('#{{ oTwoFactorCodeForm.id }} > .form_fields').field_set({{ oTwoFactorCodeForm.fieldset|json_encode()|raw }}); $('#{{ oTwoFactorCodeForm.id }}').portal_form_handler({ formmanager_class: "{{ oTwoFactorCodeForm.formmanager_class|escape('js') }}", formmanager_data: {{ oTwoFactorCodeForm.formmanager_data|json_encode()|raw }}, field_set: oTwoFactorCodeFormFieldSet, endpoint: "{{ oTwoFactorCodeForm.renderer.GetEndpoint()|raw }}" }); // Setup/submit button $('#{{ oTwoFactorCodeForm.id }} .form_buttons .form_btn_setup').off('click').on('click', function(oEvent){ oEvent.preventDefault(); $('#{{ oTwoFactorCodeForm.id }} [name="two_factor_operation"]').val('do_setup_two_factor_secret'); // Resetting feedback $('#two-factor-code-wrapper .form_alerts .alert').hide(); $('#two-factor-code-wrapper .form_alerts .alert > p').remove(); $('#two-factor-code-wrapper .form_field').removeClass('has-error'); $('#two-factor-code-wrapper .form_field .help-block > p').remove(); $('#{{ oTwoFactorCodeForm.id }}').portal_form_handler('submit', oEvent); }); // Reset button $('#{{ oTwoFactorCodeForm.id }} .form_buttons .form_btn_reset').off('click').on('click', function(oEvent){ oEvent.preventDefault(); $('#{{ oTwoFactorCodeForm.id }} [name="two_factor_operation"]').val('delete_two_factor_secret'); // Resetting feedback $('#two-factor-code-wrapper .form_alerts .alert').hide(); $('#two-factor-code-wrapper .form_alerts .alert > p').remove(); $('#two-factor-code-wrapper .form_field').removeClass('has-error'); $('#two-factor-code-wrapper .form_field .help-block > p').remove(); $('#{{ oTwoFactorCodeForm.id }}').portal_form_handler('submit', oEvent); }); // End ready Two factor code {% endblock %}