Update user page

- Use the same page to display status and user list
- Add media only status list
This commit is contained in:
r 2020-01-31 03:38:49 +00:00
parent 6a6cc744b7
commit a981085260
10 changed files with 84 additions and 213 deletions

View file

@ -1,14 +0,0 @@
{{with .Data}}
{{template "header.tmpl" (WithContext .HeaderData $.Ctx)}}
{{template "navigation.tmpl" (WithContext .NavbarData $.Ctx)}}
<div class="page-title"> Followers </div>
{{template "userlist.tmpl" (WithContext .Users $.Ctx)}}
<div class="pagination">
{{if .NextLink}}
<a href="{{.NextLink}}">next</a>
{{end}}
</div>
{{template "footer.tmpl"}}
{{end}}

View file

@ -1,14 +0,0 @@
{{with .Data}}
{{template "header.tmpl" (WithContext .HeaderData $.Ctx)}}
{{template "navigation.tmpl" (WithContext .NavbarData $.Ctx)}}
<div class="page-title"> Following </div>
{{template "userlist.tmpl" (WithContext .Users $.Ctx)}}
<div class="pagination">
{{if .NextLink}}
<a href="{{.NextLink}}">next</a>
{{end}}
</div>
{{template "footer.tmpl"}}
{{end}}

View file

@ -40,9 +40,10 @@
{{end}}
</div>
<div>
{{.User.StatusesCount}} statuses -
<a href="/following/{{.User.ID}}"> {{.User.FollowingCount}} following </a> -
<a href="/followers/{{.User.ID}}"> {{.User.FollowersCount}} followers </a>
<a href="/user/{{.User.ID}}"> statuses ({{.User.StatusesCount}}) </a> -
<a href="/user/{{.User.ID}}/following"> following ({{.User.FollowingCount}}) </a> -
<a href="/user/{{.User.ID}}/followers"> followers ({{.User.FollowersCount}}) </a> -
<a href="/user/{{.User.ID}}/media"> media </a>
</div>
<div>
<a href="/usersearch/{{.User.ID}}"> search statuses </a>
@ -54,10 +55,27 @@
</div>
</div>
{{if eq .Type ""}}
<div class="page-title"> Statuses </div>
{{range .Statuses}}
{{template "status.tmpl" (WithContext . $.Ctx)}}
{{end}}
{{else if eq .Type "following"}}
<div class="page-title"> Following </div>
{{template "userlist.tmpl" (WithContext .Users $.Ctx)}}
{{else if eq .Type "followers"}}
<div class="page-title"> Followers </div>
{{template "userlist.tmpl" (WithContext .Users $.Ctx)}}
{{else if eq .Type "media"}}
<div class="page-title"> Statuses with media </div>
{{range .Statuses}}
{{template "status.tmpl" (WithContext . $.Ctx)}}
{{end}}
{{end}}
<div class="pagination">
{{if .NextLink}}
<a href="{{.NextLink}}">next</a>