diff options
Diffstat (limited to 'templates/user.tmpl')
-rw-r--r-- | templates/user.tmpl | 128 |
1 files changed, 76 insertions, 52 deletions
diff --git a/templates/user.tmpl b/templates/user.tmpl index 6c4d833..b279e15 100644 --- a/templates/user.tmpl +++ b/templates/user.tmpl @@ -1,23 +1,22 @@ {{with .Data}} {{template "header.tmpl" (WithContext .CommonData $.Ctx)}} -<div class="page-title"> User </div> +<h1>User</h1> <div class="user-info-container"> -<div> <div class="user-profile-img-container"> <a class="img-link" href="{{.User.Avatar}}" target="_blank"> - <img class="user-profile-img" src="{{.User.Avatar}}" alt="profile-avatar" height="96" /> + <img class="user-profile-img" src="{{.User.Avatar}}" alt="@{{.User.Acct}}" height="96"> </a> </div> <div class="user-profile-details-container"> <div> - <bdi class="status-dname"> {{EmojiFilter (HTML .User.DisplayName) .User.Emojis | Raw}} </bdi> - <span class="status-uname"> @{{.User.Acct}} </span> + <bdi class="status-dname">{{EmojiFilter (HTML .User.DisplayName) .User.Emojis | Raw}}</bdi> + <span class="status-uname">@{{.User.Acct}}</span> <a class="remote-link" href="{{.User.URL}}" target="_blank" title="remote profile"> source </a> </div> - {{if not .IsCurrent}} + {{if (ne $.Ctx.UserID .User.ID)}} <div> <span> {{if .User.Pleroma.Relationship.FollowedBy}} follows you - {{end}} </span> {{if .User.Pleroma.Relationship.BlockedBy}} blocks you - {{end}} @@ -79,17 +78,7 @@ <input type="submit" value="unmute" class="btn-link"> </form> {{else}} - <form class="d-inline" action="/mute/{{.User.ID}}" method="post"> - <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}"> - <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}"> - <input type="submit" value="mute" class="btn-link"> - </form> - - - <form class="d-inline" action="/mute/{{.User.ID}}?notifications=false" method="post"> - <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}"> - <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}"> - <input type="submit" value="mute (keep notifications)" class="btn-link"> - </form> + <a href="/mute/{{.User.ID}}">mute</a> {{end}} {{if .User.Pleroma.Relationship.Following}} - @@ -110,96 +99,131 @@ </div> {{end}} <div> - <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> + <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> - {{if .IsCurrent}} + {{if (eq $.Ctx.UserID .User.ID)}} <div> - <a href="/user/{{.User.ID}}/bookmarks"> bookmarks </a> - - <a href="/user/{{.User.ID}}/likes"> likes </a> - - <a href="/user/{{.User.ID}}/mutes"> mutes </a> - - <a href="/user/{{.User.ID}}/blocks"> blocks </a> - {{if .User.Locked}}- <a href="/user/{{.User.ID}}/requests"> requests </a>{{end}} + <a href="/user/{{.User.ID}}/bookmarks">bookmarks</a> + - <a href="/user/{{.User.ID}}/likes">likes</a> + - <a href="/user/{{.User.ID}}/mutes">mutes</a> + - <a href="/user/{{.User.ID}}/blocks">blocks</a> + {{if .User.Locked}}- <a href="/user/{{.User.ID}}/requests">requests ( + {{- if .User.FollowRequestsCount}}{{.User.FollowRequestsCount}}{{else}}{{.User.Source.FollowRequestsCount}}{{end -}} + )</a>{{end}} </div> {{end}} <div> - <a href="/usersearch/{{.User.ID}}"> search statuses </a> - {{if .IsCurrent}} - <a href="/filters"> filters </a> {{end}} + <a href="/usersearch/{{.User.ID}}">search statuses</a> + {{if (eq $.Ctx.UserID .User.ID)}} - <a href="/filters">filters</a> {{end}} </div> </div> - <div class="user-profile-decription"> - {{EmojiFilter .User.Note .User.Emojis | Raw}} + <div class="user-profile-description"> + {{- EmojiFilter .User.Note .User.Emojis | Raw -}} </div> {{if .User.Fields}} <div class="user-fields"> {{range .User.Fields}} - <div>{{.Name}} - {{EmojiFilter .Value $.Data.User.Emojis | Raw}}</div> + <div>{{- EmojiFilter (HTML .Name) $.Data.User.Emojis | Raw}} - {{EmojiFilter .Value $.Data.User.Emojis | Raw -}}</div> {{end}} </div> {{end}} </div> -</div> {{if eq .Type ""}} -<div class="page-title"> Statuses </div> +<h1>Statuses</h1> {{range .Statuses}} {{template "status.tmpl" (WithContext . $.Ctx)}} {{else}} -<div class="no-data-found">No data found</div> +<p>No data found</p> {{end}} {{else if eq .Type "following"}} -<div class="page-title"> Following </div> -{{template "userlist.tmpl" (WithContext .Users $.Ctx)}} +<h1>Following</h1> +{{template "userlistfollow.tmpl" (WithContext .Users $.Ctx)}} {{else if eq .Type "followers"}} -<div class="page-title"> Followers </div> -{{template "userlist.tmpl" (WithContext .Users $.Ctx)}} +<h1>Followers</h1> +{{template "userlistfollow.tmpl" (WithContext .Users $.Ctx)}} {{else if eq .Type "media"}} -<div class="page-title"> Statuses with media </div> +<h1>Statuses With Media</h1> {{range .Statuses}} {{template "status.tmpl" (WithContext . $.Ctx)}} {{else}} -<div class="no-data-found">No data found</div> +<p>No data found</p> {{end}} {{else if eq .Type "bookmarks"}} -<div class="page-title"> Bookmarks </div> +<h1>Bookmarks</h1> {{range .Statuses}} {{template "status.tmpl" (WithContext . $.Ctx)}} {{else}} -<div class="no-data-found">No data found</div> +<p>No data found</p> {{end}} {{else if eq .Type "likes"}} -<div class="page-title"> Likes </div> +<h1>Likes</h1> {{range .Statuses}} {{template "status.tmpl" (WithContext . $.Ctx)}} {{else}} -<div class="no-data-found">No data found</div> +<p>No data found</p> {{end}} {{else if eq .Type "mutes"}} -<div class="page-title"> Mutes </div> -{{template "userlist.tmpl" (WithContext .Users $.Ctx)}} +<h1>Mutes</h1> +{{if .Users}} +<table> +{{range .Users}} + <tr> + <td> {{template "userlistitem.tmpl" (WithContext . $.Ctx)}} </td> + <td> + <form class="user-list-action" action="/unmute/{{.ID}}" method="POST"> + <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}"> + <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}"> + <button type="submit">Unmute</button> + </form> + </td> + </tr> +{{end}} +</table> +{{else}} +<p>No data found</p> +{{end}} {{else if eq .Type "blocks"}} -<div class="page-title"> Blocks </div> -{{template "userlist.tmpl" (WithContext .Users $.Ctx)}} +<h1>Blocks</h1> +{{if .Users}} +<table> +{{range .Users}} + <tr> + <td> {{template "userlistitem.tmpl" (WithContext . $.Ctx)}} </td> + <td> + <form class="user-list-action" action="/unblock/{{.ID}}" method="POST"> + <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}"> + <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}"> + <button type="submit">Unblock</button> + </form> + </td> + </tr> +{{end}} +</table> +{{else}} +<p>No data found</p> +{{end}} {{else if eq .Type "requests"}} -<div class="page-title"> Follow requests </div> +<h1>Follow Requests</h1> {{template "requestlist.tmpl" (WithContext .Users $.Ctx)}} {{end}} -<div class="pagination"> +<nav class="pagination"> {{if .NextLink}} <a href="{{.NextLink}}">[next]</a> {{end}} -</div> +</nav> {{template "footer.tmpl"}} {{end}} |