Files
soundcloak/templates/base.templ
2025-09-07 00:31:39 +03:00

67 lines
1.9 KiB
Plaintext

package templates
import "git.maid.zone/stuff/soundcloak/lib/cfg"
templ Base(title string, content templ.Component, head templ.Component) {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="/_/static/global.css"/>
<link rel="stylesheet" href="/_/static/instance.css"/>
<link rel="icon" href="/_/static/favicon.ico"/>
<title>
if title != "" {
{ title } ~
}
soundcloak
</title>
if head != nil {
@head
}
</head>
<body>
if cfg.Debug {
<h1>!! running in debug mode !!</h1>
}
<a href="/" id="sc"><h1>soundcloak</h1></a>
@content
</body>
</html>
}
templ MainPageHead() {
<link rel="stylesheet" href="/_/static/index.css"/>
}
templ MainPage(p cfg.Preferences) {
<form action="/search">
<div style="position: relative">
<div style="display: flex; gap: .5rem;">
<input id="q" name="q" type="text" autocomplete="off" autofill="off" style="padding: .5rem .6rem; flex-grow: 1;"/>
<select name="type">
<option value="tracks">Tracks</option>
<option value="users">Users</option>
<option value="playlists">Playlists</option>
</select>
</div>
if *p.SearchSuggestions {
<ul id="search-suggestions" style="display: none;"></ul>
<script async src="/_/static/index.js"></script>
}
</div>
<input type="submit" value="Search" class="btn" style="width: 100%; margin-top: .5rem;"/>
</form>
<footer>
<div>
<a class="btn" href="/discover">Discover Playlists</a>
<a class="btn" href="/_/preferences">Preferences</a>
<a class="btn" href="https://git.maid.zone/stuff/soundcloak">Source code</a>
<a class="btn" href="/_/static/notice.txt">Legal notice</a>
</div>
<p style="text-align: center;">Build <a class="link" href={cfg.CommitURL}>{cfg.Commit}</a></p>
</footer>
}