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
c5535724
Commit
c5535724
authored
Jun 14, 2017
by
Hadley Rich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add path argument to sort_url to fix sorting in sub directories in fileadmin.
parent
6f63bd25
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
__init__.py
flask_admin/contrib/fileadmin/__init__.py
+2
-2
list.html
flask_admin/templates/bootstrap2/admin/file/list.html
+2
-2
list.html
flask_admin/templates/bootstrap3/admin/file/list.html
+2
-2
No files found.
flask_admin/contrib/fileadmin/__init__.py
View file @
c5535724
...
@@ -848,13 +848,13 @@ class BaseFileAdmin(BaseView, ActionsMixin):
...
@@ -848,13 +848,13 @@ class BaseFileAdmin(BaseView, ActionsMixin):
else
:
else
:
action_form
=
None
action_form
=
None
def
sort_url
(
column
,
invert
=
False
):
def
sort_url
(
column
,
path
,
invert
=
False
):
desc
=
None
desc
=
None
if
invert
and
not
sort_desc
:
if
invert
and
not
sort_desc
:
desc
=
1
desc
=
1
return
self
.
get_url
(
'.index_view'
,
sort
=
column
,
desc
=
desc
)
return
self
.
get_url
(
'.index_view'
,
path
=
path
,
sort
=
column
,
desc
=
desc
)
return
self
.
render
(
self
.
list_template
,
return
self
.
render
(
self
.
list_template
,
dir_path
=
path
,
dir_path
=
path
,
...
...
flask_admin/templates/bootstrap2/admin/file/list.html
View file @
c5535724
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
<th>
<th>
{% if admin_view.is_column_sortable(column) %}
{% if admin_view.is_column_sortable(column) %}
{% if sort_column == column %}
{% if sort_column == column %}
<a
href=
"{{ sort_url(column, True) }}"
title=
"{{ _gettext('Sort by %(name)s', name=column) }}"
>
<a
href=
"{{ sort_url(column,
dir_path,
True) }}"
title=
"{{ _gettext('Sort by %(name)s', name=column) }}"
>
{{ admin_view.column_label(column) }}
{{ admin_view.column_label(column) }}
{% if sort_desc %}
{% if sort_desc %}
<i
class=
"fa fa-chevron-up icon-chevron-up"
></i>
<i
class=
"fa fa-chevron-up icon-chevron-up"
></i>
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
{% endif %}
{% endif %}
</a>
</a>
{% else %}
{% else %}
<a
href=
"{{ sort_url(column) }}"
title=
"{{ _gettext('Sort by %(name)s', name=column) }}"
>
{{ admin_view.column_label(column) }}
</a>
<a
href=
"{{ sort_url(column
, dir_path
) }}"
title=
"{{ _gettext('Sort by %(name)s', name=column) }}"
>
{{ admin_view.column_label(column) }}
</a>
{% endif %}
{% endif %}
{% else %}
{% else %}
{{ _gettext(admin_view.column_label(column)) }}
{{ _gettext(admin_view.column_label(column)) }}
...
...
flask_admin/templates/bootstrap3/admin/file/list.html
View file @
c5535724
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
<th>
<th>
{% if admin_view.is_column_sortable(column) %}
{% if admin_view.is_column_sortable(column) %}
{% if sort_column == column %}
{% if sort_column == column %}
<a
href=
"{{ sort_url(column, True) }}"
title=
"{{ _gettext('Sort by %(name)s', name=column) }}"
>
<a
href=
"{{ sort_url(column,
dir_path,
True) }}"
title=
"{{ _gettext('Sort by %(name)s', name=column) }}"
>
{{ admin_view.column_label(column) }}
{{ admin_view.column_label(column) }}
{% if sort_desc %}
{% if sort_desc %}
<span
class=
"fa fa-chevron-up glyphicon glyphicon-chevron-up"
></span>
<span
class=
"fa fa-chevron-up glyphicon glyphicon-chevron-up"
></span>
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
{% endif %}
{% endif %}
</a>
</a>
{% else %}
{% else %}
<a
href=
"{{ sort_url(column) }}"
title=
"{{ _gettext('Sort by %(name)s', name=column) }}"
>
{{ admin_view.column_label(column) }}
</a>
<a
href=
"{{ sort_url(column
, dir_path
) }}"
title=
"{{ _gettext('Sort by %(name)s', name=column) }}"
>
{{ admin_view.column_label(column) }}
</a>
{% endif %}
{% endif %}
{% else %}
{% else %}
{{ _gettext(admin_view.column_label(column)) }}
{{ _gettext(admin_view.column_label(column)) }}
...
...
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