{% extends "bootstrap/base.html" %}

{% import "bootstrap/wtf.html" as wtf %}
{% import "bootstrap/fixes.html" as fixes %}
{% import "bootstrap/utils.html" as util %}

{% block content %}
    <div class="container" style="margin-top: 50px">
        <div class="col-md-offset-2 col-md-8 col-sm-offset-2 col-sm-8">
            <div class="panel panel-info">
                <div class="panel-heading">
                    <h2>Biological Database Latest Versions</h2>
                </div>
                <div class="panel-body">
                    <p>
                        This web application lists the latest versions for biological databases.
                        It refreshes once per day.
                    </p>
                </div>
                <table class="table table-striped table-hover">
                    <thead>
                    <tr>
                        <th>Name</th>
                        <th>Version</th>
                        <th class="text-center">JSON</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% for name, version, homepage in rows %}
                        <tr>
                            <td>{{ name }}</td>
                            <td>
                                {% if homepage %}<a href="{{ homepage }}">{{ version }} <span class="glyphicon glyphicon-link" aria-hidden="true"></span></a>{% else %}{{ version }}{% endif %}
                            </td>
                            <td class="text-center"><a href="{{ url_for('database', name=name) }}"><span class="glyphicon glyphicon-download" aria-hidden="true"></span></a></td>
                        </tr>
                    {% endfor %}
                    </tbody>
                </table>
                <div class="panel-footer">
                    <p style="text-align: center">
                        Developed with ❤️ in 🇩🇪 by <a href="https://github.com/cthoyt">@cthoyt</a>. Source code
                        available at
                        <a href="https://github.com/cthoyt/bioversions">https://github.com/cthoyt/bioversions</a>.
                    </p>
                </div>
            </div>
        </div>
    </div>
{% endblock %}
