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
46d64f69
Commit
46d64f69
authored
Jul 14, 2018
by
Ryan Beymer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flask-admin/flask-admin#1486 - fix column sizing
parent
8e11da2c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
71 deletions
+73
-71
list.html
flask_admin/templates/bootstrap4/admin/file/list.html
+72
-70
list.html
flask_admin/templates/bootstrap4/admin/model/list.html
+1
-1
No files found.
flask_admin/templates/bootstrap4/admin/file/list.html
View file @
46d64f69
...
...
@@ -23,7 +23,7 @@
{% block file_list_table %}
<div
class=
"table-responsive"
>
<table
class=
"table table-
striped table-bordered model-list
"
>
<table
class=
"table table-
hover
"
>
<thead>
<tr>
{% block list_header scoped %}
...
...
@@ -55,85 +55,87 @@
{% endblock %}
</tr>
</thead>
{% for name, path, is_dir, size, date in items %}
<tr>
{% block list_row scoped %}
{% if actions %}
<td>
{% if not is_dir %}
<input
type=
"checkbox"
name=
"rowid"
class=
"action-checkbox"
value=
"{{ path }}"
/>
{% endif %}
</td>
{% endif %}
<td>
{% block list_row_actions scoped %}
{% if admin_view.can_rename and path and name != '..' %}
{%- if admin_view.rename_modal -%}
{{ lib.add_modal_button(url=get_url('.rename', path=path, modal=True),
title=_gettext('Rename File'),
content='
<i
class=
"fas fa-pencil-alt"
></i>
') }}
{% else %}
<a
class=
"icon"
href=
"{{ get_url('.rename', path=path) }}"
title=
"{{ _gettext('Rename File') }}"
>
<i
class=
"fas fa-pencil-alt"
></i>
</a>
{%- endif -%}
<tbody>
{% for name, path, is_dir, size, date in items %}
<tr>
{% block list_row scoped %}
{% if actions %}
<td>
{% if not is_dir %}
<input
type=
"checkbox"
name=
"rowid"
class=
"action-checkbox"
value=
"{{ path }}"
/>
{% endif %}
</td>
{% endif %}
{%- if admin_view.can_delete and path -%}
{% if is_dir %}
{% if name != '..' and admin_view.can_delete_dirs %}
<td>
{% block list_row_actions scoped %}
{% if admin_view.can_rename and path and name != '..' %}
{%- if admin_view.rename_modal -%}
{{ lib.add_modal_button(url=get_url('.rename', path=path, modal=True),
title=_gettext('Rename File'),
content='
<i
class=
"fas fa-pencil-alt"
></i>
') }}
{% else %}
<a
class=
"icon"
href=
"{{ get_url('.rename', path=path) }}"
title=
"{{ _gettext('Rename File') }}"
>
<i
class=
"fas fa-pencil-alt"
></i>
</a>
{%- endif -%}
{% endif %}
{%- if admin_view.can_delete and path -%}
{% if is_dir %}
{% if name != '..' and admin_view.can_delete_dirs %}
<form
class=
"icon"
method=
"POST"
action=
"{{ get_url('.delete') }}"
>
{{ delete_form.path(value=path) }}
{{ delete_form.csrf_token }}
<button
onclick=
"return confirm('{{ _gettext('Are you sure you want to delete \\\'%(name)s\\\' recursively?', name=name) }}')"
>
<i
class=
"fas fa-times glyphicon glyphicon-remove"
></i>
</button>
</form>
{% endif %}
{% else %}
<form
class=
"icon"
method=
"POST"
action=
"{{ get_url('.delete') }}"
>
{{ delete_form.path(value=path) }}
{{ delete_form.csrf_token }}
<button
onclick=
"return confirm('{{ _gettext('Are you sure you want to delete \\\'%(name)s\\\'
recursively
?', name=name) }}')"
>
<i
class=
"fa
s fa-times glyphicon glyphicon-remove
"
></i>
<button
onclick=
"return confirm('{{ _gettext('Are you sure you want to delete \\\'%(name)s\\\'?', name=name) }}')"
>
<i
class=
"fa
fa-trash glyphicon glyphicon-trash
"
></i>
</button>
</form>
{% endif %}
{%- endif -%}
{% endblock %}
</td>
{% if is_dir %}
<td
colspan=
"2"
>
<a
href=
"{{ get_dir_url('.index_view', path)|safe }}"
>
<i
class=
"fa fa-folder-o glyphicon glyphicon-folder-close"
></i>
<span>
{{ name }}
</span>
</a>
</td>
{% else %}
<td>
{% if admin_view.can_download %}
{%- if admin_view.edit_modal and admin_view.is_file_editable(path) -%}
{{ lib.add_modal_button(url=get_file_url(path, modal=True)|safe,
btn_class='', content=name) }}
{% else %}
<a
href=
"{{ get_file_url(path)|safe }}"
>
{{ name }}
</a>
{%- endif -%}
{% else %}
<form
class=
"icon"
method=
"POST"
action=
"{{ get_url('.delete') }}"
>
{{ delete_form.path(value=path) }}
{{ delete_form.csrf_token }}
<button
onclick=
"return confirm('{{ _gettext('Are you sure you want to delete \\\'%(name)s\\\'?', name=name) }}')"
>
<i
class=
"fa fa-trash glyphicon glyphicon-trash"
></i>
</button>
</form>
{{ name }}
{% endif %}
{%- endif -%}
{% endblock %}
</td>
{% if is_dir %}
<td
colspan=
"2"
>
<a
href=
"{{ get_dir_url('.index_view', path)|safe }}"
>
<i
class=
"fa fa-folder-o glyphicon glyphicon-folder-close"
></i>
<span>
{{ name }}
</span>
</a>
</td>
{% else %}
<td>
{% if admin_view.can_download %}
{%- if admin_view.edit_modal and admin_view.is_file_editable(path) -%}
{{ lib.add_modal_button(url=get_file_url(path, modal=True)|safe,
btn_class='', content=name) }}
{% else %}
<a
href=
"{{ get_file_url(path)|safe }}"
>
{{ name }}
</a>
{%- endif -%}
{% else %}
{{ name }}
</td>
{% if admin_view.is_column_visible('size') %}
<td>
{{ size|filesizeformat }}
</td>
{% endif %}
</td>
{% if admin_view.is_column_visible('size') %}
<td>
{{ size|filesizeformat }}
</td>
{% endif %}
{% if admin_view.is_column_visible('date') %}
<td>
{{ timestamp_format(date) }}
</td>
{% endif %}
{% endif %}
{% endblock %}
</tr>
{% endfor %}
{% if admin_view.is_column_visible('date') %}
<td>
{{ timestamp_format(date) }}
</td>
{% endif %}
{% endif %}
{% endblock %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}
...
...
flask_admin/templates/bootstrap4/admin/model/list.html
View file @
46d64f69
...
...
@@ -78,7 +78,7 @@
{% endif %}
{% block list_row_actions_header %}
{% if admin_view.column_display_actions %}
<th
class=
"col-md-1"
>
</th>
<th>
</th>
{% endif %}
{% endblock %}
{% for c, name in list_columns %}
...
...
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