collections-webserver/templates/collections.html
2025-09-06 18:49:27 -05:00

86 lines
2.6 KiB
HTML

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Treehouse - My Collections</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
</head>
<body>
{% extends "template.html" %}
{% block content %}
<div class="container" style="width: 85%; background-color: white;">
<div class="section">
<form method="post" action="{{ url_for('upload')}}" enctype="multipart/form-data">
<div class="row">
<div class="col s10 m10 l10">
<div class="file-field input-field center">
<div class="btn grey">
<span>File</span>
<input name="file" type="file">
</div>
<div class="file-path-wrapper">
<input class="file-path validate" type="text" placeholder="Upload a file...">
</div>
</div>
</div>
<div class="col s2 m2 l2">
<div class="input-field">
<button type="submit" class="btn grey" name=action>
Upload
</button>
</div>
</div>
</div>
</form>
<div class="divider"></div>
{% include "collection_list.html" %}
<div class="row">
<div class="col s12">
<h3> Friends Collections </h3>
<table>
<thead>
<tr>
<th>Collection Name</th>
<th>Author</th>
<th>Version</th>
<th></th>
</tr>
</thead>
<tbody>
{% for item in data[1] %}
<tr>
<td>{{item.name}}</td>
<td>{{item.author}}</td>
<td>{{item.version}}</td>
<td><a class="waves-effect waves-light btn-small right" href="{{ url_for('download', id=item.id)}}" download><i class="material-icons left">download</i>Download</a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
{% if data[2][0] %}
<script> M.toast({html: "Uploaded {{data[2][1]}}!"})</script>
{% endif %}
{% endblock %}
<script>
$(document).ready(function () {
$('.modal').modal();
}
)
</script>
</body>
</html>