{% extends 'registration/base.html' %} {% block title %}Admin - Carica documento{% endblock %} {% block nav %} Home Admin Carica Documento {% endblock %} {% block content %}
{% csrf_token %}
{% csrf_token %}
file_uploadFile
{% endblock %} {% block script %} function confirm() { var button = document.getElementById('send_button') button.innerHTML = "Sicuro?" button.setAttribute('onclick', "document.getElementById('form').submit()") button.setAttribute('class', "waves-effect waves-light btn green") } function send() { var form = document.getElementById('preview_form') var action = document.getElementById('code_submit') var text = document.getElementById('code').value action.setAttribute('value', text); form.submit() } var loadFile = function(event) { var output = document.getElementById('preview'); output.src = URL.createObjectURL(event.target.files[0]); output.onload = function() { URL.revokeObjectURL(output.src) // free memory } }; $(document).ready(function(){ {% if error %} M.toast({html: '{{ error_text }}', classes: 'orange'}) {% elif success %} M.toast({html: '{{ success_text }}', classes: 'green'}) {% endif %} }); {% endblock %}