[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: 53ac1736b323257b2545946a8f96d06294c7b8c8 Part-of: odoo/odoo#114253
This commit is contained in:
@@ -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 ps-2 rounded mb-2">
|
||||
<i class="fa fa-calendar-o me-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">×</a>
|
||||
<a t-attf-href="#{blog_url(date_begin=False, date_end=False, tag=tag)}" class="btn border-0 py-1">×</a>
|
||||
</span>
|
||||
<hr class="mt-2"/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user