Commit 0a96cd66 authored by Serge S. Koval's avatar Serge S. Koval

Small fixes

parent b9737f56
...@@ -459,12 +459,11 @@ class BaseModelView(BaseView, ActionsMixin): ...@@ -459,12 +459,11 @@ class BaseModelView(BaseView, ActionsMixin):
actions endpoints are accessible. 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`). 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 Flask-Admin will generate standard per-row actions (edit, delete, etc)
value. By default, Flask-Admin will generate standard per-row actions (edit, delete, etc)
and will append custom actions from this list right after them. and will append custom actions from this list right after them.
For example:: For example::
...@@ -478,12 +477,6 @@ class BaseModelView(BaseView, ActionsMixin): ...@@ -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 simple_list_pager = False
""" """
Enable or disable simple list pager. Enable or disable simple list pager.
...@@ -954,10 +947,8 @@ class BaseModelView(BaseView, ActionsMixin): ...@@ -954,10 +947,8 @@ class BaseModelView(BaseView, ActionsMixin):
""" """
Return list of row action objects, each is instance of :class:`~flask_admin.model.template.BaseListRowAction` Return list of row action objects, each is instance of :class:`~flask_admin.model.template.BaseListRowAction`
""" """
# TODO: Maybe pre-calculate
actions = [] actions = []
if not self.column_override_default_row_actions:
if self.can_view_details: if self.can_view_details:
if self.details_modal: if self.details_modal:
actions.append(template.ViewPopupRowAction()) actions.append(template.ViewPopupRowAction())
...@@ -973,7 +964,7 @@ class BaseModelView(BaseView, ActionsMixin): ...@@ -973,7 +964,7 @@ class BaseModelView(BaseView, ActionsMixin):
if self.can_delete: if self.can_delete:
actions.append(template.DeleteRowAction()) 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): def get_details_columns(self):
""" """
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
{% endmacro %} {% endmacro %}
{% macro view_row(action, row_id, row) %} {% macro view_row(action, row_id, row) %}
{{ link(action, get_url('.details_view', id=row_id, url=return_url), 'fa fa-eye glyphicon glyphicon-eye-open') }} {{ link(action, get_url('.details_view', id=row_id, url=return_url), 'fa fa-eye glyphicon icon-eye-open') }}
{% endmacro %} {% endmacro %}
{% macro view_row_popup(action, row_id, row) %} {% macro view_row_popup(action, row_id, row) %}
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
{% endmacro %} {% endmacro %}
{% macro edit_row(action, row_id, row) %} {% macro edit_row(action, row_id, row) %}
{{ link(action, get_url('.edit_view', id=row_id, url=return_url), 'fa fa-pencil glyphicon glyphicon-pencil') }} {{ link(action, get_url('.edit_view', id=row_id, url=return_url), 'fa fa-pencil glyphicon icon-pencil') }}
{% endmacro %} {% endmacro %}
{% macro edit_row_popup(action, row_id, row) %} {% macro edit_row_popup(action, row_id, row) %}
......
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