Update: hidden uninotes

This commit is contained in:
hyzen
2026-06-05 03:18:02 +05:30
parent 7641c25ab2
commit 1669b46e44
71 changed files with 193 additions and 125 deletions

View File

@@ -1,3 +1,14 @@
<script>
(function () {
// Hide UniNotes menu item for everyone except hyzen
document.querySelectorAll('.menu__item').forEach(function (li) {
var a = li.querySelector('a');
if (a && a.getAttribute('href') === '/uninotes/') {
li.classList.add('menu__item--uninotes');
}
});
})();
</script>
<script>
(function () {
var btn = document.getElementById('theme-toggle');

View File

@@ -17,6 +17,9 @@
(function(){
var t = localStorage.getItem('theme');
if (t) { document.documentElement.setAttribute('data-theme', t); }
if (localStorage.getItem('f4_username') === 'hyzen') {
document.documentElement.classList.add('hyzen-user');
}
})();
</script>

View File

@@ -38,4 +38,12 @@ $s.Page.Title $semesterName }}{{ $currentIdx = $i }}{{ end }} {{ end }}
<a class="page-nav__next-link" href="{{ $next.Page.RelPermalink }}">{{ $next.Page.Title }} →</a>
{{ end }}
</nav>
<script>
(function () {
if (localStorage.getItem('f4_username') !== 'hyzen') {
window.location.replace('/login/?next=' + encodeURIComponent(window.location.pathname));
}
})();
</script>
{{ end }} {{ end }}

View File

@@ -54,4 +54,12 @@ $d.code $subjectCode }}{{ $currentIdx = $i }}{{ end }} {{ end }}
<a class="page-nav__next-link" href="{{ $nextPage.RelPermalink }}">{{ $nextCode }} →</a>
{{ end }} {{ end }}
</nav>
<script>
(function () {
if (localStorage.getItem('f4_username') !== 'hyzen') {
window.location.replace('/login/?next=' + encodeURIComponent(window.location.pathname));
}
})();
</script>
{{ end }} {{ end }} {{ end }} {{ end }}

View File

@@ -126,4 +126,12 @@
{{ end }}
</div>
<script>
(function () {
if (localStorage.getItem('f4_username') !== 'hyzen') {
window.location.replace('/login/?next=' + encodeURIComponent(window.location.pathname));
}
})();
</script>
{{ end }}

View File

@@ -49,4 +49,12 @@ gt (len $sortedUnitDicts) 1 }}
<a class="page-nav__next-link" href="{{ $next.page.Params.uniturl }}">{{ $next.label }} →</a>
{{ end }}
</nav>
{{ end }} {{ end }} {{ end }} {{ partial "page/page-end.html" . }} {{ end }}
{{ end }} {{ end }} {{ end }} {{ partial "page/page-end.html" . }}
<script>
(function () {
if (localStorage.getItem('f4_username') !== 'hyzen') {
window.location.replace('/login/?next=' + encodeURIComponent(window.location.pathname));
}
})();
</script>
{{ end }}

View File

@@ -75,4 +75,12 @@
{{ if $hasLive }}</a>{{ else }}</div>{{ end }}
</div>
<script>
(function () {
if (localStorage.getItem('f4_username') !== 'hyzen') {
window.location.replace('/login/?next=' + encodeURIComponent(window.location.pathname));
}
})();
</script>
{{ end }}