{% load i18n %}
<!-- it needs jquery to work 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>
-->
<script src="{{ MEDIA_URL }}inplaceeditform/js/jquery.json.js" type="text/javascript"></script>
<script src="{{ MEDIA_URL }}inplaceeditform/js/jquery.inplaceeditform.js" type="text/javascript"></script>

{% if activate_inplaceedit %}
<script type="text/javascript"> 
    (function($){
        $(document).ready(function () {
            var getFieldUrl = "{% url inplace_get_field %}";
            var saveURL = "{% url inplace_save %}";
            var successText = "{% trans "Successfully saved" %}"
            var inplaceManager = $(".inplaceedit").inplaceeditform({"getFieldUrl": getFieldUrl,
                                                                    "saveURL": saveURL,
                                                                    "successText": successText});
            inplaceManager.enable();

    });
})(jQuery);
</script>
{% endif %}
