Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / templates / im / table_render.html @ 27e51b28

History | View | Annotate | Download (4.5 kB)

1
{% spaceless %}
2
{% load django_tables2 %}
3
{% load i18n %}
4
{% if table.page %}
5
<div class="table-container">
6
{% endif %}
7
{% block table %}
8
<table{% if  %} {{ table.attrs.as_html }}{% endif %}>
9
    {% if table.caption %}
10
    <caption>{{ table.caption }}</caption>
11
    {% endif %}
12
    {% nospaceless %}
13
    {% block table.thead %}
14
    <thead>
15
        <tr>
16
        {% for column in table.columns %}
17
            {% if column.orderable %}
18
            <th {{ column.attrs.th.as_html }}><a href="{% querystring table.prefixed_order_by_field=column.order_by_alias.next %}#{{ table.attrs.id }}">
19
                <span>{{ column.header }}</span></a></th>
20
            {% else %}
21
            <th {{ column.attrs.th.as_html }}>
22
                <span>{{ column.header }}</span>
23
            </th>
24
            {% endif %}
25
        {% endfor %}
26
        </tr>
27
    </thead>
28
    {% endblock table.thead %}
29
    {% block table.tbody %}
30
    <tbody>
31
        {% for row in table.page.object_list|default:table.rows %} {# support pagination #}
32
        {% block table.tbody.row %}
33
        <tr class="{% cycle "odd" "even" %}">
34
            {% for column, cell in row.items %}
35
                <td {{ column.attrs.td.as_html }}>{{ cell }}</td>
36
            {% endfor %}
37
        </tr>
38
        {% endblock table.tbody.row %}
39
        {% empty %}
40
        {% if table.empty_text %}
41
        {% block table.tbody.empty_text %}
42
        <tr><td colspan="{{ table.columns|length }}">{{ table.empty_text }}</td></tr>
43
        {% endblock table.tbody.empty_text %}
44
        {% endif %}
45
        {% endfor %}
46
    </tbody>
47
    {% endblock table.tbody %}
48
    {% block table.tfoot %}
49
    <tfoot></tfoot>
50
    {% endblock table.tfoot %}
51
    {% endnospaceless %}
52
</table>
53
{% endblock table %}
54

    
55
{% if table.page %}
56
{% with table.page.paginator.count as total %}
57
{% with table.page.object_list|length as count %}
58
{% block pagination %}
59
<div class="pagination clearfix">
60
        <p class="next-prev">
61
                {% if table.page.has_previous %}
62
            {% nospaceless %}{% block pagination.previous %}<a href="{% querystring table.prefixed_page_field=table.page.previous_page_number %}#{{ table.attrs.id }}">&lt;{% trans "Previous" %}</a>{% endblock pagination.previous %}{% endnospaceless %}
63
            {% else %}
64
            <a href="" class="disabled">&lt; {% trans "Previous" %}</a>
65
            {% endif %}
66
            
67
            {% if table.page.has_next %}
68
            {% nospaceless %}{% block pagination.next %}<a href="{% querystring table.prefixed_page_field=table.page.next_page_number %}#{{ table.attrs.id }}">{% trans "Next" %} &gt;</a>{% endblock pagination.next %}{% endnospaceless %}
69
            {% else %}
70
            <a href="" class="disabled">{% trans "Next" %} &gt;</a>
71
            {% endif %}
72
                
73
        </p>
74
        <span class="num">
75
                {% if table.page.has_previous or table.page.has_next %}
76
            {% nospaceless %}{% block pagination.current %} {% blocktrans with table.page.number as current and table.paginator.num_pages as total %}Page {{ current }} of {{ total }}{% endblocktrans %} {% endblock pagination.current %}{% endnospaceless %}
77
            {% endif %}
78
            {% comment %}
79
                ( {% nospaceless %}{% block pagination.cardinality %}{% if total != count %}{% blocktrans %}{{ count }} of {{ total }}{% endblocktrans %}{% else %}{{ total }}{% endif %} {% if total == 1 %}{{ table.data.verbose_name }}{% else %}{{ table.data.verbose_name_plural }}{% endif %}{% endblock pagination.cardinality %}{% endnospaceless %} )
80
                {% endcomment %}
81
                
82
                
83
        </span>
84
</div>
85

    
86

    
87
<ul class="pagination">
88
        {% comment %}
89
    {% if table.page.has_previous %}
90
    {% nospaceless %}{% block pagination.previous %}<li class="previous"><a href="{% querystring table.prefixed_page_field=table.page.previous_page_number %}#{{ table.attrs.id }}">{% trans "Previous" %}</a></li>{% endblock pagination.previous %}{% endnospaceless %}
91
    {% endif %}
92
         
93
    {% if table.page.has_previous or table.page.has_next %}
94
    {% nospaceless %}{% block pagination.current %}<li class="current">{% blocktrans with table.page.number as current and table.paginator.num_pages as total %}Page {{ current }} of {{ total }}{% endblocktrans %}</li>{% endblock pagination.current %}{% endnospaceless %}
95
    {% endif %}
96

    
97
    {% if table.page.has_next %}
98
    {% nospaceless %}{% block pagination.next %}<li class="next"><a href="{% querystring table.prefixed_page_field=table.page.next_page_number %}#{{ table.attrs.id }}">{% trans "Next" %}</a></li>{% endblock pagination.next %}{% endnospaceless %}
99
    {% endif %}
100
        {% endcomment %}
101
     
102
</ul>
103
{% endblock pagination %}
104
{% endwith %}
105
{% endwith %}
106
</div>
107
{% endif %}
108
{% endspaceless %}