{% extends "_base.html" %}

{% block page_title %}{{ super() }} | Portfolio{% endblock %}

{% block main_content %}
  <div class="center">
    <h1>Portfolio</h1>

    <p>{{ this.content }}</p>

    <ul>
      {% for category in this.children %}
        <li><a href="#{{ category.slug }}">{{ category.name }}</a></li>
      {% endfor %}
    </ul>

    {% for category in this.children %}
      <h2 id="{{ category.slug }}">{{ category.name }}</h2>
      {% for item in category.children %}
        <div class="project project-{{ category.slug }}" id="{{ item.slug }}">
          <h3><a href="{% if item.url_in_list and item.url %}{{ item.url }}{% else %}{{ item|url }}{% endif %}">{{ item.name }}</a></h3>
          {% if category.show_images %}
            <div><img src="{{ item.attachments.images.first().thumbnail(512, 256, crop=True)|url }}"></div>
          {% endif %}
          {% if item.description_in_list %}
            <p>{{ item.description }}</p>
          {% endif %}
        </div>
      {% endfor %}
      <div class="clearfloat"></div>
      {% if not loop.last %}<hr class="light">{% endif %}
    {% endfor %}
  </div>
{% endblock %}
