Update web/templates/search.html

This commit is contained in:
Joshua Laymon 2025-08-17 21:09:17 +00:00
parent 0e10a3c930
commit 82f7ce6ed5

View File

@ -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=>{
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,7 +147,11 @@
list.appendChild(li);
});
}
fetch("{% url 'api_get_search_history' %}").then(r=>r.json()).then(j=>{
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(()=>{});
@ -163,7 +174,11 @@
list.appendChild(li);
});
}
fetch("{% url 'api_get_recent_views' %}").then(r=>r.json()).then(j=>{
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(()=>{});
@ -224,19 +239,15 @@
}
.page-title.open .chevron { transform: rotate(180deg); }
.dropdown-toggle { cursor:pointer; }
</style>
<style>
/* ...keep your existing styles... */
/* Ensure the history heading keeps the chevron next to the text */
/* Keep the chevron next to the text */
.history-title{
display:inline-flex !important; /* don't stretch full width */
display:inline-flex !important;
align-items:center;
justify-content:flex-start !important;
gap:8px; /* space between text and chevron */
padding:10px 16px; /* left/right white space */
margin:0; /* remove default h1 margin */
gap:8px;
padding:10px 16px;
margin:0;
}
</style>
{% endblock %}