stuff working

This commit is contained in:
vabene1111
2018-02-05 21:12:29 +01:00
parent df576a20ba
commit eea37b9af5
10 changed files with 317 additions and 135 deletions

View File

@@ -29,4 +29,22 @@
</div>
{% endif %}
<script type="text/javascript">
function openRecipe(id) {
url = "{% url 'get_file_link' recipe_id=12345 %}".replace(/12345/, id);
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () {
if (this.readyState === 4 && this.status === 200) {
console.log(this.response);
window.open(this.responseText, '_blank');
}
};
xhttp.open("GET", url, true);
xhttp.send();
}
</script>
{% endblock %}

View File

@@ -0,0 +1,19 @@
{% extends "base.html" %}
{% load crispy_forms_tags %}
{% load i18n %}
{% load django_tables2 %}
{% block title %}{% trans 'Import Recipes' %}{% endblock %}
{% block content %}
<h3>
{% trans 'Import Recipes' %}
<small class="text-muted">{% trans 'Import Recipes from Dropbox Storage' %}</small>
</h3>
<form method="POST" class="post-form">{% csrf_token %}
{% crispy form %}
</form>
{% endblock %}