Add: user-management panel

This commit is contained in:
hyzen
2026-06-11 16:54:30 +05:30
parent 40cf3b54fb
commit ae1628eae4
73 changed files with 833 additions and 65 deletions

View File

@@ -6,4 +6,4 @@
<svg viewBox="0 0 24 24" width="10" height="10" fill="currentColor" aria-hidden="true"><path d="M6.18 15.64a2.18 2.18.0 012.18 2.18c0 1.19-.98 2.18-2.18 2.18C4.98 20 4 19.01 4 17.82a2.18 2.18.0 012.18-2.18M4 4.44A15.56 15.56.0 0119.56 20h-2.83A12.73 12.73.0 004 7.27V4.44m0 5.66a9.9 9.9.0 019.9 9.9h-2.83A7.07 7.07.0 004 12.93V10.1z"/></svg>
<span>Subscribe</span></button><div class=rss-subscribe__dropdown><button class=rss-subscribe__item data-rss-url=https://freedoms4.org/index.xml>All updates</button>
<button class=rss-subscribe__item data-rss-url=https://freedoms4.org/blog/index.xml>Blog posts</button></div></div></div></div><nav class="menu language"><ul class="menu__list language__list"><li class=menu__item><a class=menu__link href=/>Home</a></li><li class=menu__item><a class=menu__link href=/blog/>Blog</a></li><li class=menu__item><a class=menu__link href=/services/>Services</a></li><li class=menu__item><a class=menu__link href=/uninotes/>UniNotes</a></li><li class=menu__item><a class=menu__link href=/contact/>Contact</a></li></ul></nav></header><main class=main><nav class="uninotes-breadcrumbs breadcrumbs"><a href=/uninotes/>UniNotes</a>
<span>S4</span></nav><h1>S4</h1><ol class="uninotes-list uninotes-list--subjects"></ol></main><footer class=footer><p class=footer__copyright-notice>&copy; <a href=https://freedoms4.org>freedoms4.org</a> <a href=/changelog/>Changelog</a></p><p class=footer__theme-info>Built with <a href=https://gohugo.io>Hugo</a> and based on <a href=https://github.com/CyrusYip/hugo-theme-yue>Yue</a> theme</p></footer><script>(function(){document.querySelectorAll(".menu__item").forEach(function(e){var t=e.querySelector("a");t&&t.getAttribute("href")==="/uninotes/"&&e.classList.add("menu__item--uninotes")})})()</script><script>(function(){var e=document.getElementById("theme-toggle");if(!e)return;function t(){var e=localStorage.getItem("theme");return e?e:window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function n(e){document.documentElement.setAttribute("data-theme",e),localStorage.setItem("theme",e)}n(t()),e.addEventListener("click",function(){var e=document.documentElement.getAttribute("data-theme")||t();n(e==="dark"?"light":"dark")})})()</script><script>(function(){var t="https://backend.freedoms4.org/auth.php",e=localStorage.getItem("f4_username");if(!e)return;function n(e){var t,n,o,a,r,i=document.querySelector(".brand__auth");i&&!i.querySelector(".brand__auth-user")&&(i.classList.add("brand__auth--loggedin"),t=document.createElement("div"),t.className="brand__auth-user",n=document.createElement("button"),n.className="brand__auth-user-btn",n.setAttribute("aria-label","Account menu"),r=document.createElement("span"),r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12" fill="currentColor"><path d="M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"/></svg>',n.appendChild(r.firstChild),n.appendChild(document.createTextNode(" "+e)),a=document.createElement("div"),a.className="brand__auth-user-dropdown",o=document.createElement("button"),o.className="brand__auth-user-logout",o.textContent="Log Out",o.addEventListener("click",s),a.appendChild(o),t.appendChild(n),t.appendChild(a),i.appendChild(t),n.addEventListener("click",function(e){e.stopPropagation(),t.classList.toggle("is-open")}),document.addEventListener("click",function(){t.classList.remove("is-open")}))}function s(){fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({action:"logout"})}).finally(function(){localStorage.removeItem("f4_username"),localStorage.removeItem("f4_login_time"),localStorage.removeItem("f4_session_fails"),window.location.reload()})}n(e)})()</script><script>(function(){var t,e=document.querySelector(".rss-subscribe");if(!e)return;t=e.querySelector(".rss-subscribe__btn"),t.addEventListener("click",function(t){t.stopPropagation(),e.classList.toggle("is-open")}),document.addEventListener("click",function(t){e.contains(t.target)||e.classList.remove("is-open")}),e.querySelectorAll(".rss-subscribe__item").forEach(function(t){t.addEventListener("click",function(n){n.stopPropagation();var s,o=t.getAttribute("data-rss-url"),a=t.textContent;function i(){t.textContent="Copied!",setTimeout(function(){t.textContent=a,e.classList.remove("is-open")},1200)}try{s=document.createElement("textarea"),s.value=o,s.style.cssText="position:fixed;top:0;left:0;opacity:0;pointer-events:none;",document.body.appendChild(s),s.focus(),s.select(),document.execCommand("copy"),document.body.removeChild(s),i()}catch{navigator.clipboard&&navigator.clipboard.writeText(o).then(i).catch(function(){t.textContent=o})}})})})()</script></body></html>
<span>S4</span></nav><h1>S4</h1><ol class="uninotes-list uninotes-list--subjects"></ol></main><footer class=footer><p class=footer__copyright-notice>&copy; <a href=https://freedoms4.org>freedoms4.org</a> <a href=/changelog/>Changelog</a></p><p class=footer__theme-info>Built with <a href=https://gohugo.io>Hugo</a> and based on <a href=https://github.com/CyrusYip/hugo-theme-yue>Yue</a> theme</p></footer><script>(function(){document.querySelectorAll(".menu__item").forEach(function(e){var t=e.querySelector("a");t&&t.getAttribute("href")==="/uninotes/"&&e.classList.add("menu__item--uninotes")})})()</script><script>(function(){var e=document.getElementById("theme-toggle");if(!e)return;function t(){var e=localStorage.getItem("theme");return e?e:window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function n(e){document.documentElement.setAttribute("data-theme",e),localStorage.setItem("theme",e)}n(t()),e.addEventListener("click",function(){var e=document.documentElement.getAttribute("data-theme")||t();n(e==="dark"?"light":"dark")})})()</script><script>(function(){var t="https://backend.freedoms4.org/auth.php",e=localStorage.getItem("f4_username");if(!e)return;function n(e){var t,n,o,i,a,c,r=document.querySelector(".brand__auth");r&&!r.querySelector(".brand__auth-user")&&(r.classList.add("brand__auth--loggedin"),t=document.createElement("div"),t.className="brand__auth-user",n=document.createElement("button"),n.className="brand__auth-user-btn",n.setAttribute("aria-label","Account menu"),c=document.createElement("span"),c.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12" fill="currentColor"><path d="M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"/></svg>',n.appendChild(c.firstChild),n.appendChild(document.createTextNode(" "+e)),o=document.createElement("div"),o.className="brand__auth-user-dropdown",i=document.createElement("button"),i.className="brand__auth-user-logout",i.textContent="Log Out",i.addEventListener("click",s),e==="hyzen"&&(a=document.createElement("a"),a.className="brand__auth-user-admin",a.href="/admin/",a.textContent="User Management",o.appendChild(a)),o.appendChild(i),o.appendChild(i),t.appendChild(n),t.appendChild(o),r.appendChild(t),n.addEventListener("click",function(e){e.stopPropagation(),t.classList.toggle("is-open")}),document.addEventListener("click",function(){t.classList.remove("is-open")}))}function s(){fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({action:"logout"})}).finally(function(){localStorage.removeItem("f4_username"),localStorage.removeItem("f4_login_time"),localStorage.removeItem("f4_session_fails"),window.location.reload()})}n(e)})()</script><script>(function(){var t,e=document.querySelector(".rss-subscribe");if(!e)return;t=e.querySelector(".rss-subscribe__btn"),t.addEventListener("click",function(t){t.stopPropagation(),e.classList.toggle("is-open")}),document.addEventListener("click",function(t){e.contains(t.target)||e.classList.remove("is-open")}),e.querySelectorAll(".rss-subscribe__item").forEach(function(t){t.addEventListener("click",function(n){n.stopPropagation();var s,o=t.getAttribute("data-rss-url"),a=t.textContent;function i(){t.textContent="Copied!",setTimeout(function(){t.textContent=a,e.classList.remove("is-open")},1200)}try{s=document.createElement("textarea"),s.value=o,s.style.cssText="position:fixed;top:0;left:0;opacity:0;pointer-events:none;",document.body.appendChild(s),s.focus(),s.select(),document.execCommand("copy"),document.body.removeChild(s),i()}catch{navigator.clipboard&&navigator.clipboard.writeText(o).then(i).catch(function(){t.textContent=o})}})})})()</script></body></html>