From 5827a4cab0ccbd07660577b335ede6560825ca60 Mon Sep 17 00:00:00 2001 From: David Larlet Date: Fri, 9 Feb 2024 10:14:44 -0500 Subject: [PATCH] fix: make dashboard table scrollable --- umap/static/umap/content.css | 37 ++++--- umap/templates/umap/map_table.html | 162 +++++++++++++++-------------- 2 files changed, 104 insertions(+), 95 deletions(-) diff --git a/umap/static/umap/content.css b/umap/static/umap/content.css index 7b72ecd3..6ba29652 100644 --- a/umap/static/umap/content.css +++ b/umap/static/umap/content.css @@ -401,32 +401,39 @@ ul.umap-autocomplete { line-height: inherit; height: 2.5rem; } - -table.maps { +.table-wrapper { + overflow-x: scroll; +} +.table-wrapper table { width: 100%; + min-width: 600px; border-collapse: collapse; } -table.maps .map_fragment { +.table-wrapper table .map_fragment { display: block; height: 80vh; width: 100%; } -table.maps a, -table.maps thead { +.table-wrapper table a, +.table-wrapper table thead { color: #263B58; } -table.maps a:not(.icon-link) { +.table-wrapper table thead th:last-of-type { + min-width: 240px; +} + +.table-wrapper table a:not(.icon-link) { text-decoration: underline; } -table.maps button.map-icon { +.table-wrapper table button.map-icon { padding: 0; border: none; background: transparent; } -table.maps form { +.table-wrapper table form { display: inline; } -table.maps input[type="submit"] { +.table-wrapper table input[type="submit"] { display: inline; background-color: transparent; color: #263B58; @@ -436,22 +443,22 @@ table.maps input[type="submit"] { margin: 0; line-height: inherit; } -table.maps tbody tr { +.table-wrapper table tbody tr { border-bottom: 1px solid #BDC7D4; } -table.maps tbody tr td { +.table-wrapper table tbody tr td { padding: 5px 4px; } -table.maps tbody tr:nth-child(odd) { +.table-wrapper table tbody tr:nth-child(odd) { background-color: #f4f4f4; } -table.maps td { +.table-wrapper table td { text-align: center; } -table.maps thead tr { +.table-wrapper table thead tr { line-height: 2em; } -table.maps .button { +.table-wrapper table .button { margin-bottom: 2px; padding:4px 6px; height: 36px; diff --git a/umap/templates/umap/map_table.html b/umap/templates/umap/map_table.html index b1aff48e..4134cda8 100644 --- a/umap/templates/umap/map_table.html +++ b/umap/templates/umap/map_table.html @@ -1,85 +1,87 @@ {% load umap_tags i18n %} - - - - - - - - - - - - - - {% for map_inst in maps %} - {% with unique_id="map_"|addstr:map_inst.pk %} - - - + + {% endwith %} + {% endfor %} + +
{% blocktrans %}Name{% endblocktrans %}{% blocktrans %}Preview{% endblocktrans %}{% blocktrans %}Who can see{% endblocktrans %}{% blocktrans %}Who can edit{% endblocktrans %}{% blocktrans %}Last save{% endblocktrans %}{% blocktrans %}Owner{% endblocktrans %}{% blocktrans %}Actions{% endblocktrans %}
- {{ map_inst.name }} - - {{ map_inst.preview_settings|json_script:unique_id }} - - -
-
-

- -

+
+ + + + + + + + + + + + + + {% for map_inst in maps %} + {% with unique_id="map_"|addstr:map_inst.pk %} + + + + + + + + - - - - - - - {% endwith %} - {% endfor %} - -
{% blocktrans %}Name{% endblocktrans %}{% blocktrans %}Preview{% endblocktrans %}{% blocktrans %}Who can see{% endblocktrans %}{% blocktrans %}Who can edit{% endblocktrans %}{% blocktrans %}Last save{% endblocktrans %}{% blocktrans %}Owner{% endblocktrans %}{% blocktrans %}Actions{% endblocktrans %}
+ {{ map_inst.name }} + + {{ map_inst.preview_settings|json_script:unique_id }} + + + +
+

+ +

+ +
+
{{ map_inst.get_share_status_display }}{{ map_inst.get_edit_status_display }}{{ map_inst.modified_at }} + {{ map_inst.owner }} + + + + {% translate "Share" %} + + + + {% translate "Edit" %} + + + + {% translate "Download" %} + +
+ {% csrf_token %} +
- -
{{ map_inst.get_share_status_display }}{{ map_inst.get_edit_status_display }}{{ map_inst.modified_at }} - {{ map_inst.owner }} - - - - {% translate "Share" %} - - - - {% translate "Edit" %} - - - - {% translate "Download" %} - -
- {% csrf_token %} - -
-
- {% csrf_token %} - - -
-
+
+ {% csrf_token %} + + +
+
+ {% if maps.has_other_pages %}