From a981085260af2623bd4988e4b9c0052e2e3035eb Mon Sep 17 00:00:00 2001 From: r Date: Fri, 31 Jan 2020 03:38:49 +0000 Subject: Update user page - Use the same page to display status and user list - Add media only status list --- templates/followers.tmpl | 14 -------------- templates/following.tmpl | 14 -------------- templates/user.tmpl | 24 +++++++++++++++++++++--- 3 files changed, 21 insertions(+), 31 deletions(-) delete mode 100644 templates/followers.tmpl delete mode 100644 templates/following.tmpl (limited to 'templates') diff --git a/templates/followers.tmpl b/templates/followers.tmpl deleted file mode 100644 index 44a303b..0000000 --- a/templates/followers.tmpl +++ /dev/null @@ -1,14 +0,0 @@ -{{with .Data}} -{{template "header.tmpl" (WithContext .HeaderData $.Ctx)}} -{{template "navigation.tmpl" (WithContext .NavbarData $.Ctx)}} -
Followers
- -{{template "userlist.tmpl" (WithContext .Users $.Ctx)}} - - -{{template "footer.tmpl"}} -{{end}} diff --git a/templates/following.tmpl b/templates/following.tmpl deleted file mode 100644 index 50413d5..0000000 --- a/templates/following.tmpl +++ /dev/null @@ -1,14 +0,0 @@ -{{with .Data}} -{{template "header.tmpl" (WithContext .HeaderData $.Ctx)}} -{{template "navigation.tmpl" (WithContext .NavbarData $.Ctx)}} -
Following
- -{{template "userlist.tmpl" (WithContext .Users $.Ctx)}} - - -{{template "footer.tmpl"}} -{{end}} diff --git a/templates/user.tmpl b/templates/user.tmpl index e3cb7e8..3042672 100644 --- a/templates/user.tmpl +++ b/templates/user.tmpl @@ -40,9 +40,10 @@ {{end}}
- {{.User.StatusesCount}} statuses - - {{.User.FollowingCount}} following - - {{.User.FollowersCount}} followers + statuses ({{.User.StatusesCount}}) - + following ({{.User.FollowingCount}}) - + followers ({{.User.FollowersCount}}) - + media
search statuses @@ -54,10 +55,27 @@
+{{if eq .Type ""}} +
Statuses
{{range .Statuses}} {{template "status.tmpl" (WithContext . $.Ctx)}} {{end}} +{{else if eq .Type "following"}} +
Following
+{{template "userlist.tmpl" (WithContext .Users $.Ctx)}} + +{{else if eq .Type "followers"}} +
Followers
+{{template "userlist.tmpl" (WithContext .Users $.Ctx)}} + +{{else if eq .Type "media"}} +
Statuses with media
+{{range .Statuses}} +{{template "status.tmpl" (WithContext . $.Ctx)}} +{{end}} +{{end}} +