{% extends "base.html" %}
{% block page_title %}Game Library{% endblock %}

{% block title %}All games by rating{% endblock %}

{% block content %}
    <table class="table table-bordered table">
    <thead>
        <tr>
        <th scope="col">#</th>
        <th scope="col">Name</th>
        <th scope="col">System</th>
        <th scope="col">Rating</th>
        <th scope="col">Developer</th>
        <th scope="col">Publisher</th>
        <th scope="col">Genre</th>
        </tr>
    </thead>
    <tbody>
        {% for  game in object_list %}
        <tr>
        <th scope="row"><a href="{{game.get_absolute_url}}">{{game.id}}</a></th>
        <td>{{game.name}}</td>
        <td><a href="{{game.game_system.get_absolute_url}}">{{game.game_system}}</td>
        <td>{{game.rating_by_100}}/100</td>
        <td><a href="{{game.developer.get_absolute_url}}">{{game.developer}}</a></td>
        <td><a href="{{game.publisher.get_absolute_url}}">{{game.publisher}}</a></td>
        <td style="font-size:smaller;">{% for genre in game.genre.all %}<a href="{{genre.get_absolute_url}}">{{genre}}</a>{% if not forloop.last %}, {% endif %}{% endfor %}</td>
        </tr>
        {% endfor %}
    </tbody>
    </table>
    {% include "games/_pagination.html" %}
{% endblock %}
