Update web/templates/settings/home.html

This commit is contained in:
Joshua Laymon 2025-08-31 03:56:30 +00:00
parent f2d2eef9be
commit 85db9ee4dc

View File

@ -40,11 +40,25 @@
headers: { "X-CSRFToken": getCookie("csrftoken") } headers: { "X-CSRFToken": getCookie("csrftoken") }
}) })
.then(function(r){ return r.ok ? r.json() : Promise.reject(); }) .then(function(r){ return r.ok ? r.json() : Promise.reject(); })
.then(function(){ .then(function(data){
// Clear likely client-side copies too (harmless if not present)
var keys = ["recent_searches","recent_entries","recent_viewed","recently_viewed","recent_results","recentSearches","recentEntries"];
try {
keys.forEach(function(k){ localStorage.removeItem(k); sessionStorage.removeItem(k); });
} catch(e) {}
// Clear same-named cookies if any
try {
var expire = "expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/";
keys.forEach(function(k){ document.cookie = k + "=; " + expire; });
} catch(e) {}
// Toast
if (toast){ if (toast){
toast.textContent = "History cleared.";
toast.style.opacity = "1"; toast.style.opacity = "1";
setTimeout(function(){ toast.style.opacity = "0"; }, 1500); setTimeout(function(){ toast.style.opacity = "0"; }, 1500);
} }
// Optional: log which server keys were removed
if (data && data.cleared) { console.log("Cleared server keys:", data.cleared); }
}) })
.catch(function(){ /* silent per spec */ }); .catch(function(){ /* silent per spec */ });
}); });
@ -165,8 +179,8 @@
<label>Message</label> <label>Message</label>
<textarea name="message" rows="6" class="tool-input" placeholder="Whats new in this release…"></textarea> <textarea name="message" rows="6" class="tool-input" placeholder="Whats new in this release…"></textarea>
<label style="display:flex; gap:6px; align-items:center; margin-top:8px;"> <label style="display:flex; gap:6px; align-items:center; margin-top:8px;">
+ <input type="checkbox" name="is_active" checked> Active <input type="checkbox" name="is_active" checked> Active
+ </label> </label>
{% endif %} {% endif %}