Update web/templates/search.html
This commit is contained in:
parent
0e10a3c930
commit
82f7ce6ed5
@ -63,7 +63,7 @@
|
|||||||
role="button"
|
role="button"
|
||||||
aria-expanded="false">
|
aria-expanded="false">
|
||||||
Search History <span class="chevron">▾</span>
|
Search History <span class="chevron">▾</span>
|
||||||
</h1>
|
</h1>
|
||||||
<div id="history-panel" class="dropdown-panel">
|
<div id="history-panel" class="dropdown-panel">
|
||||||
<hr style="border:none; border-top:1px solid var(--border); margin:12px 0;">
|
<hr style="border:none; border-top:1px solid var(--border); margin:12px 0;">
|
||||||
|
|
||||||
@ -116,11 +116,18 @@
|
|||||||
root.classList.remove('fs-small','fs-default','fs-large','fs-xlarge');
|
root.classList.remove('fs-small','fs-default','fs-large','fs-xlarge');
|
||||||
root.classList.add('fs-'+size);
|
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');
|
if (j.ok) applyFont(j.font_size || 'default');
|
||||||
}).catch(()=>{});
|
}).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){
|
function renderHistory(items){
|
||||||
const list = document.getElementById('searchHistoryList');
|
const list = document.getElementById('searchHistoryList');
|
||||||
const empty = document.getElementById('searchHistoryEmpty');
|
const empty = document.getElementById('searchHistoryEmpty');
|
||||||
@ -140,7 +147,11 @@
|
|||||||
list.appendChild(li);
|
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);
|
if (j.ok) renderHistory(j.items);
|
||||||
}).catch(()=>{});
|
}).catch(()=>{});
|
||||||
|
|
||||||
@ -163,7 +174,11 @@
|
|||||||
list.appendChild(li);
|
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);
|
if (j.ok) renderRecent(j.items);
|
||||||
}).catch(()=>{});
|
}).catch(()=>{});
|
||||||
|
|
||||||
@ -224,19 +239,15 @@
|
|||||||
}
|
}
|
||||||
.page-title.open .chevron { transform: rotate(180deg); }
|
.page-title.open .chevron { transform: rotate(180deg); }
|
||||||
.dropdown-toggle { cursor:pointer; }
|
.dropdown-toggle { cursor:pointer; }
|
||||||
</style>
|
|
||||||
|
|
||||||
<style>
|
/* Keep the chevron next to the text */
|
||||||
/* ...keep your existing styles... */
|
|
||||||
|
|
||||||
/* Ensure the history heading keeps the chevron next to the text */
|
|
||||||
.history-title{
|
.history-title{
|
||||||
display:inline-flex !important; /* don't stretch full width */
|
display:inline-flex !important;
|
||||||
align-items:center;
|
align-items:center;
|
||||||
justify-content:flex-start !important;
|
justify-content:flex-start !important;
|
||||||
gap:8px; /* space between text and chevron */
|
gap:8px;
|
||||||
padding:10px 16px; /* left/right white space */
|
padding:10px 16px;
|
||||||
margin:0; /* remove default h1 margin */
|
margin:0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Loading…
Reference in New Issue
Block a user