Show featured stations in search tab empty state
All checks were successful
Build and push Docker image / build (push) Successful in 13s
Test / test (push) Successful in 13s

This commit is contained in:
marwin 2026-03-16 21:16:28 +01:00
parent 35d979a06a
commit 6c1d95ea90
2 changed files with 19 additions and 0 deletions

View file

@ -831,6 +831,24 @@ const CURATED_LISTS = [
function initCuratedLists() {
const container = document.getElementById('curated-lists');
if (!container) return;
if (INITIAL_FEATURED && INITIAL_FEATURED.length) {
const section = document.createElement('div');
section.className = 'curated-section';
section.innerHTML = `<div class="curated-label">&#9733; Featured</div>`;
const ul = document.createElement('ul');
ul.className = 'curated-stations';
INITIAL_FEATURED.forEach(s => {
const li = document.createElement('li');
li.innerHTML = `<button class="btn btn-sm" onclick="playStation('${escapeAttr(s.url)}', '${escapeAttr(s.name)}', null)">▶</button>
<span class="curated-name">${escapeHtml(s.name)}</span>
${s.description ? `<span class="muted" style="font-size:0.78rem">${escapeHtml(s.description)}</span>` : ''}`;
ul.appendChild(li);
});
section.appendChild(ul);
container.appendChild(section);
}
CURATED_LISTS.forEach(list => {
const section = document.createElement('div');
section.className = 'curated-section';

View file

@ -202,6 +202,7 @@
<script>
// Pass Django context into JS
const INITIAL_SAVED = {{ saved_stations|safe }};
const INITIAL_FEATURED = {{ featured_stations|safe }};
const IS_AUTHENTICATED = {{ user.is_authenticated|yesno:"true,false" }};
</script>
<script src="/static/js/app.js"></script>