mirror of
https://git.maid.zone/stuff/soundcloak.git
synced 2025-12-10 05:39:38 +05:00
72 lines
2.1 KiB
Plaintext
72 lines
2.1 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"/>
|
|
if title != "" {
|
|
<title>{ title } ~ soundcloak</title>
|
|
} else {
|
|
<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 required id="q" name="q" type="text" autocomplete="off" autofill="off" style="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 important" style="width: 100%; margin-top: .5rem;"/>
|
|
</form>
|
|
<footer>
|
|
<div class="btns" style="justify-content: space-between; margin-top: 2rem;">
|
|
<div class="btns">
|
|
<a class="btn" href="/_/featured">Featured Tracks</a>
|
|
<a class="btn" href="/discover">Discover Playlists</a>
|
|
</div>
|
|
<div class="btns">
|
|
<a class="btn" href="https://git.maid.zone/stuff/soundcloak">Source code</a>
|
|
<a class="btn" href="/_/static/notice.txt">Legal notice</a>
|
|
<a class="btn" href="/_/preferences">Preferences</a>
|
|
</div>
|
|
</div>
|
|
if cfg.Commit != "unknown" {
|
|
<p style="text-align: center;">Build <a class="link" href={ cfg.CommitURL }>{ cfg.Commit }</a></p>
|
|
}
|
|
</footer>
|
|
}
|