{% 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 %}
{# 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 %} {% endif %}
{% endif %}
{% 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', }); }); /* All events to refresh (re-apply) after a table is modified */ function refresh_table_events() { /* Function used to delete an object .btnDelete */ $('.btnDelete').on('click', function(e) { $(this).parent().parent().remove(); }); /* Re-initialize select2 objects */ $('.select2').select2(); /* Re-initialize Tag-Editor events */ /* Try to destroy old tag-editor elements */ try { $(".tag-editor-space").tagEditor('destroy'); } catch(e) {}; try { $(".tag-editor-comma").tagEditor('destroy'); } catch(e) {}; /* And re-add TagEditor behavior for tag-editor custom classes */ $(".tag-editor-space").tagEditor({ delimiter: ' ' }); $(".tag-editor-comma").tagEditor({ delimiter: ',' }); } /* Function used to auto-complete tagEditor */ function autoComplete(list, begin) { var result = Array(); var size_list = list.length; for( i=0 ; i