Skip to content
Snippets Groups Projects
Commit 01a77c00 authored by Guillaume (gdi)'s avatar Guillaume (gdi)
Browse files

[FIX] website_blog: prevent losing search params

Before this commit, search criteria could be lost when a visitor added a
new search criteria on blogs. This commit solves this problem.

Steps to reproduce the issues (with activate the sidebar):
- Go to the /blog
- Click on the adventure tag
- Select a month in the date filter

=> The adventure tag is lost.

- Go to the /blog
- Select a month in the date filter
- Click on the adventure tag
- Remove the date filter

=> The adventure tag is lost.

- Go to the /blog
- Select a month in the date filter
- Search for the blogs containing the word "heli"

=> The date filter is lost.

task-3058239

X-original-commit: https://github.com/odoo/odoo/commit/835230b226fb9c73f6dad3b9a8163a651bd2b9ee
Part-of: odoo/odoo#113979
parent ba82684a
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,8 @@
<t t-set="display_description" t-valuef="true"/>
<t t-set="display_detail" t-valuef="false"/>
<input type="hidden" name="tag" t-att-value="tag"/>
<input type="hidden" name="date_begin" t-att-value="date_begin"/>
<input type="hidden" name="date_end" t-att-value="date_end"/>
</t>
</div>
</nav>
......@@ -64,7 +66,7 @@
<optgroup t-foreach="nav_list" t-as="year" t-attf-label="#{year}">
<option t-foreach="nav_list[year]" t-as="months"
t-att="[('selected' if date_begin and (months['date_begin'] == date_begin) else 'unselected' ) , 'true' ]"
t-attf-value="#{blog_url(date_begin=months['date_begin'], date_end=months['date_end'])}">
t-attf-value="#{blog_url(date_begin=months['date_begin'], date_end=months['date_end'], tag=tag)}">
<t t-esc="months['month']"/>
<t t-esc="year"/>
</option>
......
......@@ -66,7 +66,7 @@ according to the enabled options.
<span t-if="date_begin" class="align-items-baseline border d-inline-flex pl-2 rounded mb-2">
<i class="fa fa-calendar-o mr-2 text-muted"/>
<t t-esc="date_begin" t-options="{'widget': 'date', 'format': 'MMM yyyy'}"></t>
<a t-attf-href="#{blog_url(date_begin=False, date_end=False)}" class="btn border-0 py-1">&#215;</a>
<a t-attf-href="#{blog_url(date_begin=False, date_end=False, tag=tag)}" class="btn border-0 py-1">&#215;</a>
</span>
<hr class="mt-2"/>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment