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): ...@@ -710,9 +710,9 @@ class BaseFileAdmin(BaseView, ActionsMixin):
def column_label(self, column): def column_label(self, column):
""" """
Determines if the given column is visible. Gets the column's label.
:param column: The column to query. :param column: The column to query.
:return: Whether the column is visible. :return: The column's label.
""" """
return self.column_labels[column] return self.column_labels[column]
......
...@@ -32,8 +32,26 @@ ...@@ -32,8 +32,26 @@
</th> </th>
{% endif %} {% endif %}
<th class="span1">&nbsp;</th> <th class="span1">&nbsp;</th>
<th>{{ _gettext('Name') }}</th> {% for column in admin_view.column_list %}
<th>{{ _gettext('Size') }}</th> <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 %} {% endblock %}
</tr> </tr>
</thead> </thead>
...@@ -102,10 +120,17 @@ ...@@ -102,10 +120,17 @@
{{ name }} {{ name }}
{% endif %} {% endif %}
</td> </td>
{% if admin_view.is_column_visible('size') %}
<td> <td>
{{ size|filesizeformat }} {{ size|filesizeformat }}
</td> </td>
{% endif %} {% endif %}
{% if admin_view.is_column_visible('date') %}
<td>
{{ timestamp_format(date) }}
</td>
{% endif %}
{% endif %}
{% endblock %} {% endblock %}
</tr> </tr>
{% endfor %} {% 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