make chat.html self contained
parent
d6fe1544e0
commit
13b0821eef
3
main.go
3
main.go
|
|
@ -356,9 +356,8 @@ func main() {
|
||||||
log.Fatal("Error getting working directory:", err)
|
log.Fatal("Error getting working directory:", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse base and partial templates
|
// Parse partial templates
|
||||||
tmpl := template.Must(template.ParseFiles(
|
tmpl := template.Must(template.ParseFiles(
|
||||||
filepath.Join(dir, "templates/base.html"),
|
|
||||||
filepath.Join(dir, "templates/partials/navbar.html"),
|
filepath.Join(dir, "templates/partials/navbar.html"),
|
||||||
filepath.Join(dir, "templates/partials/cookie_banner.html"),
|
filepath.Join(dir, "templates/partials/cookie_banner.html"),
|
||||||
))
|
))
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,21 @@
|
||||||
{{define "chat"}}{{template "base" .}}{{end}}
|
{{define "chat"}}
|
||||||
|
<!DOCTYPE html>
|
||||||
{{define "chat-content"}}
|
<html>
|
||||||
<div class="chat-container" data-board-id="{{.Board.ID}}" data-base-path="{{.BasePath}}" data-current-username="{{.CurrentUsername}}">
|
<head>
|
||||||
|
<title>{{.Title}}</title>
|
||||||
|
<link rel="stylesheet" href="{{.StaticPath}}/style.css">
|
||||||
|
<script src="{{.StaticPath}}/validation.js" defer></script>
|
||||||
|
<script src="{{.StaticPath}}/drafts.js" defer></script>
|
||||||
|
<script src="{{.StaticPath}}/forms.js" defer></script>
|
||||||
|
<script src="{{.StaticPath}}/shortcuts.js" defer></script>
|
||||||
|
<script src="{{.StaticPath}}/likes.js" defer></script>
|
||||||
|
<script src="{{.StaticPath}}/app.js" defer></script>
|
||||||
|
<script src="{{.StaticPath}}/chat.js" defer></script>
|
||||||
|
</head>
|
||||||
|
<body class="chat-page">
|
||||||
|
{{template "navbar" .}}
|
||||||
|
<main>
|
||||||
|
<div class="chat-container" data-board-id="{{.Board.ID}}" data-base-path="{{.BasePath}}" data-current-username="{{.CurrentUsername}}">
|
||||||
<div class="chat-breadcrumb">
|
<div class="chat-breadcrumb">
|
||||||
<a href="{{.BasePath}}/">Home</a>
|
<a href="{{.BasePath}}/">Home</a>
|
||||||
<span class="chat-breadcrumb-separator">›</span>
|
<span class="chat-breadcrumb-separator">›</span>
|
||||||
|
|
@ -54,7 +68,11 @@
|
||||||
<textarea id="chat-input-text" placeholder="Type a message..."></textarea>
|
<textarea id="chat-input-text" placeholder="Type a message..."></textarea>
|
||||||
<button onclick="sendMessage()" type="button">Send</button>
|
<button onclick="sendMessage()" type="button">Send</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="autocomplete-popup" class="autocomplete-popup"></div>
|
<div id="autocomplete-popup" class="autocomplete-popup"></div>
|
||||||
<script type="application/json" id="chat-usernames">{{.AllUsernames}}</script>
|
<script type="application/json" id="chat-usernames">{{.AllUsernames}}</script>
|
||||||
|
</main>
|
||||||
|
{{template "cookie_banner" .}}
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue