Add template for status

This commit is contained in:
m15o 2021-11-25 06:56:21 +01:00
parent 8a2a048f83
commit 8cd8720a7f
5 changed files with 16 additions and 16 deletions

View file

@ -30,4 +30,10 @@ var TplCommonMap = map[string]string{
{{ end }}
{{ define "head" }}{{ end }}
`,
"status": `{{ define "status" }}
<article class="status">
<div class="status-username"><a href="/users/{{ .User }}">{{ .User }}</a>'s status, updated {{ .TimeAgo }}</div>
<p class="status-content">{{ .Content }}</p>
</article>
{{ end }}`,
}

View file

@ -97,10 +97,7 @@ Are you sure you you want to delete the following status?
<section>
<h2>Status stream</h2>
{{ range .statuses }}
<article class="status">
<div class="status-username"><a href="/users/{{ .User }}">{{ .User }}</a>'s status, updated {{ .TimeAgo }}</div>
<p class="status-content">{{ .Content }}</p>
</article>
{{ template "status" . }}
{{ end }}
</section>
</div>
@ -149,10 +146,7 @@ Are you sure you you want to delete the following status?
<section>
<h2>{{ .user }}</h2>
{{ range .statuses }}
<article class="status">
<div class="username">{{ .TimeAgo }}</div>
<p>{{ .Content }}</p>
</article>
{{ template "status" . }}
{{ end }}
</section>
{{ end }}`,

View file

@ -0,0 +1,6 @@
{{ define "status" }}
<article class="status">
<div class="status-username"><a href="/users/{{ .User }}">{{ .User }}</a>'s status, updated {{ .TimeAgo }}</div>
<p class="status-content">{{ .Content }}</p>
</article>
{{ end }}

View file

@ -23,10 +23,7 @@
<section>
<h2>Status stream</h2>
{{ range .statuses }}
<article class="status">
<div class="status-username"><a href="/users/{{ .User }}">{{ .User }}</a>'s status, updated {{ .TimeAgo }}</div>
<p class="status-content">{{ .Content }}</p>
</article>
{{ template "status" . }}
{{ end }}
</section>
</div>

View file

@ -2,10 +2,7 @@
<section>
<h2>{{ .user }}</h2>
{{ range .statuses }}
<article class="status">
<div class="username">{{ .TimeAgo }}</div>
<p>{{ .Content }}</p>
</article>
{{ template "status" . }}
{{ end }}
</section>
{{ end }}