Add CSRF protection
[bloat] / templates / user.tmpl
1 {{with .Data}}
2 {{template "header.tmpl" (WithContext .HeaderData $.Ctx)}}
3 {{template "navigation.tmpl" (WithContext .NavbarData $.Ctx)}}
4 <div class="page-title"> User </div>
5
6 <div class="user-info-container">
7 <div>
8         <div class="user-profile-img-container">
9                 <a class="img-link" href="{{.User.AvatarStatic}}" target="_blank">
10                         <img class="user-profile-img" src="{{.User.AvatarStatic}}" alt="profile-avatar" />
11                 </a>
12         </div>
13         <div class="user-profile-details-container">
14                 <div>
15                         <span class="status-dname"> {{EmojiFilter .User.DisplayName .User.Emojis}} </span>  
16                         <span class="status-uname"> {{.User.Acct}} </span>
17                         <a class="remote-link" href="{{.User.URL}}" target="_blank" title="remote profile">
18                                 <img class="icon" src="{{GetIcon "link" $.Ctx.DarkMode}}" alt="link" />
19                         </a>
20                 </div>
21                 <div>
22                         <span> {{if .User.Pleroma.Relationship.FollowedBy}} follows you - {{end}} </span>  
23                         {{if .User.Pleroma.Relationship.Following}} 
24                         <form class="d-inline" action="/unfollow/{{.User.ID}}" method="post">
25                                 <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
26                                 <input type="submit" value="unfollow" class="btn-link">
27                         </form>
28                         {{end}} 
29                         {{if .User.Pleroma.Relationship.Requested}} 
30                         <form class="d-inline" action="/unfollow/{{.User.ID}}" method="post">
31                                 <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
32                                 <input type="submit" value="cancel request" class="btn-link">
33                         </form>
34                         {{end}} 
35                         {{if not .User.Pleroma.Relationship.Following}} 
36                         <form class="d-inline" action="/follow/{{.User.ID}}" method="post">
37                                 <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
38                                 <input type="submit" value="{{if .User.Pleroma.Relationship.Requested}}resend request{{else}}follow{{end}}" class="btn-link">
39                         </form>
40                         {{end}} 
41                 </div>
42                 <div>
43                         {{.User.StatusesCount}} statuses - 
44                         <a href="/following/{{.User.ID}}"> {{.User.FollowingCount}} following </a> - 
45                         <a href="/followers/{{.User.ID}}"> {{.User.FollowersCount}} followers </a>
46                 </div>
47         </div>
48         <div class="user-profile-decription">
49         {{.User.Note}}
50         </div>
51 </div>
52 </div>
53
54 {{range .Statuses}}
55 {{template "status.tmpl" (WithContext . $.Ctx)}}
56 {{end}}
57
58 <div class="pagination">
59         {{if .HasNext}}
60                 <a href="{{.NextLink}}">next</a>
61         {{end}}
62 </div>
63
64 {{template "footer.tmpl"}}
65 {{end}}