roulette/templates/play.html

60 lines
1.5 KiB
HTML
Raw Normal View History

2017-01-26 22:32:27 +00:00
{% extends "layout.html" %}
{% block content %}
2018-01-28 22:29:05 +00:00
<div class="title">Trancher un joueur</div>
<div class="desc">
Ta cible sera notifiée quelle que soit l'issue de ta tentative. Question
chance, c'est 50-50.
</div>
<div class="sep"></div>
<form action="" method="post">
<div class="desc">Écris le nom de ta victime :</div>
<input type="text" name="search" id="word">
<br>
<div class="desc">Choisis-la :</div>
<select id="auto" name="target_id">
<option value="none">(sélectionner un joueur)</option>
{% for p in players %}
<option value="{{p.id}}">{{p.name}} {{p.firstname}}</option>
{% endfor %}
</select>
<br>
<input type="submit" value="TCHAK!" id="tchak" class="button" />
</form>
<div class="sep"></div>
<div class="title">
<a href="{{ url_for('home') }}">&laquo; retour à l'accueil</a>
</div>
<div class="sep"></div>
2018-01-13 14:45:29 +00:00
<script>
$(function(){
$('#word').keyup(function(e){
var input = $(this).val();
$.ajax({
type: "get",
url: "complete",
data: {v: input},
async: true,
success: function(data){
var outWords = $.parseJSON(data);
$('#auto').html('');
for(x = 0; x < outWords.length; x++){
$('#auto').prepend('<option value="' + outWords[x][0] + '">'+outWords[x][1]+'</option>'); //Fills the #auto div with the options
}
}
})
})
});
</script>
2017-01-30 08:51:21 +00:00
2017-01-26 22:32:27 +00:00
{% endblock %}