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
6a019144
Commit
6a019144
authored
Dec 21, 2015
by
Serge S. Koval
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:flask-admin/flask-admin
parents
1e95669b
d86035e6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
92 additions
and
70 deletions
+92
-70
base.py
flask_admin/model/base.py
+14
-0
list.html
flask_admin/templates/bootstrap2/admin/model/list.html
+39
-35
list.html
flask_admin/templates/bootstrap3/admin/model/list.html
+39
-35
No files found.
flask_admin/model/base.py
View file @
6a019144
...
...
@@ -432,6 +432,20 @@ class BaseModelView(BaseView, ActionsMixin):
Controls if the primary key should be displayed in the list view.
"""
column_display_actions
=
True
"""
Controls the display of the row actions (edit, delete, details, etc.)
column in the list view.
Useful for preventing a blank column from displaying if your view does
not use any build-in or custom row actions.
This column is not hidden automatically due to backwards compatibility.
Note: This only affects display and does not control whether the row
actions endpoints are accessible.
"""
simple_list_pager
=
False
"""
Enable or disable simple list pager.
...
...
flask_admin/templates/bootstrap2/admin/model/list.html
View file @
6a019144
...
...
@@ -70,7 +70,9 @@
</th>
{% endif %}
{% block list_row_actions_header %}
<th
class=
"span1"
>
</th>
{% if admin_view.column_display_actions %}
<th
class=
"span1"
>
</th>
{% endif %}
{% endblock %}
{% set column = 0 %}
{% for c, name in list_columns %}
...
...
@@ -112,42 +114,44 @@
</td>
{% endif %}
{% block list_row_actions_column scoped %}
<td
class=
"list-buttons-column"
>
{% block list_row_actions scoped %}
{%- if admin_view.can_view_details -%}
{%- if admin_view.details_modal -%}
{{ lib.add_modal_button(url=get_url('.details_view', id=get_pk_value(row), url=return_url, modal=True), title=_gettext('View Record'), content='
<span
class=
"fa fa-eye glyphicon icon-eye-open"
></span>
') }}
{% else %}
<a
class=
"icon"
href=
"{{ get_url('.details_view', id=get_pk_value(row), url=return_url) }}"
title=
"{{ _gettext('View Record') }}"
>
<span
class=
"fa fa-eye icon-eye-open"
></span>
</a>
{% if admin_view.column_display_actions %}
<td
class=
"list-buttons-column"
>
{% block list_row_actions scoped %}
{%- if admin_view.can_view_details -%}
{%- if admin_view.details_modal -%}
{{ lib.add_modal_button(url=get_url('.details_view', id=get_pk_value(row), url=return_url, modal=True), title=_gettext('View Record'), content='
<span
class=
"fa fa-eye glyphicon icon-eye-open"
></span>
') }}
{% else %}
<a
class=
"icon"
href=
"{{ get_url('.details_view', id=get_pk_value(row), url=return_url) }}"
title=
"{{ _gettext('View Record') }}"
>
<span
class=
"fa fa-eye icon-eye-open"
></span>
</a>
{%- endif -%}
{%- endif -%}
{%- endif
-%}
{%- if admin_view.can_edit
-%}
{%- if admin_view.edit_modal -%
}
{
{ lib.add_modal_button(url=get_url('.edit_view', id=get_pk_value(row), url=return_url, modal=True), title=_gettext('Edit Record'), content='
<i
class=
"fa fa-pencil icon-pencil"
></i>
') }
}
{% else %}
<a
class=
"icon"
href=
"{{ get_url('.edit_view', id=get_pk_value(row), url=return_url) }}"
title=
"{{ _gettext('Edit Record') }}"
>
<
i
class=
"fa fa-pencil icon-pencil"
></i
>
</a>
{%- if admin_view.can_edit
-%}
{%- if admin_view.edit_modal
-%}
{{ lib.add_modal_button(url=get_url('.edit_view', id=get_pk_value(row), url=return_url, modal=True), title=_gettext('Edit Record'), content='
<i
class=
"fa fa-pencil icon-pencil"
></i>
') }
}
{
% else %
}
<a
class=
"icon"
href=
"{{ get_url('.edit_view', id=get_pk_value(row), url=return_url) }}"
title=
"{{ _gettext('Edit Record') }}"
>
<i
class=
"fa fa-pencil icon-pencil"
></i
>
<
/a
>
{%- endif -%}
{%- endif -%}
{%- endif
-%}
{%- if admin_view.can_delete -%}
<form
class=
"icon"
method=
"POST"
action=
"{{ get_url('.delete_view') }}"
>
{{ delete_form.id(value=get_pk_value(row)
) }}
{{ delete_form.url(value=return_url) }
}
{% if delete_form.csrf_token %
}
{{ delete_form.csrf_token }
}
{% elif csrf_token %}
<input
type=
"hidden"
name=
"csrf_token"
value=
"{{ csrf_token() }}"
/>
{% endif %}
<button
onclick=
"return confirm('{{ _gettext('Are you sure you want to delete this record?') }}');"
title=
"{{ _gettext('Delete record') }}"
>
<
i
class=
"fa fa-trash icon-trash"
></i
>
</
button
>
</form>
{%
- endif -
%}
{% endblock %}
</td>
{%- if admin_view.can_delete
-%}
<form
class=
"icon"
method=
"POST"
action=
"{{ get_url('.delete_view') }}"
>
{{ delete_form.id(value=get_pk_value(row)) }}
{{ delete_form.url(value=return_url
) }}
{% if delete_form.csrf_token %
}
{{ delete_form.csrf_token }
}
{% elif csrf_token %
}
<input
type=
"hidden"
name=
"csrf_token"
value=
"{{ csrf_token() }}"
/>
{% endif %}
<button
onclick=
"return confirm('{{ _gettext('Are you sure you want to delete this record?') }}');"
title=
"{{ _gettext('Delete record') }}"
>
<i
class=
"fa fa-trash icon-trash"
></i
>
<
/button
>
</
form
>
{%- endif -%}
{%
endblock
%}
</td>
{%- endif -%}
{% endblock %}
{% for c, name in list_columns %}
...
...
flask_admin/templates/bootstrap3/admin/model/list.html
View file @
6a019144
...
...
@@ -70,7 +70,9 @@
</th>
{% endif %}
{% block list_row_actions_header %}
<th
class=
"col-md-1"
>
</th>
{% if admin_view.column_display_actions %}
<th
class=
"col-md-1"
>
</th>
{% endif %}
{% endblock %}
{% set column = 0 %}
{% for c, name in list_columns %}
...
...
@@ -112,42 +114,44 @@
</td>
{% endif %}
{% block list_row_actions_column scoped %}
<td
class=
"list-buttons-column"
>
{% block list_row_actions scoped %}
{%- if admin_view.can_view_details -%}
{%- if admin_view.details_modal -%}
{{ lib.add_modal_button(url=get_url('.details_view', id=get_pk_value(row), url=return_url, modal=True), title=_gettext('View Record'), content='
<span
class=
"fa fa-eye glyphicon glyphicon-eye-open"
></span>
') }}
{% else %}
<a
class=
"icon"
href=
"{{ get_url('.details_view', id=get_pk_value(row), url=return_url) }}"
title=
"{{ _gettext('View Record') }}"
>
<span
class=
"fa fa-eye glyphicon glyphicon-eye-open"
></span>
</a>
{% if admin_view.column_display_actions %}
<td
class=
"list-buttons-column"
>
{% block list_row_actions scoped %}
{%- if admin_view.can_view_details -%}
{%- if admin_view.details_modal -%}
{{ lib.add_modal_button(url=get_url('.details_view', id=get_pk_value(row), url=return_url, modal=True), title=_gettext('View Record'), content='
<span
class=
"fa fa-eye glyphicon glyphicon-eye-open"
></span>
') }}
{% else %}
<a
class=
"icon"
href=
"{{ get_url('.details_view', id=get_pk_value(row), url=return_url) }}"
title=
"{{ _gettext('View Record') }}"
>
<span
class=
"fa fa-eye glyphicon glyphicon-eye-open"
></span>
</a>
{%- endif -%}
{%- endif -%}
{%- endif
-%}
{%- if admin_view.can_edit
-%}
{%- if admin_view.edit_modal -%
}
{
{ lib.add_modal_button(url=get_url('.edit_view', id=get_pk_value(row), url=return_url, modal=True), title=_gettext('Edit Record'), content='
<span
class=
"fa fa-pencil glyphicon glyphicon-pencil"
></span>
') }
}
{% else %}
<a
class=
"icon"
href=
"{{ get_url('.edit_view', id=get_pk_value(row), url=return_url) }}"
title=
"{{ _gettext('Edit Record') }}"
>
<
span
class=
"fa fa-pencil glyphicon glyphicon-pencil"
></span
>
</a>
{%- if admin_view.can_edit
-%}
{%- if admin_view.edit_modal
-%}
{{ lib.add_modal_button(url=get_url('.edit_view', id=get_pk_value(row), url=return_url, modal=True), title=_gettext('Edit Record'), content='
<span
class=
"fa fa-pencil glyphicon glyphicon-pencil"
></span>
') }
}
{
% else %
}
<a
class=
"icon"
href=
"{{ get_url('.edit_view', id=get_pk_value(row), url=return_url) }}"
title=
"{{ _gettext('Edit Record') }}"
>
<span
class=
"fa fa-pencil glyphicon glyphicon-pencil"
></span
>
<
/a
>
{%- endif -%}
{%- endif -%}
{%- endif
-%}
{%- if admin_view.can_delete -%}
<form
class=
"icon"
method=
"POST"
action=
"{{ get_url('.delete_view') }}"
>
{{ delete_form.id(value=get_pk_value(row)
) }}
{{ delete_form.url(value=return_url) }
}
{% if delete_form.csrf_token %
}
{{ delete_form.csrf_token }
}
{% elif csrf_token %}
<input
type=
"hidden"
name=
"csrf_token"
value=
"{{ csrf_token() }}"
/>
{% endif %}
<button
onclick=
"return confirm('{{ _gettext('Are you sure you want to delete this record?') }}');"
title=
"Delete record"
>
<
span
class=
"fa fa-trash glyphicon glyphicon-trash"
></spa
n>
</
button
>
</form>
{%
- endif -
%}
{% endblock %}
</td>
{%- if admin_view.can_delete
-%}
<form
class=
"icon"
method=
"POST"
action=
"{{ get_url('.delete_view') }}"
>
{{ delete_form.id(value=get_pk_value(row)) }}
{{ delete_form.url(value=return_url
) }}
{% if delete_form.csrf_token %
}
{{ delete_form.csrf_token }
}
{% elif csrf_token %
}
<input
type=
"hidden"
name=
"csrf_token"
value=
"{{ csrf_token() }}"
/>
{% endif %}
<button
onclick=
"return confirm('{{ _gettext('Are you sure you want to delete this record?') }}');"
title=
"Delete record"
>
<span
class=
"fa fa-trash glyphicon glyphicon-trash"
></span
>
<
/butto
n>
</
form
>
{%- endif -%}
{%
endblock
%}
</td>
{%- endif -%}
{% endblock %}
{% for c, name in list_columns %}
<td
class=
"col-{{c}}"
>
...
...
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