diff --git a/ladder/templates/ladder/ladder/index.html b/ladder/templates/ladder/ladder/index.html index 134f4ce..64291da 100644 --- a/ladder/templates/ladder/ladder/index.html +++ b/ladder/templates/ladder/ladder/index.html @@ -2,73 +2,83 @@ {% load ladder_extras %} {% block container %} - - - - + + + + - + -
- | Name | - {% for i in ladder.league_set.all %} -{{ forloop.counter }} | - {% endfor %} -Average | -Total | -||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
+ | Name | + {% for i in ladder.league_set.all %} +{{ forloop.counter }} | + {% endfor %} +Average | +Total | +||||||||||||||||
{{ player_counter }} | -{{ league.player }} | - {% for opponent in ladder.league_set.all %} - {% with column_counter=forloop.counter %} - {% if column_counter == player_counter %} -- {% else %} - |
-
-
- {% for result in results_dict|getkey:league.player.id %}
- {% if league.player == result.player and opponent.player == result.opponent %}
- {% if result.inaccurate_flag %}
- {{ result.result }} *
-
- {% else %}
- {{ result.result }}
- {% endif %}
- {% endif %}
- {% endfor %}
-
-
- |
- {% endif %}
- {% endwith %}
- {% endfor %}
+ {{ league.player }} | + {% comment %}Loop over all players again to get opponents.{% endcomment %} + {% for opponent in ladder.league_set.all %} + {% comment %}Player cannot play against themselves, fill in box with grey.{% endcomment %} + {% with column_counter=forloop.counter %} + {% if column_counter == player_counter %} ++ {% else %} + {% comment %}Score field, with identifier for JS{% endcomment %} + |
+ {% comment %}Head to head link{% endcomment %}
+
+ {% comment %}todo: remove these styles.{% endcomment %}
+
+ {% comment %}Loop over every result of player{% endcomment %}
+ {% for result in results_dict|getkey:league.player.id %}
+ {% comment %}See if it matches opponent and print result.{% endcomment %}
+ {% if league.player == result.player and opponent.player == result.opponent %}
+ {% if result.inaccurate_flag %}
+ {{ result.result }} *
+
+ {% else %}
+ {{ result.result }}
+ {% endif %}
+ {% endif %}
+ {% endfor %}
+
+
+ |
+ {% endif %}
+ {% endwith %}
+ {% endfor %}
{{ results_dict|getaverage:league.player.id }} | {{ results_dict|gettotal:league.player.id }} | @@ -82,9 +92,18 @@
Total Matches in Division | {{ ladder.get_stats.total_matches }} |
Total Matches Played | {{ ladder.get_stats.total_matches_played|floatformat:"0" }} |
Percentage Matches Played | {{ ladder.get_stats.perc_matches_played|floatformat:"2" }}% |
Total Matches in Division | +{{ ladder.get_stats.total_matches }} | +
Total Matches Played | +{{ ladder.get_stats.total_matches_played|floatformat:"0" }} | +
Percentage Matches Played | +{{ ladder.get_stats.perc_matches_played|floatformat:"2" }}% | +