Add template for status
This commit is contained in:
parent
8a2a048f83
commit
8cd8720a7f
5 changed files with 16 additions and 16 deletions
|
|
@ -30,4 +30,10 @@ var TplCommonMap = map[string]string{
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ define "head" }}{{ 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 }}`,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -97,10 +97,7 @@ Are you sure you you want to delete the following status?
|
||||||
<section>
|
<section>
|
||||||
<h2>Status stream</h2>
|
<h2>Status stream</h2>
|
||||||
{{ range .statuses }}
|
{{ range .statuses }}
|
||||||
<article class="status">
|
{{ template "status" . }}
|
||||||
<div class="status-username"><a href="/users/{{ .User }}">{{ .User }}</a>'s status, updated {{ .TimeAgo }}</div>
|
|
||||||
<p class="status-content">{{ .Content }}</p>
|
|
||||||
</article>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -149,10 +146,7 @@ Are you sure you you want to delete the following status?
|
||||||
<section>
|
<section>
|
||||||
<h2>{{ .user }}</h2>
|
<h2>{{ .user }}</h2>
|
||||||
{{ range .statuses }}
|
{{ range .statuses }}
|
||||||
<article class="status">
|
{{ template "status" . }}
|
||||||
<div class="username">{{ .TimeAgo }}</div>
|
|
||||||
<p>{{ .Content }}</p>
|
|
||||||
</article>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</section>
|
</section>
|
||||||
{{ end }}`,
|
{{ end }}`,
|
||||||
|
|
|
||||||
6
web/handler/html/common/status.html
Normal file
6
web/handler/html/common/status.html
Normal 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 }}
|
||||||
|
|
@ -23,10 +23,7 @@
|
||||||
<section>
|
<section>
|
||||||
<h2>Status stream</h2>
|
<h2>Status stream</h2>
|
||||||
{{ range .statuses }}
|
{{ range .statuses }}
|
||||||
<article class="status">
|
{{ template "status" . }}
|
||||||
<div class="status-username"><a href="/users/{{ .User }}">{{ .User }}</a>'s status, updated {{ .TimeAgo }}</div>
|
|
||||||
<p class="status-content">{{ .Content }}</p>
|
|
||||||
</article>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,7 @@
|
||||||
<section>
|
<section>
|
||||||
<h2>{{ .user }}</h2>
|
<h2>{{ .user }}</h2>
|
||||||
{{ range .statuses }}
|
{{ range .statuses }}
|
||||||
<article class="status">
|
{{ template "status" . }}
|
||||||
<div class="username">{{ .TimeAgo }}</div>
|
|
||||||
<p>{{ .Content }}</p>
|
|
||||||
</article>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</section>
|
</section>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
Loading…
Reference in a new issue