Blob Blame Raw
{% extends "master.html" %}

{% block title %}Home{% endblock %}
{%block tag %}home{% endblock %}


{% macro render_row(items) -%}
    {% for row in items %}
    <div class="project_row">
        {% for repo in row %}
            <a class="project_link"
                href="{{ url_for('view_repo', repo=repo.name) }}">
                <img src='{{ url_for("static", filename="fedocal.png") }}' alt="" />
                <span class="repo_name">{{ repo.name }}</span>
                <span class="repo_desc">{{ repo.description | wraps(20) }}</span>
            </a>
        {% endfor %}
    </div>
    {% else %}
    <p>No project found</p>
    {% endfor %}
{%- endmacro %}

{% block content %}

<h2>Projects</h2>

{% if total_page and total_page > 1 %}
<table>
    <tr>
        <td>
        {% if page > 1%}
            <a href="{{ url_for('index') }}?page={{page - 1}}">
                &lt; Previous
            </a>
        {% else %}
            &lt; Previous
        {% endif %}
        </td>
        <td>{{ page }} / {{ total_page }}</td>
        <td>
            {% if page < total_page %}
            <a href="{{ url_for('index') }}?page={{page + 1}}">
                Next &gt;
            </a>
            {% else %}
            Next >
            {% endif %}
        </td>
    </tr>
</table>
{% endif %}

<section class="project_list">
  {{ render_row(repos) }}
</section>

{% endblock %}