Finishing up

This commit is contained in:
m15o 2021-12-04 16:22:30 +01:00
parent 07538e4011
commit 64c8ee3042
16 changed files with 206 additions and 173 deletions

View file

@ -7,20 +7,35 @@ body {
color: midnightblue; color: midnightblue;
} }
/*section {*/ .faces {
/* padding: 1em;*/ margin-bottom: 1em;
/* background-color: lightblue;*/ max-width: 500px;
/*}*/ }
.flash { .flash {
background-color: lightgreen; background-color: lightgreen;
padding: 0.5em 1em; padding: 0.5em 1em;
color: darkgreen; color: darkgreen;
animation: 500ms ease-out 3s 1 forwards fadeout;
}
@keyframes fadeout {
0% {
opacity: 1;
}
99% {
opacity: 0;
font-size: inherit;
height: inherit;
}
100% {
font-size: 0;
height: 0;
}
} }
.cols { .cols {
display: grid; display: grid;
row-gap: 1em;
} }
a { a {
@ -52,13 +67,9 @@ dd {
margin-bottom: 1em; margin-bottom: 1em;
} }
/*nav {*/ .edit-status {
/* margin-bottom: 1em;*/ width: 100%; box-sizing: border-box; height: 100px;
/*}*/ }
/*h1, h2 {*/
/* !*margin-top: 0;*!*/
/*}*/
.tools { .tools {
list-style-position: inside; list-style-position: inside;

View file

@ -22,7 +22,7 @@ var TplCommonMap = map[string]string{
<body> <body>
<header> <header>
<nav> <nav>
<a href="/">status.cafe</a> <a href="/intro">intro</a> <a href="/">status.cafe</a>
{{ if .logged }} {{ if .logged }}
<a href="/settings">settings</a> <a href="/users/{{ .logged }}">{{ .logged }}</a> (<a href="/logout">logout</a>) <a href="/settings">settings</a> <a href="/users/{{ .logged }}">{{ .logged }}</a> (<a href="/logout">logout</a>)
{{ else }} {{ else }}
@ -46,7 +46,7 @@ var TplCommonMap = map[string]string{
<p class="status-content">{{ .Content }}</p> <p class="status-content">{{ .Content }}</p>
{{ end }}`, {{ end }}`,
"status_form": `{{ define "status_form" }} "status_form": `{{ define "status_form" }}
<div style="margin-bottom: 1em"> <div class="faces">
{{ range $i, $v := faces }} {{ range $i, $v := faces }}
<div class="radio"> <div class="radio">
<input <input
@ -64,7 +64,7 @@ var TplCommonMap = map[string]string{
{{ end }} {{ end }}
</div> </div>
<div class="field"> <div class="field">
<textarea name="content" maxlength="140" placeholder="What's new?" required style="width: 100%; box-sizing: border-box; height: 100px;" autofocus>{{ .Content }}</textarea> <textarea class="edit-status" name="content" maxlength="140" placeholder="What's new?" required autofocus>{{ .Content }}</textarea>
</div> </div>
<input type="submit" value="Submit"> <input type="submit" value="Submit">
{{ end }}`, {{ end }}`,

View file

@ -23,7 +23,7 @@ var TplMap = map[string]string{
<meta name="description" content="your friends' updates"> <meta name="description" content="your friends' updates">
<style> <style>
body { body {
background-color: lightblue; background-color: azure;
font-family: Verdana; font-family: Verdana;
} }
</style> </style>
@ -63,19 +63,29 @@ var TplMap = map[string]string{
<style> <style>
#statuscafe { #statuscafe {
padding: .5em; padding: .5em;
background-color: lightblue; background-color: azure;
border: 1px solid; border: 1px solid midnightblue;
} }
#statuscafe-username { #statuscafe-username {
margin-bottom: .5em; margin-bottom: .5em;
} }
#statuscafe-content { #statuscafe-content {
margin: 0 1em 0.5em 1em; margin: 0 1em 0.5em 1em;
} }
@media (min-width: 650px) {
.cols {
grid-template-columns: 1fr 1fr;
grid-gap: 2em;
}
}
</style> </style>
<div class="cols"> <div class="cols">
<section> <div>
<h1>Current Status Widget</h1> <h1>Status widget</h1>
<form method="get" action="/current-status"> <form method="get" action="/current-status">
<table> <table>
<tr> <tr>
@ -89,47 +99,46 @@ var TplMap = map[string]string{
</table> </table>
</form> </form>
<p>Past this code into your HTML file:</p> <p>Past this code into your HTML file:</p>
<textarea style="width: 100%; height: 75px;"><script src="https://status.cafe/current-status.js?name={{ .name }}"></script></textarea> <textarea style="width: 100%; max-width: 500px; height: 75px;"><script src="https://status.cafe/current-status.js?name={{ .name }}"></script></textarea>
<p>Past this code into your CSS file:</p> <p>Past this code into your CSS file:</p>
<textarea style="width: 100%; height: 75px;">#statuscafe { <textarea style="width: 100%; max-width: 500px; height: 175px;">#statuscafe {
padding: .5em; padding: .5em;
background-color: lightblue; background-color: azure;
border: 1px solid; border: 1px solid midnightblue;
} }
#statuscafe-username { #statuscafe-username {
margin-bottom: .5em; margin-bottom: .5em;
} }
#statuscafe-content { #statuscafe-content {
margin: 0 1em 0.5em 1em; margin: 0 1em 0.5em 1em;
} }</textarea>
</textarea>
<p>Make it your own! The CSS above is only an example. Tweak it so that it integrates well with your sites's colors.</p> <p>Make it your own! The CSS above is only an example. Tweak it so that it integrates well with your sites's colors.</p>
</section> </div>
<section> <div>
<h2>Preview</h2> <h2>Preview</h2>
{{ if .name }} {{ if .name }}
<script src="https://status.cafe/current-status.js?name={{ .name }}"></script> <script src="https://status.cafe/current-status.js?name={{ .name }}"></script>
{{ else }} {{ else }}
<p>Add your name and click "generate HTML" to see a preview.</p> <p>Add your name and click "generate HTML" to see a preview.</p>
{{ end }} {{ end }}
</section> </div>
</div> </div>
{{ end }}`, {{ end }}
`,
"edit_status": `{{ define "content" }} "edit_status": `{{ define "content" }}
<section> <h1>Edit status</h1>
<h1>Edit status</h1> {{ if .form.Error }}
{{ if .form.Error }} <p>{{ .form.Error }}</p>
<p>{{ .form.Error }}</p> {{ end }}
{{ end }} {{ template "flash" .flash }}
{{ template "flash" .flash }} <form action="/edit?id={{ .status.Id }}" method="post">
<form action="/edit?id={{ .status.Id }}" method="post"> {{ template "status_form" .status }}
{{ template "status_form" .status }} </form>
</form>
</section>
{{ end }}`, {{ end }}`,
"index": `{{ define "content" }} "index": `{{ define "content" }}
<div class="cols"> <div class="cols">
<section> <section>
{{ if .logged }}
<h2>Set your status</h2> <h2>Set your status</h2>
{{ if .form.Error }} {{ if .form.Error }}
<p>{{ .form.Error }}</p> <p>{{ .form.Error }}</p>
@ -140,6 +149,11 @@ var TplMap = map[string]string{
<li><a href="/about/status-updater">status updater</a> bookmarklet</li> <li><a href="/about/status-updater">status updater</a> bookmarklet</li>
<li><a href="/current-status">status widget</a> for your homepage</li> <li><a href="/current-status">status widget</a> for your homepage</li>
</ul> </ul>
{{ else }}
<h2>Welcome!</h2>
<p>status.cafe is a place to share your current status.</p>
<p><a href="/register">Register now!</a></p>
{{ end }}
</section> </section>
<section> <section>
<h2>Status stream</h2> <h2>Status stream</h2>
@ -205,32 +219,30 @@ var TplMap = map[string]string{
</section> </section>
{{ end }}`, {{ end }}`,
"manage": `{{ define "content" }} "manage": `{{ define "content" }}
<section> <h1>Manage statuses</h1>
<h2>Manage statuses</h2> {{ template "flash" .flash }}
{{ template "flash" .flash }} {{ range .statuses }}
{{ range .statuses }} <article class="status">
<article class="status"> {{ template "status" . }}
{{ template "status" . }} {{ if eq $.logged .User }}
{{ if eq $.logged .User }} <nav><a href="/edit?id={{ .Id }}">Edit</a> <a href="/remove?id={{ .Id }}">Delete</a></nav>
<nav><a href="/edit?id={{ .Id }}">Edit</a> <a href="/remove?id={{ .Id }}">Delete</a></nav>
{{ end }}
</article>
{{ end }} {{ end }}
{{ if or .showMore (ne 0 .page) }} </article>
<p> {{ end }}
{{ if ne 0 .page }} {{ if or .showMore (ne 0 .page) }}
{{ if eq 0 .prev_page }} <p>
<a href="manage">Newer statuses</a> {{ if ne 0 .page }}
{{ else }} {{ if eq 0 .prev_page }}
<a href="manage?page={{ .prev_page }}">Newer statuses</a> <a href="manage">Newer statuses</a>
{{ end }} {{ else }}
{{ end }} <a href="manage?page={{ .prev_page }}">Newer statuses</a>
{{ if .showMore }}
<a href="manage?page={{ .next_page }}">Older statuses</a>
{{- end }}
</p>
{{ end }} {{ end }}
</section> {{ end }}
{{ if .showMore }}
<a href="manage?page={{ .next_page }}">Older statuses</a>
{{- end }}
</p>
{{ end }}
{{ end }}`, {{ end }}`,
"register": `{{ define "content" }} "register": `{{ define "content" }}
<section> <section>
@ -257,35 +269,33 @@ var TplMap = map[string]string{
</section> </section>
{{ end }}`, {{ end }}`,
"settings": `{{ define "content" }} "settings": `{{ define "content" }}
<section> <h1>Settings</h1>
<h1>Settings</h1> {{ if .flash }}
{{ if .flash }} <p>{{ .flash }}</p>
<p>{{ .flash }}</p> {{ end }}
{{ end }} <p><a href="/manage">Manage statuses</a></p>
<p><a href="/manage">Manage statuses</a></p> <form action="/settings-update" method="post">
<form action="/settings-update" method="post"> <div class="field">
<div class="field"> <label for="homepage">Homepage</label>
<label for="homepage">homepage</label> <input type="text" name="homepage" id="homepage" value="{{ .User.Homepage }}" autocomplete="off"/>
<input type="text" name="homepage" id="homepage" value="{{ .User.Homepage }}" autocomplete="off"/> </div>
</div>
<div class="field"> <div class="field">
<label for="email">Email</label> <label for="email">Email</label>
<input type="text" name="email" id="email" value="{{ .User.Email }}" autocomplete="off"/> <input type="text" name="email" id="email" value="{{ .User.Email }}" autocomplete="off"/>
</div> </div>
<div class="field"> <div class="field">
<label for="picture">picture URL</label> <label for="picture">Picture URL</label>
<input type="text" name="picture" id="picture" value="{{ .User.Picture }}" autocomplete="off"/> <input type="text" name="picture" id="picture" value="{{ .User.Picture }}" autocomplete="off"/>
</div> </div>
<div class="field"> <div class="field">
<label for="about">about</label> <label for="about">About (accepts HTML, including a style tag)</label>
<textarea name="about" id="about" rows="20">{{ .User.About }}</textarea> <textarea name="about" id="about" rows="20">{{ .User.About }}</textarea>
</div> </div>
<input type="submit" value="Submit"> <input type="submit" value="Submit">
</form> </form>
</section>
{{ end }}`, {{ end }}`,
"status-updater": `{{ define "content" }} "status-updater": `{{ define "content" }}
<section> <section>
@ -304,7 +314,7 @@ var TplMap = map[string]string{
Drag the following link to your bookmarks toolbar: Drag the following link to your bookmarks toolbar:
</p> </p>
<p> <p>
<a href="javascript:void(open('https://status.cafe/add','status.cafe','resizable,scrollbars,width=360,height=200'))">status updater</a> <a href="javascript:void(open('https://status.cafe/add','status.cafe','resizable,scrollbars,width=350,height=250'))">status updater</a>
</p> </p>
<p>That's it! From now on, whenever you want to update your status, click the status updater button from your bookmarks and a pop-up window will launch to let you update it.</p> <p>That's it! From now on, whenever you want to update your status, click the status updater button from your bookmarks and a pop-up window will launch to let you update it.</p>
</section> </section>
@ -320,6 +330,7 @@ var TplMap = map[string]string{
{{ if .picture }} {{ if .picture }}
<img src="{{ .picture }}" width="100" class="profile-picture"/> <img src="{{ .picture }}" width="100" class="profile-picture"/>
{{ end }} {{ end }}
<p><a href="/users/{{ .user }}.atom">Subscribe via Atom</a></p>
<dl> <dl>
<dt>Homepage</dt> <dt>Homepage</dt>
<dd> <dd>

View file

@ -12,7 +12,7 @@
<body> <body>
<header> <header>
<nav> <nav>
<a href="/">status.cafe</a> <a href="/intro">intro</a> <a href="/">status.cafe</a>
{{ if .logged }} {{ if .logged }}
<a href="/settings">settings</a> <a href="/users/{{ .logged }}">{{ .logged }}</a> (<a href="/logout">logout</a>) <a href="/settings">settings</a> <a href="/users/{{ .logged }}">{{ .logged }}</a> (<a href="/logout">logout</a>)
{{ else }} {{ else }}

View file

@ -1,5 +1,5 @@
{{ define "status_form" }} {{ define "status_form" }}
<div style="margin-bottom: 1em"> <div class="faces">
{{ range $i, $v := faces }} {{ range $i, $v := faces }}
<div class="radio"> <div class="radio">
<input <input
@ -17,7 +17,7 @@
{{ end }} {{ end }}
</div> </div>
<div class="field"> <div class="field">
<textarea name="content" maxlength="140" placeholder="What's new?" required style="width: 100%; box-sizing: border-box; height: 100px;" autofocus>{{ .Content }}</textarea> <textarea class="edit-status" name="content" maxlength="140" placeholder="What's new?" required autofocus>{{ .Content }}</textarea>
</div> </div>
<input type="submit" value="Submit"> <input type="submit" value="Submit">
{{ end }} {{ end }}

View file

@ -8,7 +8,7 @@
<meta name="description" content="your friends' updates"> <meta name="description" content="your friends' updates">
<style> <style>
body { body {
background-color: lightblue; background-color: azure;
font-family: Verdana; font-family: Verdana;
} }
</style> </style>

View file

@ -2,19 +2,29 @@
<style> <style>
#statuscafe { #statuscafe {
padding: .5em; padding: .5em;
background-color: lightblue; background-color: azure;
border: 1px solid; border: 1px solid midnightblue;
} }
#statuscafe-username { #statuscafe-username {
margin-bottom: .5em; margin-bottom: .5em;
} }
#statuscafe-content { #statuscafe-content {
margin: 0 1em 0.5em 1em; margin: 0 1em 0.5em 1em;
} }
@media (min-width: 650px) {
.cols {
grid-template-columns: 1fr 1fr;
grid-gap: 2em;
}
}
</style> </style>
<div class="cols"> <div class="cols">
<section> <div>
<h1>Current Status Widget</h1> <h1>Status widget</h1>
<form method="get" action="/current-status"> <form method="get" action="/current-status">
<table> <table>
<tr> <tr>
@ -28,29 +38,28 @@
</table> </table>
</form> </form>
<p>Past this code into your HTML file:</p> <p>Past this code into your HTML file:</p>
<textarea style="width: 100%; height: 75px;"><script src="https://status.cafe/current-status.js?name={{ .name }}"></script></textarea> <textarea style="width: 100%; max-width: 500px; height: 75px;"><script src="https://status.cafe/current-status.js?name={{ .name }}"></script></textarea>
<p>Past this code into your CSS file:</p> <p>Past this code into your CSS file:</p>
<textarea style="width: 100%; height: 75px;">#statuscafe { <textarea style="width: 100%; max-width: 500px; height: 175px;">#statuscafe {
padding: .5em; padding: .5em;
background-color: lightblue; background-color: azure;
border: 1px solid; border: 1px solid midnightblue;
} }
#statuscafe-username { #statuscafe-username {
margin-bottom: .5em; margin-bottom: .5em;
} }
#statuscafe-content { #statuscafe-content {
margin: 0 1em 0.5em 1em; margin: 0 1em 0.5em 1em;
} }</textarea>
</textarea>
<p>Make it your own! The CSS above is only an example. Tweak it so that it integrates well with your sites's colors.</p> <p>Make it your own! The CSS above is only an example. Tweak it so that it integrates well with your sites's colors.</p>
</section> </div>
<section> <div>
<h2>Preview</h2> <h2>Preview</h2>
{{ if .name }} {{ if .name }}
<script src="https://status.cafe/current-status.js?name={{ .name }}"></script> <script src="https://status.cafe/current-status.js?name={{ .name }}"></script>
{{ else }} {{ else }}
<p>Add your name and click "generate HTML" to see a preview.</p> <p>Add your name and click "generate HTML" to see a preview.</p>
{{ end }} {{ end }}
</section> </div>
</div> </div>
{{ end }} {{ end }}

View file

@ -1,12 +1,10 @@
{{ define "content" }} {{ define "content" }}
<section> <h1>Edit status</h1>
<h1>Edit status</h1> {{ if .form.Error }}
{{ if .form.Error }} <p>{{ .form.Error }}</p>
<p>{{ .form.Error }}</p> {{ end }}
{{ end }} {{ template "flash" .flash }}
{{ template "flash" .flash }} <form action="/edit?id={{ .status.Id }}" method="post">
<form action="/edit?id={{ .status.Id }}" method="post"> {{ template "status_form" .status }}
{{ template "status_form" .status }} </form>
</form>
</section>
{{ end }} {{ end }}

View file

@ -1,6 +1,7 @@
{{ define "content" }} {{ define "content" }}
<div class="cols"> <div class="cols">
<section> <section>
{{ if .logged }}
<h2>Set your status</h2> <h2>Set your status</h2>
{{ if .form.Error }} {{ if .form.Error }}
<p>{{ .form.Error }}</p> <p>{{ .form.Error }}</p>
@ -11,6 +12,11 @@
<li><a href="/about/status-updater">status updater</a> bookmarklet</li> <li><a href="/about/status-updater">status updater</a> bookmarklet</li>
<li><a href="/current-status">status widget</a> for your homepage</li> <li><a href="/current-status">status widget</a> for your homepage</li>
</ul> </ul>
{{ else }}
<h2>Welcome!</h2>
<p>status.cafe is a place to share your current status.</p>
<p><a href="/register">Register now!</a></p>
{{ end }}
</section> </section>
<section> <section>
<h2>Status stream</h2> <h2>Status stream</h2>

View file

@ -1,28 +1,26 @@
{{ define "content" }} {{ define "content" }}
<section> <h1>Manage statuses</h1>
<h2>Manage statuses</h2> {{ template "flash" .flash }}
{{ template "flash" .flash }} {{ range .statuses }}
{{ range .statuses }} <article class="status">
<article class="status"> {{ template "status" . }}
{{ template "status" . }} {{ if eq $.logged .User }}
{{ if eq $.logged .User }} <nav><a href="/edit?id={{ .Id }}">Edit</a> <a href="/remove?id={{ .Id }}">Delete</a></nav>
<nav><a href="/edit?id={{ .Id }}">Edit</a> <a href="/remove?id={{ .Id }}">Delete</a></nav>
{{ end }}
</article>
{{ end }} {{ end }}
{{ if or .showMore (ne 0 .page) }} </article>
<p> {{ end }}
{{ if ne 0 .page }} {{ if or .showMore (ne 0 .page) }}
{{ if eq 0 .prev_page }} <p>
<a href="manage">Newer statuses</a> {{ if ne 0 .page }}
{{ else }} {{ if eq 0 .prev_page }}
<a href="manage?page={{ .prev_page }}">Newer statuses</a> <a href="manage">Newer statuses</a>
{{ end }} {{ else }}
{{ end }} <a href="manage?page={{ .prev_page }}">Newer statuses</a>
{{ if .showMore }}
<a href="manage?page={{ .next_page }}">Older statuses</a>
{{- end }}
</p>
{{ end }} {{ end }}
</section> {{ end }}
{{ if .showMore }}
<a href="manage?page={{ .next_page }}">Older statuses</a>
{{- end }}
</p>
{{ end }}
{{ end }} {{ end }}

View file

@ -1,31 +1,29 @@
{{ define "content" }} {{ define "content" }}
<section> <h1>Settings</h1>
<h1>Settings</h1> {{ if .flash }}
{{ if .flash }} <p>{{ .flash }}</p>
<p>{{ .flash }}</p> {{ end }}
{{ end }} <p><a href="/manage">Manage statuses</a></p>
<p><a href="/manage">Manage statuses</a></p> <form action="/settings-update" method="post">
<form action="/settings-update" method="post"> <div class="field">
<div class="field"> <label for="homepage">Homepage</label>
<label for="homepage">homepage</label> <input type="text" name="homepage" id="homepage" value="{{ .User.Homepage }}" autocomplete="off"/>
<input type="text" name="homepage" id="homepage" value="{{ .User.Homepage }}" autocomplete="off"/> </div>
</div>
<div class="field"> <div class="field">
<label for="email">Email</label> <label for="email">Email</label>
<input type="text" name="email" id="email" value="{{ .User.Email }}" autocomplete="off"/> <input type="text" name="email" id="email" value="{{ .User.Email }}" autocomplete="off"/>
</div> </div>
<div class="field"> <div class="field">
<label for="picture">picture URL</label> <label for="picture">Picture URL</label>
<input type="text" name="picture" id="picture" value="{{ .User.Picture }}" autocomplete="off"/> <input type="text" name="picture" id="picture" value="{{ .User.Picture }}" autocomplete="off"/>
</div> </div>
<div class="field"> <div class="field">
<label for="about">about</label> <label for="about">About (accepts HTML, including a style tag)</label>
<textarea name="about" id="about" rows="20">{{ .User.About }}</textarea> <textarea name="about" id="about" rows="20">{{ .User.About }}</textarea>
</div> </div>
<input type="submit" value="Submit"> <input type="submit" value="Submit">
</form> </form>
</section>
{{ end }} {{ end }}

View file

@ -15,7 +15,7 @@
Drag the following link to your bookmarks toolbar: Drag the following link to your bookmarks toolbar:
</p> </p>
<p> <p>
<a href="javascript:void(open('https://status.cafe/add','status.cafe','resizable,scrollbars,width=360,height=200'))">status updater</a> <a href="javascript:void(open('https://status.cafe/add','status.cafe','resizable,scrollbars,width=350,height=250'))">status updater</a>
</p> </p>
<p>That's it! From now on, whenever you want to update your status, click the status updater button from your bookmarks and a pop-up window will launch to let you update it.</p> <p>That's it! From now on, whenever you want to update your status, click the status updater button from your bookmarks and a pop-up window will launch to let you update it.</p>
</section> </section>

View file

@ -9,6 +9,7 @@
{{ if .picture }} {{ if .picture }}
<img src="{{ .picture }}" width="100" class="profile-picture"/> <img src="{{ .picture }}" width="100" class="profile-picture"/>
{{ end }} {{ end }}
<p><a href="/users/{{ .user }}.atom">Subscribe via Atom</a></p>
<dl> <dl>
<dt>Homepage</dt> <dt>Homepage</dt>
<dd> <dd>

View file

@ -16,8 +16,7 @@ func (h *Handler) initTpl() {
for name, content := range TplMap { for name, content := range TplMap {
views[name] = template.Must(template.New("main").Funcs(template.FuncMap{ views[name] = template.Must(template.New("main").Funcs(template.FuncMap{
"faces": func() []string { "faces": func() []string {
return []string{"☕", "🙂", "🙃", "😇", "😋", "😐", "😴", "😎", "🤓", "🧐", "😭", "😡", "💀", "🤖", return []string{"🙂", "😎", "😛", "🥰", "👽", "😱", "🤔", "😯", "🤒", "😡", "🥺", "🥳", "🤖", "💀", "😴", "😭", "☕", "🍺"}
"🍺", "🍷"}
}}).Parse(commonTemplates + content)) }}).Parse(commonTemplates + content))
} }
} }

View file

@ -92,6 +92,7 @@ func (h *Handler) showUserView(w http.ResponseWriter, r *http.Request) {
type statusjson struct { type statusjson struct {
Author string `json:"author"` Author string `json:"author"`
Content string `json:"content"` Content string `json:"content"`
Face string `json:"face"`
TimeAgo string `json:"timeAgo"` TimeAgo string `json:"timeAgo"`
} }
@ -112,6 +113,7 @@ func (h *Handler) showUserStatusView(w http.ResponseWriter, r *http.Request) {
if len(statuses) > 0 { if len(statuses) > 0 {
res.Author = statuses[0].User res.Author = statuses[0].User
res.Content = statuses[0].Content res.Content = statuses[0].Content
res.Face = statuses[0].Face
res.TimeAgo = statuses[0].TimeAgo() res.TimeAgo = statuses[0].TimeAgo()
} }
json.NewEncoder(w).Encode(res) json.NewEncoder(w).Encode(res)

View file

@ -15,7 +15,7 @@ fetch("https://status.cafe/users/` + name + `/status.json")
document.getElementById("statuscafe-content").innerHTML = "No status yet." document.getElementById("statuscafe-content").innerHTML = "No status yet."
return return
} }
document.getElementById("statuscafe-username").innerHTML = '<a href="https://status.cafe/users/` + name + `">' + r.author + '</a>, ' + r.timeAgo document.getElementById("statuscafe-username").innerHTML = '<a href="https://status.cafe/users/` + name + `">' + r.author + '</a> ' + r.face + ' ' + r.timeAgo
document.getElementById("statuscafe-content").innerHTML = r.content document.getElementById("statuscafe-content").innerHTML = r.content
}) })
`)) `))