Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
flask-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
flask-admin
Commits
7a4c7f6b
Commit
7a4c7f6b
authored
Sep 10, 2016
by
Tom Kedem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
File-admin: fixed documentation and added support for bootstrap2.
parent
56f33444
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
4 deletions
+29
-4
__init__.py
flask_admin/contrib/fileadmin/__init__.py
+2
-2
list.html
flask_admin/templates/bootstrap2/admin/file/list.html
+27
-2
No files found.
flask_admin/contrib/fileadmin/__init__.py
View file @
7a4c7f6b
...
...
@@ -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
]
...
...
flask_admin/templates/bootstrap2/admin/file/list.html
View file @
7a4c7f6b
...
...
@@ -32,8 +32,26 @@
</th>
{% endif %}
<th
class=
"span1"
>
</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 %}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment