{% comment %} A list of a Tweet's Media objects (ie, photo, GIF or video). Expects: * tweet, the Tweet object. * view, 'list' (a generic list), 'day' or 'detail'. {% endcomment %} {% if tweet.media_count > 0 %} {% load l10n %} {% with media_list=tweet.media.all %} {% if media_list|length > 1 and view != 'detail' %} {% comment %} Multiple Photos, and not the Tweet's detail view. This assumes that if there are multiple items then they're photos, and there will be a maximum of 4. This is true as of 2016-05-07... {% endcomment %} {% else %} {% endif %} {% endwith %} {% endif %}