feat(settings): add gear trigger and panel markup to base template
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
48179ee4b3
commit
8d49a8106f
2 changed files with 21 additions and 1 deletions
|
|
@ -14,12 +14,30 @@
|
||||||
<link title="kafka" type="application/opensearchdescription+xml" rel="search" href="/opensearch.xml">
|
<link title="kafka" type="application/opensearchdescription+xml" rel="search" href="/opensearch.xml">
|
||||||
</head>
|
</head>
|
||||||
<body class="{{if .Query}}search_on_results{{end}}">
|
<body class="{{if .Query}}search_on_results{{end}}">
|
||||||
|
<header class="site-header">
|
||||||
|
<span class="site-title">kafka</span>
|
||||||
|
<!-- Desktop trigger (hidden on mobile via CSS) -->
|
||||||
|
<button id="settings-trigger" class="settings-trigger settings-trigger-desktop"
|
||||||
|
aria-label="Preferences" aria-expanded="false" aria-controls="settings-popover">⚙</button>
|
||||||
|
</header>
|
||||||
|
<!-- Mobile FAB trigger (shown only on mobile via CSS) -->
|
||||||
|
<button id="settings-trigger-mobile" class="settings-trigger settings-trigger-mobile"
|
||||||
|
aria-label="Preferences" aria-expanded="false" aria-controls="settings-popover"
|
||||||
|
style="display:none;">⚙</button>
|
||||||
<main>
|
<main>
|
||||||
{{template "content" .}}
|
{{template "content" .}}
|
||||||
</main>
|
</main>
|
||||||
<footer>
|
<footer>
|
||||||
<p>Powered by <a href="https://git.ashisgreat.xyz/penal-colony/kafka">kafka</a> — a privacy-respecting, open metasearch engine</p>
|
<p>Powered by <a href="https://git.ashisgreat.xyz/penal-colony/kafka">kafka</a> — a privacy-respecting, open metasearch engine</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
<script src="/static/js/settings.js"></script>
|
||||||
|
<div id="settings-popover" data-open="false" role="dialog" aria-label="Preferences" aria-modal="true">
|
||||||
|
<div class="settings-popover-header">
|
||||||
|
Preferences
|
||||||
|
<button class="settings-popover-close" aria-label="Close">×</button>
|
||||||
|
</div>
|
||||||
|
<div class="settings-popover-body"></div>
|
||||||
|
</div>
|
||||||
<script>
|
<script>
|
||||||
(function () {
|
(function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ type PageData struct {
|
||||||
Infoboxes []InfoboxView
|
Infoboxes []InfoboxView
|
||||||
UnresponsiveEngines [][2]string
|
UnresponsiveEngines [][2]string
|
||||||
PageNumbers []PageNumber
|
PageNumbers []PageNumber
|
||||||
|
ShowHeader bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// ResultView is a template-friendly wrapper around a MainResult.
|
// ResultView is a template-friendly wrapper around a MainResult.
|
||||||
|
|
@ -163,12 +164,13 @@ func FromResponse(resp contracts.SearchResponse, query string, pageno int) PageD
|
||||||
// RenderIndex renders the homepage (search box only).
|
// RenderIndex renders the homepage (search box only).
|
||||||
func RenderIndex(w http.ResponseWriter) error {
|
func RenderIndex(w http.ResponseWriter) error {
|
||||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||||
return tmplIndex.ExecuteTemplate(w, "base", PageData{})
|
return tmplIndex.ExecuteTemplate(w, "base", PageData{ShowHeader: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
// RenderSearch renders the full search results page (with base layout).
|
// RenderSearch renders the full search results page (with base layout).
|
||||||
func RenderSearch(w http.ResponseWriter, data PageData) error {
|
func RenderSearch(w http.ResponseWriter, data PageData) error {
|
||||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||||
|
data.ShowHeader = true
|
||||||
return tmplFull.ExecuteTemplate(w, "base", data)
|
return tmplFull.ExecuteTemplate(w, "base", data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue