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
0a96cd66
Commit
0a96cd66
authored
Mar 27, 2016
by
Serge S. Koval
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small fixes
parent
b9737f56
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
26 deletions
+17
-26
base.py
flask_admin/model/base.py
+15
-24
row_actions.html
...k_admin/templates/bootstrap2/admin/model/row_actions.html
+2
-2
No files found.
flask_admin/model/base.py
View file @
0a96cd66
...
...
@@ -459,12 +459,11 @@ class BaseModelView(BaseView, ActionsMixin):
actions endpoints are accessible.
"""
column_
list
_row_actions
=
None
column_
extra
_row_actions
=
None
"""
List of row actions (instances of :class:`~flask_admin.model.template.BaseListRowAction`).
Behaviour of this field is affected by `columns_override_default_row_actions` field
value. By default, Flask-Admin will generate standard per-row actions (edit, delete, etc)
Flask-Admin will generate standard per-row actions (edit, delete, etc)
and will append custom actions from this list right after them.
For example::
...
...
@@ -478,12 +477,6 @@ class BaseModelView(BaseView, ActionsMixin):
]
"""
column_override_default_row_actions
=
False
"""
If set to `True`, will disable default row actions (view, edit, etc) and will only use
items from `column_list_row_actions`.
"""
simple_list_pager
=
False
"""
Enable or disable simple list pager.
...
...
@@ -954,26 +947,24 @@ class BaseModelView(BaseView, ActionsMixin):
"""
Return list of row action objects, each is instance of :class:`~flask_admin.model.template.BaseListRowAction`
"""
# TODO: Maybe pre-calculate
actions
=
[]
if
not
self
.
column_override_default_row_actions
:
if
self
.
can_view_details
:
if
self
.
details_modal
:
actions
.
append
(
template
.
ViewPopupRowAction
())
else
:
actions
.
append
(
template
.
ViewRowAction
())
if
self
.
can_view_details
:
if
self
.
details_modal
:
actions
.
append
(
template
.
ViewPopupRowAction
())
else
:
actions
.
append
(
template
.
ViewRowAction
())
if
self
.
can_edit
:
if
self
.
edit_modal
:
actions
.
append
(
template
.
EditPopupRowAction
())
else
:
actions
.
append
(
template
.
EditRowAction
())
if
self
.
can_edit
:
if
self
.
edit_modal
:
actions
.
append
(
template
.
EditPopupRowAction
())
else
:
actions
.
append
(
template
.
EditRowAction
())
if
self
.
can_delete
:
actions
.
append
(
template
.
DeleteRowAction
())
if
self
.
can_delete
:
actions
.
append
(
template
.
DeleteRowAction
())
return
actions
+
(
self
.
column_
list
_row_actions
or
[])
return
actions
+
(
self
.
column_
extra
_row_actions
or
[])
def
get_details_columns
(
self
):
"""
...
...
flask_admin/templates/bootstrap2/admin/model/row_actions.html
View file @
0a96cd66
...
...
@@ -7,7 +7,7 @@
{% endmacro %}
{% macro view_row(action, row_id, row) %}
{{ link(action, get_url('.details_view', id=row_id, url=return_url), 'fa fa-eye glyphicon
glyph
icon-eye-open') }}
{{ link(action, get_url('.details_view', id=row_id, url=return_url), 'fa fa-eye glyphicon icon-eye-open') }}
{% endmacro %}
{% macro view_row_popup(action, row_id, row) %}
...
...
@@ -15,7 +15,7 @@
{% endmacro %}
{% macro edit_row(action, row_id, row) %}
{{ link(action, get_url('.edit_view', id=row_id, url=return_url), 'fa fa-pencil glyphicon
glyph
icon-pencil') }}
{{ link(action, get_url('.edit_view', id=row_id, url=return_url), 'fa fa-pencil glyphicon icon-pencil') }}
{% endmacro %}
{% macro edit_row_popup(action, row_id, row) %}
...
...
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