Skip to content

Instantly share code, notes, and snippets.

@Akshat1903
Created December 4, 2020 09:17
Show Gist options
  • Select an option

  • Save Akshat1903/e32858f52dd6b4a78a14d4199f426055 to your computer and use it in GitHub Desktop.

Select an option

Save Akshat1903/e32858f52dd6b4a78a14d4199f426055 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>File Upload</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
</head>
<body>
<div class="container">
<div class="jumbotron">
{% if files.count == 0 %}
<h1>No files uploaded yet</h1>
{% else %}
<h1>Here is the list of all the files uploaded</h1>
<table class="table">
<thead class="thead-dark">
<tr>
<th scope="col">#</th>
<th scope="col">Assignment Name</th>
<th scope="col">Uploaded Date</th>
<th scope="col">Download</th>
</tr>
</thead>
<tbody>
{% for file in files %}
<tr>
<td scope="row">{{ forloop.counter }}</td>
<td>{{ file.file_name }}</td>
<td>{{ file.uploading_time }}</td>
<td><a href="{{ file.file.url }}" class="btn btn-primary" target="_blank">Download</a></td>
<tr>
{% endfor %}
</tbody>
</table>
{% endif %}
<br>
<a href="{% url 'xyz:home' %}" class="btn btn-primary">Home Page</a>
<a href="{% url 'xyz:upload' %}" class="btn btn-success">Upload Files</a>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment