Commit 7a4c7f6b authored by Tom Kedem's avatar Tom Kedem

File-admin: fixed documentation and added support for bootstrap2.

parent 56f33444
......@@ -710,9 +710,9 @@ class BaseFileAdmin(BaseView, ActionsMixin):
def column_label(self, column):
"""
Determines if the given column is visible.
Gets the column's label.
:param column: The column to query.
:return: Whether the column is visible.
:return: The column's label.
"""
return self.column_labels[column]
......
......@@ -32,8 +32,26 @@
</th>
{% endif %}
<th class="span1">&nbsp;</th>
<th>{{ _gettext('Name') }}</th>
<th>{{ _gettext('Size') }}</th>
{% for column in admin_view.column_list %}
<th>
{% if admin_view.is_column_sortable(column) %}
{% if sort_column == column %}
<a href="{{ sort_url(column, True) }}" title="{{ _gettext('Sort by %(name)s', name=column) }}">
{{ admin_view.column_label(column) }}
{% if sort_desc %}
<i class="fa fa-chevron-up icon-chevron-up"></i>
{% else %}
<i class="fa fa-chevron-down icon-chevron-down"></i>
{% endif %}
</a>
{% else %}
<a href="{{ sort_url(column) }}" title="{{ _gettext('Sort by %(name)s', name=column) }}">{{ admin_view.column_label(column) }}</a>
{% endif %}
{% else %}
{{ _gettext(admin_view.column_label(column)) }}
{% endif %}
</th>
{% endfor %}
{% endblock %}
</tr>
</thead>
......@@ -102,10 +120,17 @@
{{ name }}
{% endif %}
</td>
{% if admin_view.is_column_visible('size') %}
<td>
{{ size|filesizeformat }}
</td>
{% endif %}
{% if admin_view.is_column_visible('date') %}
<td>
{{ timestamp_format(date) }}
</td>
{% endif %}
{% endif %}
{% endblock %}
</tr>
{% endfor %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment