myprecious/templates/search.html (view raw)
1{% extends "base.html" %}
2{% block title %}search{% endblock %}
3{% block content %}
4<form action="/search" method="POST" enctype="multipart/form-data">
5 <input type="text" name="query" placeholder="Game" {% if query %}value="{{ query }}" {% endif %}required />
6 <input type="submit" value="search" />
7</form>
8<table>
9{% for game in games %}
10<tr onClick="send(this)" data-info="{{ game.info }}">
11 <td>
12 <img src="{{ game.cover }}" style="height: 100px;">
13 </td>
14 <td>
15 <i>{{ game.title }}</i> on <i>{{ game.platform }}</i>
16 </td>
17</tr>
18{% endfor %}
19</table>
20<script>
21 function send(element) {
22 const params_str = new URLSearchParams({ "info": element.getAttribute("data-info") });
23 window.location.href = "/upload?" + params_str;
24 }
25</script>
26{% endblock %}