advanced_edit.html 1.13 KB
{% extends "freeadmin/generic_model_edit.html" %}
{% load i18n %}
{% block buttons_extra %}
            <button dojoType="dijit.form.Button"> 
                <script type="dojo/event" event="onClick" args="e">
                    var sendbtn = this;
                    this.set('disabled', true);
                    form = getForm(this);
                    data = form.get('value');
                    dojo.xhrPost( {
                        url: '{% url system_clearcache %}',
                        handleAs: 'json',
                        content: data,
                        load: function(data) { 
                            sendbtn.set('disabled', false);
                            if(!data.error) {
                                setMessage("{% trans "The cache is being rebuilt." %}");
                            } else {
                                setMessage("{% trans "The cache could not be rebuilt" %}: "+data.errmsg, "error");
                            }
                        },
                     });
                </script>
            {% trans "Rebuild LDAP/AD Cache" %}
            </button>
{% endblock %}