{# Display edit-collage #}
{% load i18n workspaces %}
<div id="edit-collage"
     class="sidebarbox collage{% if stretched %} sidebarbox-stretched{% endif %}"
     data-collage-id="{{ collage_edit.id }}"
     >
  <h2>
    <span title="{% trans 'This is your current selection.' %}">
      {% trans 'Selection' %}
    </span>
  </h2>
  <table id="edit-collage-table" class="wscol-table">
  <tbody>
    {% for collage_item in collage_edit.collage_items.all %}
    <tr id="collage-items-{{ collage_item.id }}"
        class="collage-item paddme"
        title="{{ collage_item.name }}"
        data-object-id="{{ collage_item.id }}">
      {# Symbol, appears left. #}
      <td class="icontd">
      <img class="collage-item-image"
           src="{{ collage_item.adapter.symbol_url }}"
           width="16"
           height="16" />
      </td>
      <td class="icontd">
      <input id="{{ collage_item.id }}"
             class="collage-item-checkbox{% if reload_after_action %} reload-after-action{% endif %}"
             type="checkbox"
             {% if collage_item.visible %}
             checked="checked"
             {% endif %}
             href="{% url lizard_map_collage_item_edit %}"
             data-target-id="#edit-collage"/>
      </td>
      <td class="maintd">
      <a class="collage-item-name collage-popup"
         href="{% url lizard_map_collage_item_popup collage_item_id=collage_item.id %}">
        {% firstof collage_item.name '(noname)' %}
      </a>
      </td>
      {# Delete collage item. Tipsy tooltips won't disappear. #}
      <td class="lasttd">
      <a class="ss_sprite ss_delete sidebarbox-action-icon
                collage-item-delete{% if reload_after_action %} reload-after-action{% endif %}"
            title="{% trans 'Delete item' %}"
            href="{% url lizard_map_collage_item_edit %}"
            data-target-id="#edit-collage">
      </a>
      </td>
    </tr>
    {% empty %}
      {# No collage items #}
      <tr><td>{% trans 'Select items on the map.' %}</td></tr>
    {% endfor %}
  </tbody>
  </table>
  <ul class="wscol-actions">
    <li>
    <a id="collage-empty"
       href="{% url lizard_map_collage_empty %}"
       title="{% trans 'Empty your collage' %}"
       class="title btn btn-danger sidebarbox-action-icon action-post-workspace-empty{% if reload_after_action %} reload-after-action{% endif %}"
       data-target-id="#edit-collage">
      <i class="icon-trash icon-white"></i>
    </a>
    </li>
    <li>
    <button id="collage-popup"
       href="{% url lizard_map_collage_popup %}"
       title="{% trans 'Selection popup' %}"
       class="title btn sidebarbox-action-icon collage-popup"
       {% if not collage_edit.collage_items.exists %} disabled="disabled" {% endif %}>
      <i class="ss_sprite ss_chart_line"></i>
    </button>
    </li>
    {# Collage edit page #}
    <li>
    {% if not collage_edit.collage_items.exists %}
      <a class="btn sidebarbox-action-icon disabled"
         title="{% trans 'Selection page' %}"
         href="javascript:void(null)">
        <i class="ss_sprite ss_arrow_turn_right"></i>
      </a>
    {% else %}
      <a class="btn sidebarbox-action-icon"
         title="{% trans 'Selection page' %}"
         href="{% url lizard_map_collage_edit_detail %}">
        <i class="ss_sprite ss_arrow_turn_right"></i>
      </a>
    {% endif %}
    </li>
  </ul>
</div>
