Skip to content

Commit eea1a98

Browse files
committed
Implemented working deleteview, solving issue #2
1 parent 395e9ee commit eea1a98

File tree

15 files changed

+90
-42
lines changed

15 files changed

+90
-42
lines changed
73 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
277 Bytes
Binary file not shown.
-12 Bytes
Binary file not shown.
1.29 KB
Binary file not shown.
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
function makePredictions()
2-
{
3-
console.log("Not yet implemented");
4-
}
1+

App/templates/delete_success.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{% extends "index.html" %}
22

33
{% block content %}
4-
<p>
4+
<h5>
55
File deleted with success!
6-
</p>
7-
<a href="{% url 'index' %}" class="btn btn-primary">Return to home</a>
6+
</h5>
87
{% endblock %}

App/templates/files_list.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{% extends "index.html" %}
2+
3+
{% block content %}
4+
5+
{% for file in files_list %}
6+
7+
<p>{{ file }}</p>
8+
9+
{%endfor%}
10+
11+
{% endblock %}

App/templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ <h4>The emotion of the speaker in your file is: <strong>{{ pred }}</strong> </h4
4242
</div>
4343
<div class="container">
4444
<div class="center">
45-
{% block content %}
45+
{% block content %}
4646
{% endblock %}
4747
</div>
4848
</div>

App/templates/select_file_deletion.html

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22

33
{% block content %}
44
<!--Here the number 2 in "/App/delete/2/" needs to be replaced with the pk of the file. The logic is working. -->
5-
<form action="/App/delete/2/" method="post" enctype="multipart/form-data">
5+
<form action="/App/delete/" method="post" enctype="multipart/form-data">
66
{% csrf_token %}
77
{{ form.as_p }}
88
<h5>Please select one file at a time from the list below to delete it from the server.</h5>
9-
{% for myfile in filename %}
10-
<input type="checkbox" name="file_name" value="{{ myfile }}">
11-
<label>
12-
<a href="/media/{{ myfile }}">{{ myfile }}</a>
13-
</label>
9+
{% for myfile, pk in filename %}
10+
<p>Are you sure you want to delete "{{ myfile }}"?</p>
11+
<input type="submit" value="Confirm">
12+
<input type="hidden" name="pk" value="{{ pk }}">
1413
<br>
1514
{% endfor %}
1615
<br>
17-
<button type="submit" class="btn btn-primary">Delete</button>
1816
</form>
19-
{% endblock %}
17+
{% endblock %}
18+

0 commit comments

Comments
 (0)