Commit 3ddaaeaf authored by PJ Janse van Rensburg's avatar PJ Janse van Rensburg

Merge branch 'table_responsive' of...

Merge branch 'table_responsive' of git://github.com/abandonedbyrochacbruno/flask-admin into prs-to-merge
parents fe5996d2 accb9aad
......@@ -89,3 +89,53 @@ table.filters tr td {
.admin-form .controls {
margin-left: 110px;
}
@media only screen and (max-width: 800px) {
/* Force table to not be like tables anymore */
#no-more-tables table,
#no-more-tables thead,
#no-more-tables tbody,
#no-more-tables th,
#no-more-tables td,
#no-more-tables tr {
display: block;
}
/* Hide table headers (but not display: none;, for accessibility) */
#no-more-tables thead tr {
position: absolute;
top: -9999px;
left: -9999px;
}
#no-more-tables tr { border: 1px solid #ccc; }
#no-more-tables td {
/* Behave like a "row" */
border: none;
border-bottom: 1px solid #eee;
position: relative;
padding-left: 50%;
white-space: normal;
text-align:left;
}
#no-more-tables td:before {
/* Now like a table header */
position: absolute;
/* Top/left values mimic padding */
top: 6px;
left: 6px;
width: 45%;
padding-right: 10px;
white-space: nowrap;
text-align:left;
font-weight: bold;
}
/*
Label the data
*/
#no-more-tables td:before { content: attr(data-title); }
}
......@@ -103,3 +103,8 @@ body.modal-open {
margin-top: 20px;
margin-bottom: 10px;
}
.table-responsive
{
overflow-x: auto;
}
......@@ -22,6 +22,7 @@
{% endblock %}
{% block file_list_table %}
<div id="no-more-tables">
<table class="table table-striped table-bordered model-list">
<thead>
<tr>
......@@ -102,13 +103,13 @@
{% endblock %}
</td>
{% if is_dir %}
<td colspan="2">
<td colspan="2" data-title="{{ _gettext('Name') }}">
<a href="{{ get_dir_url('.index_view', path)|safe }}">
<i class="fa fa-folder-o icon-folder-close"></i> <span>{{ name }}</span>
</a>
</td>
{% else %}
<td>
<td data-title="{{ _gettext('Name') }}">
{% 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,
......@@ -121,7 +122,7 @@
{% endif %}
</td>
{% if admin_view.is_column_visible('size') %}
<td>
<td data-title="{{ _gettext('Size') }}">
{{ size|filesizeformat }}
</td>
{% endif %}
......@@ -135,6 +136,7 @@
</tr>
{% endfor %}
</table>
</div>
{% endblock %}
{% block toolbar %}
<div class="btn-toolbar">
......
......@@ -61,8 +61,9 @@
{% endif %}
{% block model_list_table %}
<table class="table table-striped table-bordered table-hover model-list">
<thead>
<div id="no-more-tables">
<table class="table table-striped table-bordered table-hover model-list cf">
<thead class="cf">
<tr>
{% block list_header scoped %}
{% if actions %}
......@@ -127,7 +128,7 @@
{% endblock %}
{% for c, name in list_columns %}
<td class="col-{{c}}">
<td class="col-{{c}}" data-title="{{ name }}">
{% if admin_view.is_editable(c) %}
{% set form = list_forms[get_pk_value(row)] %}
{% if form.csrf_token %}
......@@ -154,6 +155,7 @@
</tr>
{% endfor %}
</table>
</div>
{% block list_pager %}
{% if num_pages is not none %}
{{ lib.pager(page, num_pages, pager_url) }}
......
......@@ -22,6 +22,7 @@
{% endblock %}
{% block file_list_table %}
<div class="table-responsive">
<table class="table table-striped table-bordered model-list">
<thead>
<tr>
......@@ -135,6 +136,7 @@
</tr>
{% endfor %}
</table>
</div>
{% endblock %}
{% block toolbar %}
<div class="btn-toolbar">
......
......@@ -60,6 +60,7 @@
{% endif %}
{% block model_list_table %}
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover model-list">
<thead>
<tr>
......@@ -153,6 +154,7 @@
</tr>
{% endfor %}
</table>
</div>
{% block list_pager %}
{% if num_pages is not none %}
{{ lib.pager(page, num_pages, pager_url) }}
......
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