{% from "addons/listing/macros.html" import heading, item_info %}
{% set collection = collection or None %}
{% set username = request.user.username if request.user.is_authenticated() else '' %}
{% cache addons, extra=[collection, username] %}
{% for addon in addons %}
  <div class="item">
    {{ heading(addon, amo, collection=collection) }}
    <div class="item-info">
      {{ install_button(addon, collection=collection) }}
      {{ item_info(addon, amo, show_date, show_downloads) }}
      {% if request.user.is_authenticated() %}
        <div class="collection_widgets widgets condensed">
          {{ favorites_widget(addon, condensed=True) }}
          {{ collection_add_widget(addon, condensed=True) }}
          {{ sharing_widget(addon, condensed=True) }}
        </div>
      {% endif %}
    </div>
    <blockquote>
      {% if addon.is_persona() %}
        {{ persona_preview(addon.persona, linked=False) }}
      {% else %}
        <div>{{ addon.summary|truncate(250)|nl2br }}</div>
      {% endif %}
    </blockquote>
    {% if notes and notes[addon.id] %}
    <blockquote class="collector-note">
      <strong>{{ _("Collector's Note") }}</strong>
      {{ notes[addon.id] }}
    </blockquote>
    {% endif %}
  </div>
{% endfor %}
{% endcache %}

{% from "addons/listing/macros.html" import heading, item_info %}
{% set collection = collection or None %}
{% set collection_cache_key = collection.cache_key if collection else 'collection-none' %}
{% set userpk = request.user.pk if request.user.is_authenticated() else '' %}
{% cache addons, extra=[collection_cache_key, userpk] %}
{% for addon in addons %}
  <div class="item">
    {{ heading(addon, amo, collection=collection) }}
    <div class="item-info">
      {{ install_button(addon, collection=collection) }}
      {{ item_info(addon, amo, show_date, show_downloads) }}
      {% if request.user.is_authenticated() %}
        <div class="collection_widgets widgets condensed">
          {{ favorites_widget(addon, condensed=True) }}
          {{ collection_add_widget(addon, condensed=True) }}
          {{ sharing_widget(addon, condensed=True) }}
        </div>
      {% endif %}
    </div>
    <blockquote>
      {% if addon.is_persona() %}
        {{ persona_preview(addon.persona, linked=False) }}
      {% else %}
        <div>{{ addon.summary|truncate(250)|nl2br }}</div>
      {% endif %}
    </blockquote>
    {% if notes and notes[addon.id] %}
    <blockquote class="collector-note">
      <strong>{{ _("Collector's Note") }}</strong>
      {{ notes[addon.id] }}
    </blockquote>
    {% endif %}
  </div>
{% endfor %}
{% endcache %}

Work around cache-machine bug with 'extra' containing non-ascii stuff
Work around cache-machine bug with 'extra' containing non-ascii stuff
