diff --git a/umap/static/umap/base.css b/umap/static/umap/base.css index 4bf1ce0a..803c5068 100644 --- a/umap/static/umap/base.css +++ b/umap/static/umap/base.css @@ -84,6 +84,11 @@ hgroup { hgroup > :not(:first-child):last-child { font-weight: normal; } +hgroup p, +hgroup button { + margin: 0; +} + /* * List @@ -158,10 +163,23 @@ dt { } .grid-container { display: grid; - grid-template-columns: repeat(3, minmax(0, 1fr)); + --grid-layout-gap: calc(var(--gutter) * 2); + --grid-column-count: 3; + --grid-item--min-width: 300px; + + /** + * Calculated values. + */ + --gap-count: calc(var(--grid-column-count) - 1); + --total-gap-width: calc(var(--gap-count) * var(--grid-layout-gap)); + --grid-item--max-width: calc((100% - var(--total-gap-width)) / var(--grid-column-count)); + + grid-template-columns: repeat(auto-fill, minmax(max(var(--grid-item--min-width), var(--grid-item--max-width)), 1fr)); + grid-gap: var(--grid-layout-gap); } .grid-container.by4 { - grid-template-columns: repeat(4, minmax(0, 1fr)); + --grid-column-count: 4; + --grid-item--min-width: 60px; } .grid-container > * { text-align: center; diff --git a/umap/static/umap/content.css b/umap/static/umap/content.css index 3aad3eff..64687adf 100644 --- a/umap/static/umap/content.css +++ b/umap/static/umap/content.css @@ -56,9 +56,9 @@ body.login header { .map_fragment { width: 100%; } -.map_list .map_fragment, +.map_fragment, .demo_map .map_fragment { - height: 210px; + height: var(--map-fragment-height); } .map_list .legend { padding-top: 7px; @@ -164,6 +164,9 @@ h2.tabs a:hover { color: #efefef; text-decoration: underline; } +.more_button { + min-height: var(--map-fragment-height); +} /* **************************** */ diff --git a/umap/static/umap/map.css b/umap/static/umap/map.css index 9becf5c5..998d8d12 100644 --- a/umap/static/umap/map.css +++ b/umap/static/umap/map.css @@ -660,10 +660,6 @@ a.umap-control-caption, .umap-caption .header i.icon { flex-shrink: 0; } -.umap-caption hgroup p, -.umap-caption hgroup button { - margin: 0; -} .umap-browser .main-toolbox { padding-left: 4px; /* Align with toolbox below */ border-top: 1px solid var(--color-mediumGray); diff --git a/umap/static/umap/vars.css b/umap/static/umap/vars.css index af30d376..68df8ee3 100644 --- a/umap/static/umap/vars.css +++ b/umap/static/umap/vars.css @@ -45,6 +45,7 @@ --box-margin: 14px; --text-margin: 7px; --dialog-width: 40vw; + --map-fragment-height: 210px; /* z-indexes (leaflet CSS sets the map at 400 by default) */ --zindex-alert: 500; diff --git a/umap/templates/auth/user_detail.html b/umap/templates/auth/user_detail.html index 0c47e768..5a9b3a4d 100644 --- a/umap/templates/auth/user_detail.html +++ b/umap/templates/auth/user_detail.html @@ -13,7 +13,7 @@
-
+
{% if maps %} {% include "umap/map_list.html" %} {% else %} diff --git a/umap/templates/auth/user_stars.html b/umap/templates/auth/user_stars.html index fd26af24..49121347 100644 --- a/umap/templates/auth/user_stars.html +++ b/umap/templates/auth/user_stars.html @@ -13,7 +13,7 @@
-
+
{% if maps %} {% include "umap/map_list.html" %} {% else %} diff --git a/umap/templates/umap/content.html b/umap/templates/umap/content.html index deaf4526..09cd647b 100644 --- a/umap/templates/umap/content.html +++ b/umap/templates/umap/content.html @@ -43,22 +43,27 @@ {% endblock bottom_js %} diff --git a/umap/templates/umap/home.html b/umap/templates/umap/home.html index ade195b0..408bd8d2 100644 --- a/umap/templates/umap/home.html +++ b/umap/templates/umap/home.html @@ -20,11 +20,13 @@ {% endif %}
{% if maps %} -

- {% blocktrans %}Get inspired, browse maps{% endblocktrans %} -

-
- {% include "umap/map_list.html" %} +
+

+ {% blocktrans %}Get inspired, browse maps{% endblocktrans %} +

+
+ {% include "umap/map_list.html" %} +
{% endif %}
diff --git a/umap/templates/umap/map_list.html b/umap/templates/umap/map_list.html index 990b2acb..16e559f3 100644 --- a/umap/templates/umap/map_list.html +++ b/umap/templates/umap/map_list.html @@ -1,22 +1,19 @@ {% load umap_tags i18n %} {% for map_inst in maps %} -
-
+
{% map_fragment map_inst prefix=prefix page=request.GET.p %} -
- {{ map_inst.name }} +
+

{{ map_inst.name }}

{% with author=map_inst.get_author %} {% if author %} - {% trans "by" %} {{ author }} +

{% trans "by" %} {{ author }}

{% endif %} {% endwith %} -
+
{% endfor %} {% if maps.has_next %} - + {% trans "More" %} {% endif %} diff --git a/umap/templates/umap/search.html b/umap/templates/umap/search.html index a62b4ae3..7883bb65 100644 --- a/umap/templates/umap/search.html +++ b/umap/templates/umap/search.html @@ -12,7 +12,7 @@ {% block maincontent %} {% include "umap/search_bar.html" %}
-
+
{% if request.GET.q %} {% if maps %}

@@ -22,7 +22,9 @@ {{ count }} maps found: {% endblocktranslate %}

- {% include "umap/map_list.html" with prefix="search_map" %} +
+ {% include "umap/map_list.html" with prefix="search_map" %} +
{% else %}

{% trans "No map found." %} @@ -32,7 +34,9 @@

{% trans "Latest created maps" %}

- {% include "umap/map_list.html" with prefix="search_map" %} +
+ {% include "umap/map_list.html" with prefix="search_map" %} +
{% endif %}
diff --git a/umap/templates/umap/team_detail.html b/umap/templates/umap/team_detail.html index db6c586b..9a6a44eb 100644 --- a/umap/templates/umap/team_detail.html +++ b/umap/templates/umap/team_detail.html @@ -18,7 +18,7 @@ {% endif %}
-
+
{% if maps %} {% include "umap/map_list.html" %} {% else %}