8b878676de428592b5c16bfa83975241656fc727
[mlpccg-meta.git] / meta / templates / index.html
1 {% extends "base.html" %}
2 {% load meta_extras %}
3
4 {% block jumbotron %}
5 <div class="jumbotron">
6 <div class="container">
7 <h1>How good is your deck?</h1>
8 <p>Curious how decks like yours have performed in tournaments?<br/>
9 Paste your <a href="http://ponyhead.com/deckbuilder">ponyhead.com</a> URL here and find out!</p>
10 <p>
11 <form action="{% url 'meta.views.rate' %}" method="post" class="form-inline" role="form">
12 {% csrf_token %}
13 <div class="form-group">
14 <label class="sr-only" for="ponyheadURL">ponyhead decklist url</label>
15 <input type="url" name="url" class="form-control input-lg" id="ponyheadURL" placeholder="Deck URL"/>
16 <button type="submit" class="btn btn-lg btn-default btn-primary">Tell me!</button>
17 </div>
18 </form>
19 </p>
20 </div>
21 </div>
22 {% endblock %}
23
24 {% block content %}
25 <div class="row">
26 <div class="col-xs-12">
27 <h2>Deck archetypes</h2>
28 <p>Very fuzzy data, based on past tournaments. The more the deck was played in tournaments, the more accurate this is.</p>
29 <table class="table">
30 <tr>
31 <!-- <th>Archetype ID</th> -->
32 <th>Average placement</th>
33 <th>Example decks</th>
34 </tr>
35 {% load humanize %}
36 {% for avg, label, decks in ranking %}
37 <tr>
38 <!-- <td>{{ label }}</td> -->
39 <td>{{ avg|ordinal }}</td>
40 <td>
41 <ul class="list-inline">
42 {% for d in decks %}
43 <li><a href="{{ d.ponyhead_link }}">{{ d.name }}</a></li>
44 {% endfor %}
45 </ul>
46 </td>
47 {% endfor %}
48 </table>
49 </div>
50 </div>
51
52 <div class="row">
53 <div class="col-xs-12">
54 <h2>Tournaments</h2>
55 <table class="table">
56 <tr>
57 <th>Date</th>
58 <th>Name</th>
59 <th>Top Decks</th>
60 </tr>
61 {% if tournaments %}
62 {% for t in tournaments %}
63 <tr>
64 <td>{{ t.tournament.date }}</td>
65 <td><a href="{% url 'meta.views.tournaments_detail' t.tournament.id %}">{{ t.tournament.name }}</a></td>
66 <td>
67 {% for placement, d in t.decklists|slice:":8" %}
68 {{ placement|ordinal }} <a href="{{ d.ponyhead_link }}">{{ d.name }} ({{ d.description }})</a><br/>
69 {% endfor %}
70 </td>
71 </tr>
72 {% endfor %}
73 {% endif %}
74 </table>
75 </div>
76 </div>
77 {% endblock %}
78
79 {% block jumbotron_end %}
80 <div class="jumbotron">
81 <div class="container">
82 <h1>Is your deck not on the list?</h1>
83 <p> Paste your <a href="http://ponyhead.com/deckbuilder">ponyhead.com</a> URL here and help make this site better!</p>
84 <p>
85 <form action="{% url 'meta.views.rate' %}" method="post" class="form-inline" role="form">
86 {% csrf_token %}
87 <div class="form-group">
88 <label class="sr-only" for="ponyheadURL">ponyhead decklist url</label>
89 <input type="url" name="url" class="form-control input-lg" id="ponyheadURL" placeholder="Deck URL"/>
90 <button type="submit" class="btn btn-lg btn-default btn-primary">Add me!</button>
91 </div>
92 </form>
93 </p>
94 </div>
95 </div>
96 {% endblock %}