Feedback
Admin
Dashboard
Inbox
Admin Access
You need to be logged in as an admin to view feedback.
Log In
–
Total Responses
–
From Beta Users
–
From Subscribers
–
Mobile %
Show:
All
Beta only
Subscribers only
Loading feedback…
No feedback yet — it's coming!
Load more
function getCookie(n){for(var c=document.cookie.split(";"),i=0;i
(function(){var p="cloche_token",r=localStorage.getItem(p)||"",u="all",i=[],a=0,w=30,y=0;getCookie("polsia_session")?fetch("/api/admin/check-cookie",{credentials:"include"}).then(function(e){return e.ok?e.json():{success:!1}}).then(function(e){e.success?(_useCookie=!0,document.getElementById("mainContent").style.display="",document.getElementById("loadingMsg").style.display="",document.getElementById("feedbackList").innerHTML="",c()):r?m(r):window.location.href="/login?redirect=/admin-feedback"}).catch(function(){r?m(r):window.location.href="/login?redirect=/admin-feedback"}):r?m(r):window.location.href="/login?redirect=/admin-feedback",document.querySelectorAll(".filter-btn").forEach(function(e){e.addEventListener("click",function(){document.querySelectorAll(".filter-btn").forEach(function(t){t.classList.remove("active")}),e.classList.add("active"),u=e.dataset.filter,a=0,c()})});function m(e){document.getElementById("mainContent").style.display="",document.getElementById("loadingMsg").style.display="",document.getElementById("feedbackList").innerHTML="",document.getElementById("emptyState").style.display="none",fetch("/api/admin/feedback?limit=500",{headers:{Authorization:"Bearer "+e}}).then(function(t){if(t.status===401)throw localStorage.removeItem(p),window.location.href="/login?redirect=/admin-feedback",new Error("Session expired");if(t.status===403){document.getElementById("mainContent").style.display="none",document.getElementById("authGate").style.display="";var o=document.getElementById("authError");throw o.textContent="Your account does not have admin access.",o.style.display="",new Error("Not admin")}if(!t.ok)throw new Error("HTTP "+t.status);return t.json()}).then(function(t){if(!t.success)throw new Error(t.message||"Unknown error");document.getElementById("loadingMsg").style.display="none",fetch("/api/auth/me",{headers:{Authorization:"Bearer "+e}}).then(function(o){return o.json()}).then(function(o){o.user&&o.user.email&&(document.getElementById("headerEmail").textContent=o.user.email)}).catch(function(){}),i=t.feedback||[],y=t.total||i.length,v(),a=0,c()}).catch(function(t){if(!(t.message==="Session expired"||t.message==="Not admin")){document.getElementById("loadingMsg").style.display="none",document.getElementById("mainContent").style.display="none",document.getElementById("authGate").style.display="";var o=document.getElementById("authError");o.textContent="Failed to load feedback. Please try again.",o.style.display=""}})}function v(){var e=i.filter(function(d){return d.is_trial}).length,t=i.length-e,o=i.filter(function(d){return d.device_type==="mobile"}).length,g=i.length>0?Math.round(o/i.length*100):0;document.getElementById("statTotal").textContent=y,document.getElementById("statTrial").textContent=e,document.getElementById("statSubscriber").textContent=t,document.getElementById("statDevices").textContent=g+"%"}function c(){var e=i.filter(function(n){return u==="trial"?n.is_trial:u==="subscriber"?!n.is_trial:!0}),t=document.getElementById("feedbackList");if(a===0&&(t.innerHTML=""),e.length===0){document.getElementById("emptyState").style.display="",document.getElementById("loadMoreWrap").style.display="none",document.getElementById("pageCount").textContent="";return}document.getElementById("emptyState").style.display="none";var o=Math.min(a+w,e.length),g=e.slice(a,o);a=o,g.forEach(function(n){var h=document.createElement("div");h.className="fb-card";var E=new Date(n.created_at).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"}),s="";n.is_trial&&(s+='
Beta
'),n.page_url&&(s+='
'+l(n.page_url.replace(/\.html$/,"").replace(/^\//,"")||"home")+"
"),n.device_type&&(s+='
'+l(n.device_type)+"
"),n.zone&&(s+='
Zone '+l(n.zone)+"
"),n.user_tier&&(s+='
'+l(n.user_tier)+"
");var f="";n.user_email&&(f='
'+l(n.user_email)+(n.user_name?" \xB7 "+l(n.user_name):"")+"
"),h.innerHTML=['
','
'+l(n.feedback_text)+"
",'
'+E+"
","
",'
'+s+f+"
"].join(""),t.appendChild(h)});var d=e.length-a;d>0?(document.getElementById("loadMoreWrap").style.display="",document.getElementById("pageCount").textContent="Showing "+a+" of "+e.length):(document.getElementById("loadMoreWrap").style.display="none",document.getElementById("pageCount").textContent="All "+e.length+" shown")}document.getElementById("loadMoreBtn").addEventListener("click",c);function l(e){return String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}})();