{# Takes output from get_fresh_content template tag to create mixed list of what's new #}
{% load typogrify_tags markup %}

<div id="top-content" class="columned phi">
  {% with top_content.0 as object %}
    {% with object.get_image as img %}
      <article id="featured_item" {% if img.vertical %}class="vertical"{% endif %}>
        <a href="{{ object.get_absolute_url }}">
          {# the firstof below is because video has thumb_url, not a real image object #}
          <img src="{% if img.vertical %}{{ img.t_360u }}{% else %}{% firstof img.t_640 img %}{% endif %}" {% if img.vertical %} class="vertical"{% endif %}>
          {% comment %}
            To do: ensure this works:
            {% if top_item.show_label or top_item.opinion %}
                <span class="kicker meta">{% firstof top_item.show_label.category top_item.author top_item.other_author|title %}</span>
            {% endif %}
          {% endcomment %}
          <h1>{{ object.title }}</h1>
          {% if object.subhead %}
            <h2 class="subhead">{{ object.subhead }}</h2>
          {% endif %}
        </a>
        <section class="article-body">
          {% if object.has_image %}
            <p>{{ object.summary }}</p>
          {% else %}
            <p>{{ object.body|markdown|truncatewords:"90" }}
          {% endif %}
        </section>
      </article>
    {% endwith %}
  {% endwith %}
  <div id="more_featured">
    {% for object in top_content|slice:"1:" %}
      <article>
        <a href="{{ object.get_absolute_url }}">
          <img src="{% firstof object.get_image.image.t_320  object.get_image %}">
          <h1 class="has_photos">{{ object.title }}</h1>
          {% comment %}
            {% if obj.show_label %}
              <span class="kicker meta"><a href="{{ obj.show_label.get_absolute_url }}">{{ obj.show_label.category }}</a></span>
              {% else %}
                {% if obj.opinion %}
                  <span class="meta opinion">{% firstof obj.author obj.other_author|title %}, Opinion {{ obj.show_label.category }} </span>
                {% endif %}         
            {% endif %}
          {% endcomment %}
          <p>{{ object.summary|truncatewords:"15" }}</p>
        </a>
      </article>
    {% endfor %}
  </div>
</div>