add typeahead for tournament names
[mlpccg-meta.git] / meta / templates / rate.html
1 {% extends "base.html" %}
2 {% load humanize %}
3
4 {% block content %}
5
6 <div class="row">
7 <div class="col-xs-12">
8 <h2><a href="{{ deck.ponyhead_link }}">{{ deck.description }}</a></h2>
9 <p>Decks similiar to yours and their placement in past tournaments:</p>
10 <table class="table">
11 <tr>
12 <th>Deck</th>
13 <th>Placement</th>
14 <th>Tournament</th>
15 <th>Date</th>
16 <th>Notes</th>
17 </tr>
18 {% for deck, record in similiar reversed %}
19 <tr class="{% if not record.verified %}warning{% endif %}">
20 <td><a href="{{ deck.ponyhead_link }}">{{ deck.name }}</a></td>
21 <td>{{ record.placement|ordinal }}</td>
22 <td><a href="/meta/tournaments/{{ record.tournament.id }}">{{ record.tournament.name }}</a></td>
23 <td>{{ record.tournament.date }}</td>
24 <td>{% if not record.verified %}user-submitted{% endif %}</td>
25 </tr>
26 {% endfor %}
27 <tr>
28 <td colspan="5"><strong>Played this deck in a tournament? Add your result here!</strong></td>
29 </tr>
30 <form class="form-inline" action="/meta/rate" method="post" role="form">
31 {% csrf_token %}
32 <input type="hidden" name="url" value="{{ deck.ponyhead_link }}"/>
33 <tr class="info">
34 <td><input type="text" name="deck_name" class="form-control" placeholder="Deck name"/></td>
35 <td>
36 <select name="placement" class="form-control">
37 <option value="1">1st</option>
38 <option value="2">2nd</option>
39 <option value="3">3rd</option>
40 <option value="4">4th</option>
41 <option value="5">5th</option>
42 <option value="6">6th</option>
43 <option value="7">7th</option>
44 <option value="8">8th</option>
45 </select>
46 </td>
47 <td><input type="text" name="name" class="form-control typeahead-tournaments" placeholder="Tournament name"/></td>
48 <td><input type="date" name="date" class="form-control"/></td>
49 <td><button type="submit" class="btn btn-primary">Submit</button></td>
50 </tr>
51 </form>
52 </table>
53 </div>
54 </div>
55
56 {% endblock %}