2021-11-22 09:06:23 +00:00
|
|
|
// Code generated by go generate; DO NOT EDIT.
|
|
|
|
|
|
|
|
|
|
package handler
|
|
|
|
|
|
|
|
|
|
var TplMap = map[string]string{
|
2021-11-22 13:30:20 +00:00
|
|
|
"confirm_remove_status": `{{ define "content" }}
|
|
|
|
|
Are you sure you you want to delete the following status?
|
|
|
|
|
<p>{{ .status.Content }}</p>
|
2021-11-22 20:23:30 +00:00
|
|
|
<form action="/remove-status" method="post">
|
|
|
|
|
<input type="hidden" name="id"/>
|
2021-11-22 13:30:20 +00:00
|
|
|
<input type="submit" value="Submit">
|
|
|
|
|
</form>
|
|
|
|
|
{{ end }}`,
|
2021-11-24 06:30:19 +00:00
|
|
|
"create_status": `<!DOCTYPE html>
|
|
|
|
|
<html lang="en">
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
|
<title>status cafe</title>
|
|
|
|
|
<meta name="description" content="your friends' updates">
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<main>
|
|
|
|
|
<h1>New status</h1>
|
|
|
|
|
{{ if .form.Error }}
|
|
|
|
|
<p>{{ .form.Error }}</p>
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{ if .flash }}
|
|
|
|
|
<p>{{ .flash }}</p>
|
|
|
|
|
{{ end }}
|
|
|
|
|
<form action="/status-save?silent=1" method="post" name="update-status">
|
|
|
|
|
<div class="field">
|
|
|
|
|
<textarea name="content" placeholder="What's new?" required style="width: 100%; box-sizing: border-box;" autofocus></textarea>
|
|
|
|
|
</div>
|
|
|
|
|
<br>
|
|
|
|
|
<input type="submit" value="Submit">
|
|
|
|
|
</form>
|
|
|
|
|
</main>
|
|
|
|
|
</div>
|
|
|
|
|
<script>
|
|
|
|
|
document.forms["update-status"].onsubmit = function (event) {
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
fetch("/status-save?silent=1", {
|
|
|
|
|
method: "POST",
|
|
|
|
|
body: new FormData(document.forms["update-status"])
|
|
|
|
|
})
|
|
|
|
|
.then(response => response.ok)
|
|
|
|
|
.then(submitted => {
|
|
|
|
|
if (submitted) {
|
|
|
|
|
window.close()
|
|
|
|
|
window.location = "/"
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
|
|
|
|
</html>`,
|
2021-11-22 13:23:30 +00:00
|
|
|
"edit_status": `{{ define "content" }}
|
|
|
|
|
<h1>Edit status</h1>
|
|
|
|
|
{{ if .form.Error }}
|
|
|
|
|
<p>{{ .form.Error }}</p>
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{ if .flash }}
|
|
|
|
|
<p>{{ .flash }}</p>
|
|
|
|
|
{{ end }}
|
|
|
|
|
<form action="/statuses/{{ .status.Id }}/update" method="post">
|
|
|
|
|
<div class="field">
|
2021-11-22 20:23:30 +00:00
|
|
|
<div class="field">
|
|
|
|
|
<textarea name="content" placeholder="What's new?" required style="width: 100%; box-sizing: border-box;" autofocus>{{ .status.Content }}</textarea>
|
|
|
|
|
</div>
|
2021-11-22 13:23:30 +00:00
|
|
|
</div>
|
|
|
|
|
<input type="submit" value="Submit">
|
|
|
|
|
</form>
|
2021-11-22 13:00:19 +00:00
|
|
|
{{ end }}`,
|
2021-11-22 09:06:23 +00:00
|
|
|
"index": `{{ define "content" }}
|
2021-11-22 20:23:30 +00:00
|
|
|
<div class="cols">
|
|
|
|
|
<section>
|
|
|
|
|
<h2>Set your status</h2>
|
|
|
|
|
{{ if .form.Error }}
|
|
|
|
|
<p>{{ .form.Error }}</p>
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{ if .flash }}
|
|
|
|
|
<p>{{ .flash }}</p>
|
|
|
|
|
{{ end }}
|
|
|
|
|
<form action="/status-save" method="post">
|
|
|
|
|
<div class="field">
|
2021-11-24 06:30:19 +00:00
|
|
|
<textarea name="content" placeholder="What's new?" required style="width: 100%; box-sizing: border-box; height: 100px;" autofocus></textarea>
|
2021-11-22 20:23:30 +00:00
|
|
|
</div>
|
|
|
|
|
<br>
|
|
|
|
|
<input type="submit" value="Submit">
|
2021-11-25 05:51:40 +00:00
|
|
|
<h3>Update status with bookmarklet</h3>
|
2021-11-24 06:30:19 +00:00
|
|
|
<p>Drag to your bookmarks to update from anywhere: <a href="javascript:void(open('https://status.cafe/status-new','status.cafe','resizable,scrollbars,width=360,height=200'))">Set status</a></p>
|
2021-11-25 05:51:40 +00:00
|
|
|
<h3>Display status on your homepage</h3>
|
|
|
|
|
<p>todo</p>
|
2021-11-22 20:23:30 +00:00
|
|
|
</form>
|
|
|
|
|
</section>
|
|
|
|
|
<section>
|
|
|
|
|
<h2>Status stream</h2>
|
|
|
|
|
{{ range .statuses }}
|
2021-11-25 05:56:21 +00:00
|
|
|
{{ template "status" . }}
|
2021-11-22 20:23:30 +00:00
|
|
|
{{ end }}
|
|
|
|
|
</section>
|
|
|
|
|
</div>
|
2021-11-22 09:26:30 +00:00
|
|
|
{{ end }}`,
|
|
|
|
|
"login": `{{ define "content" }}
|
|
|
|
|
<h1>Login</h1>
|
|
|
|
|
{{ if .form.Error }}
|
|
|
|
|
<p>{{ .form.Error }}</p>
|
|
|
|
|
{{ end }}
|
|
|
|
|
<form action="/check-login" method="post" class="auth-form">
|
|
|
|
|
<div class="field">
|
|
|
|
|
<label for="name">Username</label>
|
|
|
|
|
<input type="text" id="name" name="name" autocomplete="off" required autofocus/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="field">
|
|
|
|
|
<label for="password">Password</label>
|
|
|
|
|
<input type="password" id="password" name="password" required/>
|
|
|
|
|
</div>
|
|
|
|
|
<br>
|
|
|
|
|
<input type="submit" value="Submit">
|
|
|
|
|
</form>
|
|
|
|
|
{{ end }}`,
|
|
|
|
|
"register": `{{ define "content" }}
|
|
|
|
|
<h1>Register</h1>
|
|
|
|
|
{{ if .form.Error }}
|
|
|
|
|
<p>{{ .form.Error }}</p>
|
|
|
|
|
{{ end }}
|
|
|
|
|
<form action="/register" method="post" class="auth-form">
|
|
|
|
|
<div class="field">
|
|
|
|
|
<label for="name">Username</label>
|
|
|
|
|
<input type="text" id="name" name="name" autocomplete="off" required autofocus/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="field">
|
|
|
|
|
<label for="password">Password</label>
|
|
|
|
|
<input type="password" id="password" name="password" required/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="field">
|
|
|
|
|
<label for="password-confirm">Confirm password</label>
|
|
|
|
|
<input type="password" id="password-confirm" name="password-confirm" required/>
|
|
|
|
|
</div>
|
|
|
|
|
<br>
|
|
|
|
|
<input type="submit" value="Submit">
|
|
|
|
|
</form>
|
2021-11-24 06:30:19 +00:00
|
|
|
{{ end }}`,
|
|
|
|
|
"user": `{{ define "content" }}
|
|
|
|
|
<section>
|
|
|
|
|
<h2>{{ .user }}</h2>
|
|
|
|
|
{{ range .statuses }}
|
2021-11-25 05:56:21 +00:00
|
|
|
{{ template "status" . }}
|
2021-11-24 06:30:19 +00:00
|
|
|
{{ end }}
|
|
|
|
|
</section>
|
2021-11-22 09:06:23 +00:00
|
|
|
{{ end }}`,
|
|
|
|
|
}
|