{% extends "layout2.html" %} {% load i18n %} {% load static %} {% block css_include %} {% endblock %} {% block js_include %} {% endblock %} {% block content %} {% csrf_token %} {% if form.non_field_errors or save_error %} {# If there is save/configuration errors #} {% if save_error %} {% translate "Message" %} {% translate "Advanced informations" %} Configuration error {% endif %} {# Print form errors correctly #} {% if form.non_field_errors %} {% translate "Form errors" %} {{ form.non_field_errors|safe }} {% endif %} {# If there is save/configuration errors #} {% if save_error %} {{ save_error.0 }} {{ save_error.1 }} {% endif %} {% endif %} {% translate "General" %} {% translate "Friendly name" %} {{form.name}} {{form.name.errors|safe}} {{ form.rulebase.label }} {{form.rulebase}} {{form.rulebase.errors|safe}} {{ form.to_test.label }} {{form.to_test}} {{form.to_test.errors|safe}} {% translate "Test rules" %} {% translate "Result" %} {% endblock %} {% block jquery_code %} if (!String.prototype.endsWith) { String.prototype.endsWith = function(searchString, position) { var subjectString = this.toString(); if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { position = subjectString.length; } position -= searchString.length; var lastIndex = subjectString.lastIndexOf(searchString, position); return lastIndex !== -1 && lastIndex === position; }; } $(function() { /* Switchery mandatory code */ var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch')); elems.forEach(function(html) { var switchery = new Switchery(html, { 'color': '#FA9834', }); }); function handle_form_errors(data){ if (typeof(data['form_errors']) !== 'undefined'){ $('.errorlist').remove(); $.each(data['form_errors'], function(field_name, error_list){ field_selector = $('#id_'+field_name); var ul = $('
{{ save_error.0 }}
{{ save_error.1 }}