Projet

Général

Profil

Télécharger (2,23 ko) Statistiques
| Branche: | Tag: | Révision:

root / uauth / organization / templates / organization / users_table.html @ 836b9f76

1
{% extends "django_tables2/table.html" %}
2

    
3
{% load django_tables2 %}
4

    
5
{% block table.thead %}
6
<thead>
7
    <tr>
8
    {% for column in table.columns %}
9
        {% if column.orderable %}
10
        <th {{ column.attrs.th.as_html }}><a href="{% querystring table.prefixed_order_by_field=column.order_by_alias.next %}">{{ column.header }}</a></th>
11
        {% else %}
12
        <th {{ column.attrs.th.as_html }}>{{ column.header }}</th>
13
        {% endif %}
14
    {% endfor %}
15
    {% block table.head.last.column %}
16
    {% endblock %}
17
    </tr>
18
</thead>
19
{% endblock table.thead %}
20

    
21
{% block table.tbody.row %}
22
        <tr data-ref="{{ row.record.id }}" class="{{ forloop.counter|divisibleby:2|yesno:"even,odd" }}"> {# avoid cycle for Django 1.2-1.6 compatibility #}
23
            {% for column, cell in row.items %}
24
                <td {{ column.attrs.td.as_html }}>{% if column.localize == None %}{{ cell }}{% else %}{% if column.localize %}{{ cell|localize }}{% else %}{{ cell|unlocalize }}{% endif %}{% endif %}</td>
25
            {% endfor %}
26
            {% block table.tbody.last.column %}
27
            {% endblock %}
28
        </tr>
29
{% endblock table.tbody.row %}
30

    
31
{% block pagination %}
32
  <p class="paginator">
33
      {% if table.page.number > 1 %}
34
        {% if table.page.previous_page_number != 1 %}
35
          <a href="{% querystring table.prefixed_page_field=1 %}">1</a>
36
          ...
37
        {% endif %}
38
      {% endif %}
39

    
40
      {% if table.page.has_previous %}
41
        <a href="{% querystring table.prefixed_page_field=table.page.previous_page_number %}">{{ table.page.previous_page_number }}</a>
42
      {% endif %}
43

    
44
      <span class="this-page">{{ table.page.number }}</span>
45

    
46
      {% if table.page.has_next %}
47
        <a href="{% querystring table.prefixed_page_field=table.page.next_page_number %}">{{ table.page.next_page_number }}</a>
48
      {% endif %}
49
      {% if  table.page.number != table.page.paginator.num_pages %}
50
        {% if table.page.paginator.num_pages > 1 %}
51
          {% if table.page.next_page_number != table.page.paginator.num_pages %}
52
            ...
53
            <a href="{% querystring table.prefixed_page_field=table.page.paginator.num_pages %}">{{ table.page.paginator.num_pages }}</a>
54
          {% endif %}
55
        {% endif %}
56
      {% endif %}
57
  </p>
58
{% endblock %}
(4-4/4)