diff --git a/web/handler/common.go b/web/handler/common.go index f2f8e55..03274f4 100644 --- a/web/handler/common.go +++ b/web/handler/common.go @@ -30,4 +30,10 @@ var TplCommonMap = map[string]string{ {{ end }} {{ define "head" }}{{ end }} `, + "status": `{{ define "status" }} +
+
{{ .User }}'s status, updated {{ .TimeAgo }}
+

{{ .Content }}

+
+{{ end }}`, } diff --git a/web/handler/html.go b/web/handler/html.go index 3786650..22aafc8 100644 --- a/web/handler/html.go +++ b/web/handler/html.go @@ -97,10 +97,7 @@ Are you sure you you want to delete the following status?

Status stream

{{ range .statuses }} -
-
{{ .User }}'s status, updated {{ .TimeAgo }}
-

{{ .Content }}

-
+ {{ template "status" . }} {{ end }}
@@ -149,10 +146,7 @@ Are you sure you you want to delete the following status?

{{ .user }}

{{ range .statuses }} -
-
{{ .TimeAgo }}
-

{{ .Content }}

-
+ {{ template "status" . }} {{ end }}
{{ end }}`, diff --git a/web/handler/html/common/status.html b/web/handler/html/common/status.html new file mode 100644 index 0000000..f31bbd0 --- /dev/null +++ b/web/handler/html/common/status.html @@ -0,0 +1,6 @@ +{{ define "status" }} +
+
{{ .User }}'s status, updated {{ .TimeAgo }}
+

{{ .Content }}

+
+{{ end }} \ No newline at end of file diff --git a/web/handler/html/index.html b/web/handler/html/index.html index f8ec326..88df678 100644 --- a/web/handler/html/index.html +++ b/web/handler/html/index.html @@ -23,10 +23,7 @@

Status stream

{{ range .statuses }} -
-
{{ .User }}'s status, updated {{ .TimeAgo }}
-

{{ .Content }}

-
+ {{ template "status" . }} {{ end }}
diff --git a/web/handler/html/user.html b/web/handler/html/user.html index dada5dd..40601c0 100644 --- a/web/handler/html/user.html +++ b/web/handler/html/user.html @@ -2,10 +2,7 @@

{{ .user }}

{{ range .statuses }} -
-
{{ .TimeAgo }}
-

{{ .Content }}

-
+ {{ template "status" . }} {{ end }}
{{ end }} \ No newline at end of file