diff --git a/web/templates/search.html b/web/templates/search.html
index 9a8015e..851fca0 100644
--- a/web/templates/search.html
+++ b/web/templates/search.html
@@ -59,11 +59,11 @@
- Search History ▾
-
+ data-target="#history-panel"
+ role="button"
+ aria-expanded="false">
+ Search History
▾
+
@@ -116,11 +116,18 @@
root.classList.remove('fs-small','fs-default','fs-large','fs-xlarge');
root.classList.add('fs-'+size);
}
- fetch("{% url 'api_get_prefs' %}").then(r=>r.json()).then(j=>{
- if (j.ok) applyFont(j.font_size || 'default');
- }).catch(()=>{});
+ fetch("{% url 'api_get_prefs' %}", { cache: 'no-store', credentials: 'same-origin' })
+ .then(r=>r.json()).then(j=>{
+ if (j.ok) applyFont(j.font_size || 'default');
+ }).catch(()=>{});
- // Search history (PUT BACK selected-fields subtitle)
+ // Small helper to add a cache-busting param
+ function bust(url){
+ const sep = url.includes('?') ? '&' : '?';
+ return url + sep + 't=' + Date.now();
+ }
+
+ // Search history (keeps selected-fields subtitle)
function renderHistory(items){
const list = document.getElementById('searchHistoryList');
const empty = document.getElementById('searchHistoryEmpty');
@@ -140,9 +147,13 @@
list.appendChild(li);
});
}
- fetch("{% url 'api_get_search_history' %}").then(r=>r.json()).then(j=>{
- if (j.ok) renderHistory(j.items);
- }).catch(()=>{});
+ fetch(bust("{% url 'api_get_search_history' %}"), {
+ cache: 'no-store',
+ credentials: 'same-origin'
+ })
+ .then(r=>r.json()).then(j=>{
+ if (j.ok) renderHistory(j.items);
+ }).catch(()=>{});
// Recently viewed
function renderRecent(items){
@@ -163,9 +174,13 @@
list.appendChild(li);
});
}
- fetch("{% url 'api_get_recent_views' %}").then(r=>r.json()).then(j=>{
- if (j.ok) renderRecent(j.items);
- }).catch(()=>{});
+ fetch(bust("{% url 'api_get_recent_views' %}"), {
+ cache: 'no-store',
+ credentials: 'same-origin'
+ })
+ .then(r=>r.json()).then(j=>{
+ if (j.ok) renderRecent(j.items);
+ }).catch(()=>{});
// Dropdown toggle for History
document.querySelectorAll('.dropdown-toggle').forEach(btn=>{
@@ -224,19 +239,15 @@
}
.page-title.open .chevron { transform: rotate(180deg); }
.dropdown-toggle { cursor:pointer; }
-
-
{% endblock %}
\ No newline at end of file