change_list_results.html 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. {% load i18n admin_static %}
  2. {% if result_hidden_fields %}
  3. <div class="hiddenfields">{# DIV for HTML validation #}
  4. {% for item in result_hidden_fields %}{{ item }}{% endfor %}
  5. </div>
  6. {% endif %}
  7. <div class="results">
  8. <table id="result_list">
  9. <thead>
  10. <tr>
  11. {% for header in result_headers %}
  12. <th scope="col" {{ header.class_attrib }}>
  13. {% if header.sortable %}
  14. {% if header.sort_priority > 0 %}
  15. <div class="sortoptions">
  16. {% if num_sorted_fields > 1 %}<span class="sortpriority" title="{% blocktrans with priority_number=header.sort_priority %}Sorting priority: {{ priority_number }}{% endblocktrans %}">{{ header.sort_priority }}</span>{% endif %}
  17. <a class="sortremove" href="{{ header.url_remove }}" title="{% trans "Remove from sorting" %}"><span class="icon-cross"></span> </a>
  18. <a href="{{ header.url_toggle }}" class="toggle {% if header.ascending %}ascending{% else %}descending{% endif %}" title="{% trans "Toggle sorting" %}"></a>
  19. </div>
  20. {% endif %}
  21. {% endif %}
  22. <div class="text">{% if header.sortable %}<a href="{{ header.url_primary }}">{{ header.text|capfirst }}</a>{% else %}<span>{{ header.text|capfirst }}</span>{% endif %}</div>
  23. <div class="clear"></div>
  24. </th>
  25. {% endfor %}
  26. </tr>
  27. </thead>
  28. <tbody>
  29. {% if cl.result_count == 0 %}
  30. <tr><td colspan="{{ result_headers|length }}" style="text-align: center;">
  31. <strong>{{ cl.result_count }}</strong> {% ifequal cl.result_count 1 %}{{ cl.opts.verbose_name }}{% else %}{{ cl.opts.verbose_name_plural }}{% endifequal %}
  32. {% if cl.result_count != cl.full_result_count %}
  33. (<a href="?{% if cl.is_popup %}{{ POPUP_VAR }}=1{% endif %}">{% trans 'try to reset filters' %}</a>)
  34. {% endif %}
  35. </td></tr>
  36. {% endif %}
  37. {% for result in results %}
  38. {% if result.form.non_field_errors %}
  39. <tr><td colspan="{{ result|length }}">{{ result.form.non_field_errors }}</td></tr>
  40. {% endif %}
  41. <tr class="{% cycle 'row1' 'row2' %}">{% for item in result %}{{ item }}{% endfor %}</tr>
  42. {% endfor %}
  43. </tbody>
  44. </table>
  45. </div>