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
5fc259cd
Commit
5fc259cd
authored
Nov 20, 2014
by
msempere
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sorting by modified date
parent
2323b5e0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
fileadmin.py
flask_admin/contrib/fileadmin.py
+5
-1
list.html
flask_admin/templates/bootstrap2/admin/file/list.html
+1
-1
list.html
flask_admin/templates/bootstrap3/admin/file/list.html
+1
-1
No files found.
flask_admin/contrib/fileadmin.py
View file @
5fc259cd
...
...
@@ -4,6 +4,7 @@ import platform
import
re
import
shutil
from
datetime
import
datetime
from
operator
import
itemgetter
from
werkzeug
import
secure_filename
...
...
@@ -459,7 +460,7 @@ class FileAdmin(BaseView, ActionsMixin):
rel_path
=
op
.
join
(
path
,
f
)
if
self
.
is_accessible_path
(
rel_path
):
items
.
append
((
f
,
rel_path
,
op
.
isdir
(
fp
),
op
.
getsize
(
fp
)))
items
.
append
((
f
,
rel_path
,
op
.
isdir
(
fp
),
op
.
getsize
(
fp
)
,
op
.
getmtime
(
fp
)
))
# Sort by name
items
.
sort
(
key
=
itemgetter
(
0
))
...
...
@@ -467,6 +468,9 @@ class FileAdmin(BaseView, ActionsMixin):
# Sort by type
items
.
sort
(
key
=
itemgetter
(
2
),
reverse
=
True
)
# Sort by modified date
items
.
sort
(
key
=
lambda
(
v1
,
v2
,
v3
,
v4
,
v5
):
(
v1
,
v2
,
v3
,
v4
,
datetime
.
fromtimestamp
(
v5
)),
reverse
=
True
)
# Generate breadcrumbs
accumulator
=
[]
breadcrumbs
=
[]
...
...
flask_admin/templates/bootstrap2/admin/file/list.html
View file @
5fc259cd
...
...
@@ -37,7 +37,7 @@
{% endblock %}
</tr>
</thead>
{% for name, path, is_dir, size in items %}
{% for name, path, is_dir, size
, date
in items %}
<tr>
{% block list_row scoped %}
{% if actions %}
...
...
flask_admin/templates/bootstrap3/admin/file/list.html
View file @
5fc259cd
...
...
@@ -37,7 +37,7 @@
{% endblock %}
</tr>
</thead>
{% for name, path, is_dir, size in items %}
{% for name, path, is_dir, size
, date
in items %}
<tr>
{% block list_row scoped %}
{% if actions %}
...
...
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