{# vim: set ts=2 et sts=2 sw=2: #}
{% for tweet in tweets -%}
  <li class="tweet{% if tweet.reply_to %} reply{% endif %}" data-tweet-id="{{ tweet.id }}" id="tweet-{{ tweet.id }}">
    <div class="tweet-contents{{ loop.cycle('', ' alt') }}">
      <a href="http://twitter.com/{{ tweet.user }}" class="avatar" target="_blank">
        <img src="{{ tweet.profile_img }}" />
        <span class="twittername">{{ tweet.user }}</span>
      </a>
      <a href="http://twitter.com/{{ tweet.user }}/status/{{ tweet.id }}" class="permalink" target="_blank">
        <time datetime="{{ tweet.date|isotime }}">{{ tweet.date|utctimesince }} ago</time>
      </a>
      {% if tweet.replies %}
        <a href="#" class="reply_count" data-count="{{ tweet.reply_count }}">
          {% if tweet.reply_count > 1 %}
            {{ ngettext('{0} and {1} other replied', '{0} and {1} others replied',
                        tweet.reply_count - 1)|f(tweet.replies[-1].user, tweet.reply_count - 1) }}
          {% else %}
            {{ _('{0} replied')|f(tweet.replies[0].user) }}
          {% endif %}
        </a>
      {% elif settings.CC_SHOW_REPLIES %}
        <span class="reply_count">{{ _('Reply now') }}</span>
      {% endif %}
      <p class="text">{{ tweet.text|safe }}</p>
    </div>
    <div id="replies_{{ tweet.id }}" class="replies" data-tweet-id="{{ tweet.id }}">
      <ul>
        {% if tweet.replies %}
          {% with tweets = tweet.replies %}
            {% include 'customercare/tweets.html' %}
          {% endwith %}
        {% endif %}
      </ul>
    </div>
  </li>
{% endfor %}
