Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compute z-index in search result template #153

Merged
merged 2 commits into from Aug 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,7 @@
- Fix discussions text wrap [#145](https://github.com/etalab/udata-front/pull/145)
- Update Venti buttons [#146](https://github.com/etalab/udata-front/pull/146)
- :warning: @blue-470 and @blue-500 are removed
- Fix z-index value in dataset search-result template [#153](https://github.com/etalab/udata-front/pull/153)

## 2.0.10 (2022-08-11)

Expand Down
3 changes: 2 additions & 1 deletion udata_front/theme/gouvfr/templates/dataset/list.html
Expand Up @@ -96,7 +96,8 @@ <h1 class="fr-mb-1w">{{_('Datasets')}}</h1>
<ul class="search-results fr-mt-3v">
{% for dataset in datasets %}
<li>
{% with z_index = "z-index: {index:d}".format(index=(datasets.page_size - loop.index0)) %}
{# FIXME: remove with loop when upgrading jinja. See https://github.com/pallets/jinja/pull/1242 #}
{% with loop_ = loop %}
{% include theme('dataset/search-result.html') %}
{% endwith %}
</li>
Expand Down
@@ -1,7 +1,7 @@
{% cache cache_duration, 'dataset-search-result', dataset.id|string, g.lang_code %}
{% from theme('macros/organization_name_with_certificate.html') import organization_name_with_certificate %}
{% from theme('macros/quality_score_with_tooltip.html') import quality_score_with_tooltip %}
<article class="fr-pt-5v fr-pb-6v fr-px-1w border-bottom border-default-grey fr-enlarge-link" style="{{z_index}}">
<article class="fr-pt-5v fr-pb-6v fr-px-1w border-bottom border-default-grey fr-enlarge-link" style="z-index: {{loop.length - loop.index0}}">
<div class="fr-grid-row fr-grid-row--gutters fr-grid-row--top">
<div class="fr-col-auto">
<div class="logo">
Expand Down
3 changes: 3 additions & 0 deletions udata_front/theme/gouvfr/templates/organization/display.html
Expand Up @@ -94,7 +94,10 @@ <h2 id="description" class="fr-h2 fr-mb-0">{{ _('Description') }}</h2>
<section id="organization-datasets" class="fr-py-9v fr-container">
<h2>{{ _('Datasets') }}<sup>{{ total_datasets }}</sup></h2>
{% for dataset in datasets %}
{# FIXME: remove with loop when upgrading jinja. See https://github.com/pallets/jinja/pull/1242 #}
{% with loop_ = loop %}
{% include theme('dataset/search-result.html') %}
{% endwith %}
{% endfor %}
<div class="fr-my-2w">
{{ paginator(datasets, arg_name='datasets_page', url='#organization-datasets') }}
Expand Down
3 changes: 3 additions & 0 deletions udata_front/theme/gouvfr/templates/page.html
Expand Up @@ -25,7 +25,10 @@ <h2>{{ _('Datasets') }} <sup>{{ datasets|length }}</sup></h2>
<div class="fr-grid-row fr-grid-row--gutters">
<div class="fr-col-12">
{% for dataset in datasets %}
{# FIXME: remove with loop when upgrading jinja. See https://github.com/pallets/jinja/pull/1242 #}
{% with loop_ = loop %}
{% include theme('dataset/search-result.html') %}
{% endwith %}
{% endfor %}
</div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions udata_front/theme/gouvfr/templates/post/display.html
Expand Up @@ -65,7 +65,10 @@ <h2>{{ _('Datasets') }} <sup>{{ post.datasets|length }}</sup></h2>
<div class="fr-grid-row">
<div class="fr-col-12">
{% for dataset in post.datasets %}
{# FIXME: remove with loop when upgrading jinja. See https://github.com/pallets/jinja/pull/1242 #}
{% with loop_ = loop %}
{% include theme('dataset/search-result.html') %}
{% endwith %}
{% endfor %}
</div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions udata_front/theme/gouvfr/templates/reuse/display.html
Expand Up @@ -263,7 +263,10 @@ <h2 id="used-datasets" class="fr-h2">
<ul class="fr-grid-row fr-grid-row--gutters">
{% for dataset in visible_datasets %}
<li class="fr-col-12">
{# FIXME: remove with loop when upgrading jinja. See https://github.com/pallets/jinja/pull/1242 #}
{% with loop_ = loop %}
{% include theme('dataset/search-result.html') %}
{% endwith %}
</li>
{% endfor %}
</ul>
Expand Down
5 changes: 4 additions & 1 deletion udata_front/theme/gouvfr/templates/topic/browse.html
Expand Up @@ -24,7 +24,10 @@
{% if datasets %}
<ul class="search-results">
{% for dataset in datasets %}
{% include theme('dataset/search-result.html') %}
{# FIXME: remove with loop when upgrading jinja. See https://github.com/pallets/jinja/pull/1242 #}
{% with loop_ = loop %}
{% include theme('dataset/search-result.html') %}
{% endwith %}
{% endfor %}
</ul>
{% if datasets.has_next %}
Expand Down
3 changes: 3 additions & 0 deletions udata_front/theme/gouvfr/templates/topic/datasets.html
Expand Up @@ -32,7 +32,10 @@

<ul class="search-results">
{% for dataset in datasets %}
{# FIXME: remove with loop when upgrading jinja. See https://github.com/pallets/jinja/pull/1242 #}
{% with loop_ = loop %}
{% include theme('dataset/search-result.html') %}
{% endwith %}
{% endfor %}
</ul>

Expand Down